diff options
Diffstat (limited to '')
-rw-r--r-- | src/unstable/json.cpp | 7 | ||||
-rw-r--r-- | src/unstable/json.h | 2 |
2 files changed, 8 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(); |
diff --git a/src/unstable/json.h b/src/unstable/json.h index 76d96be..5a59b7e 100644 --- a/src/unstable/json.h +++ b/src/unstable/json.h | |||
@@ -51,6 +51,8 @@ namespace Bu | |||
51 | iterator end(); | 51 | iterator end(); |
52 | const_iterator end() const; | 52 | const_iterator end() const; |
53 | 53 | ||
54 | void insert( const Bu::String &sKey, Bu::Json *pObj ); | ||
55 | |||
54 | void parse( Bu::Stream &sInput ); | 56 | void parse( Bu::Stream &sInput ); |
55 | void parse( const Bu::String &sInput ); | 57 | void parse( const Bu::String &sInput ); |
56 | void reset(); | 58 | void reset(); |