From 850ebb96df909a4113fdf9c5bf82cf0f598901ca Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 3 Oct 2007 03:05:30 +0000 Subject: Added some fun new features to the TafNode system. --- src/tafnode.cpp | 16 ++++++++++++++++ src/tafnode.h | 4 ++++ 2 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/tafnode.cpp b/src/tafnode.cpp index 98bb030..c04455b 100644 --- a/src/tafnode.cpp +++ b/src/tafnode.cpp @@ -33,6 +33,11 @@ const Bu::FString &Bu::TafGroup::getName() const return sName; } +void Bu::TafGroup::setName( const Bu::FString &sName ) +{ + this->sName = sName; +} + Bu::TafNode *Bu::TafGroup::addChild( Bu::TafNode *pNode ) { switch( pNode->getType() ) @@ -79,6 +84,17 @@ Bu::TafComment *Bu::TafGroup::addChild( TafComment *pNode ) return pNode; } +Bu::TafGroup *Bu::TafGroup::addGroup( const Bu::FString &sName ) +{ + return addChild( new TafGroup( sName ) ); +} + +Bu::TafProperty *Bu::TafGroup::addProperty( + const Bu::FString &sName, const Bu::FString &sValue ) +{ + return addChild( new TafProperty( sName, sValue ) ); +} + const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::FString &sName ) const { return hChildren.get( sName ); diff --git a/src/tafnode.h b/src/tafnode.h index cb4093f..4940bee 100644 --- a/src/tafnode.h +++ b/src/tafnode.h @@ -46,6 +46,7 @@ namespace Bu virtual ~TafGroup(); const Bu::FString &getName() const; + void setName( const Bu::FString &sName ); const Bu::FString &getProperty( const Bu::FString &sName ) const; const PropList &getProperties( const Bu::FString &sName ) const; @@ -55,6 +56,9 @@ namespace Bu TafGroup *addChild( TafGroup *pNode ); TafProperty *addChild( TafProperty *pNode ); TafComment *addChild( TafComment *pNode ); + TafGroup *addGroup( const Bu::FString &sName ); + TafProperty *addProperty( + const Bu::FString &sName, const Bu::FString &sValue ); const NodeList &getChildren() const; private: -- cgit v1.2.3