From feb899f0b0aaaf236577cacf16e4c3b25b292fe6 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 22 Aug 2017 11:58:37 -0700 Subject: Updated json. It needs a lot more work before it can be used to programattically build complex objects, but it's a great start. --- src/unstable/json.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/unstable/json.cpp') 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 Bu::Json *Bu::Json::operator[]( const Bu::String &sKey ) const { - if( eType != Boolean ) + if( eType != Object ) throw Bu::ExceptionBase( "Object entry requested from non-object json object." ); @@ -159,6 +159,11 @@ Bu::Json::const_iterator Bu::Json::end() const return uDat.pArray->end(); } +void Bu::Json::insert( const Bu::String &sKey, Bu::Json *pObj ) +{ + uDat.pObject->insert( sKey, pObj ); +} + void Bu::Json::parse( Bu::Stream &sInput ) { reset(); -- cgit v1.2.3