From e6bfa98878bfb15adaa14755a5bf502f6b2dfaf3 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 1 Nov 2021 10:05:18 -0400 Subject: [PATCH] cwObjec.h/cpp : Added newObjectDict() and newObjectList(). --- cwObject.cpp | 5 +++++ cwObject.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/cwObject.cpp b/cwObject.cpp index 7037904..e53fa32 100644 --- a/cwObject.cpp +++ b/cwObject.cpp @@ -670,6 +670,11 @@ cw::object_t* cw::newObject( char* v, object_t* parent) cw::object_t* cw::newObject( const char* v, object_t* parent) { return _objCreateValueNode( parent, v ); } +cw::object_t* cw::newObjectDict( object_t* parent ) +{ return _objAllocate( kDictTId, parent); } + +cw::object_t* cw::newObjectList( object_t* parent ) +{ return _objAllocate( kListTId, parent ); } cw::object_t* cw::newPairObject( const char* label, std::uint8_t v, object_t* parent) { return _objCreatePairNode( parent, label, v ); } diff --git a/cwObject.h b/cwObject.h index aae4af8..9393289 100644 --- a/cwObject.h +++ b/cwObject.h @@ -220,6 +220,8 @@ namespace cw object_t* newObject( double v, object_t* parent=nullptr); object_t* newObject( char* v, object_t* parent=nullptr); object_t* newObject( const char* v, object_t* parent=nullptr); + object_t* newObjectDict( object_t* parent=nullptr ); + object_t* newObjectList( object_t* parent=nullptr ); // Return a pointer to the value node. object_t* newPairObject( const char* label, std::uint8_t v, object_t* parent=nullptr);