From df1ece4814c709e9f0bf6354c241a0cd7cb09507 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 3 Oct 2022 10:05:55 -0700 Subject: Added insertNull and appendNull to Bu::Json. Just helpers to make using json easier and easier. --- src/unstable/json.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/unstable/json.cpp') diff --git a/src/unstable/json.cpp b/src/unstable/json.cpp index 65bd195..0903499 100644 --- a/src/unstable/json.cpp +++ b/src/unstable/json.cpp @@ -245,6 +245,11 @@ Bu::Json &Bu::Json::insertArray( const Bu::String &sKey ) return *pAr; } +Bu::Json &Bu::Json::insertNull( const Bu::String &sKey ) +{ + uDat.pObject->insert( sKey, new Json( Null ) ); +} + Bu::Json &Bu::Json::append( Bu::Json *pObj ) { uDat.pArray->append( pObj ); @@ -291,6 +296,11 @@ Bu::Json &Bu::Json::appendArray() return *pAr; } +Bu::Json &Bu::Json::appendNull() +{ + uDat.pArray->append( new Json( Null ) ); +} + void Bu::Json::parse( Bu::Stream &sInput ) { reset(); -- cgit v1.2.3