diff options
author | Mike Buland <mbuland@penny-arcade.com> | 2017-08-22 11:58:37 -0700 |
---|---|---|
committer | Mike Buland <mbuland@penny-arcade.com> | 2017-08-22 11:58:37 -0700 |
commit | feb899f0b0aaaf236577cacf16e4c3b25b292fe6 (patch) | |
tree | 2d4391dba6b06a15f3476e3d39c59b035da26aac /src/unstable/json.cpp | |
parent | 2fc7fcd7161121ab48cda40687d7d152e03b3079 (diff) | |
download | libbu++-feb899f0b0aaaf236577cacf16e4c3b25b292fe6.tar.gz libbu++-feb899f0b0aaaf236577cacf16e4c3b25b292fe6.tar.bz2 libbu++-feb899f0b0aaaf236577cacf16e4c3b25b292fe6.tar.xz libbu++-feb899f0b0aaaf236577cacf16e4c3b25b292fe6.zip |
Updated json.
It needs a lot more work before it can be used to programattically build
complex objects, but it's a great start.
Diffstat (limited to '')
-rw-r--r-- | src/unstable/json.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp index f5a1696..d13f6e2 100644 --- a/src/unstable/json.cpp +++ b/src/unstable/json.cpp | |||
@@ -116,7 +116,7 @@ bool Bu::Json::isNull() const | |||
116 | 116 | ||
117 | Bu::Json *Bu::Json::operator[]( const Bu::String &sKey ) const | 117 | Bu::Json *Bu::Json::operator[]( const Bu::String &sKey ) const |
118 | { | 118 | { |
119 | if( eType != Boolean ) | 119 | if( eType != Object ) |
120 | throw Bu::ExceptionBase( | 120 | throw Bu::ExceptionBase( |
121 | "Object entry requested from non-object json object." | 121 | "Object entry requested from non-object json object." |
122 | ); | 122 | ); |
@@ -159,6 +159,11 @@ Bu::Json::const_iterator Bu::Json::end() const | |||
159 | return uDat.pArray->end(); | 159 | return uDat.pArray->end(); |
160 | } | 160 | } |
161 | 161 | ||
162 | void Bu::Json::insert( const Bu::String &sKey, Bu::Json *pObj ) | ||
163 | { | ||
164 | uDat.pObject->insert( sKey, pObj ); | ||
165 | } | ||
166 | |||
162 | void Bu::Json::parse( Bu::Stream &sInput ) | 167 | void Bu::Json::parse( Bu::Stream &sInput ) |
163 | { | 168 | { |
164 | reset(); | 169 | reset(); |