cwObjec.h/cpp : Added newObjectDict() and newObjectList().

This commit is contained in:
kevin 2021-11-01 10:05:18 -04:00
parent ea85ed42d8
commit e6bfa98878
2 changed files with 7 additions and 0 deletions

View File

@ -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) cw::object_t* cw::newObject( const char* v, object_t* parent)
{ return _objCreateValueNode<const char*>( parent, v ); } { return _objCreateValueNode<const char*>( 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) cw::object_t* cw::newPairObject( const char* label, std::uint8_t v, object_t* parent)
{ return _objCreatePairNode<uint8_t>( parent, label, v ); } { return _objCreatePairNode<uint8_t>( parent, label, v ); }

View File

@ -220,6 +220,8 @@ namespace cw
object_t* newObject( double v, object_t* parent=nullptr); object_t* newObject( double v, object_t* parent=nullptr);
object_t* newObject( char* 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* 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. // Return a pointer to the value node.
object_t* newPairObject( const char* label, std::uint8_t v, object_t* parent=nullptr); object_t* newPairObject( const char* label, std::uint8_t v, object_t* parent=nullptr);