summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-27 23:15:25 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-27 23:15:25 +0000
commitc84fe052b8bdeb0638d2c71e99e8fe992f5af647 (patch)
treeb3f548921c999f812995537ba3f4595df3b4d200
parent850f977e83182745549e907f8d86c4272e5f443b (diff)
downloadlibbu++-c84fe052b8bdeb0638d2c71e99e8fe992f5af647.tar.gz
libbu++-c84fe052b8bdeb0638d2c71e99e8fe992f5af647.tar.bz2
libbu++-c84fe052b8bdeb0638d2c71e99e8fe992f5af647.tar.xz
libbu++-c84fe052b8bdeb0638d2c71e99e8fe992f5af647.zip
Ooooh, more Taf-goodness.
-rw-r--r--src/tafnode.cpp39
-rw-r--r--src/tafnode.h3
2 files changed, 30 insertions, 12 deletions
diff --git a/src/tafnode.cpp b/src/tafnode.cpp
index 7e171c9..53b782e 100644
--- a/src/tafnode.cpp
+++ b/src/tafnode.cpp
@@ -61,29 +61,44 @@ Bu::TafNode *Bu::TafGroup::addChild( Bu::TafNode *pNode )
61 switch( pNode->getType() ) 61 switch( pNode->getType() )
62 { 62 {
63 case typeGroup: 63 case typeGroup:
64 { 64 addChild( (Bu::TafGroup *)pNode );
65 TafGroup *pGroup = (TafGroup *)pNode;
66 if( !hChildren.has( pGroup->getName() ) )
67 hChildren.insert( pGroup->getName(), GroupList() );
68 hChildren.get( pGroup->getName() ).append( pGroup );
69 }
70 break; 65 break;
71 66
72 case typeProperty: 67 case typeProperty:
73 { 68 addChild( (Bu::TafProperty *)pNode );
74 TafProperty *pProperty = (TafProperty *)pNode;
75 if( !hProp.has( pProperty->getName() ) )
76 hProp.insert( pProperty->getName(), PropList() );
77 hProp.get( pProperty->getName() ).append( pProperty->getValue() );
78 }
79 break; 69 break;
80 70
81 case typeComment: 71 case typeComment:
72 addChild( (Bu::TafComment *)pNode );
82 break; 73 break;
83 } 74 }
84 75
76 return pNode;
77}
78
79Bu::TafGroup *Bu::TafGroup::addChild( TafGroup *pNode )
80{
81 TafGroup *pGroup = (TafGroup *)pNode;
82 if( !hChildren.has( pGroup->getName() ) )
83 hChildren.insert( pGroup->getName(), GroupList() );
84 hChildren.get( pGroup->getName() ).append( pGroup );
85 lChildren.append( pNode ); 85 lChildren.append( pNode );
86 return pNode;
87}
86 88
89Bu::TafProperty *Bu::TafGroup::addChild( TafProperty *pNode )
90{
91 TafProperty *pProperty = (TafProperty *)pNode;
92 if( !hProp.has( pProperty->getName() ) )
93 hProp.insert( pProperty->getName(), PropList() );
94 hProp.get( pProperty->getName() ).append( pProperty->getValue() );
95 lChildren.append( pNode );
96 return pNode;
97}
98
99Bu::TafComment *Bu::TafGroup::addChild( TafComment *pNode )
100{
101 lChildren.append( pNode );
87 return pNode; 102 return pNode;
88} 103}
89 104
diff --git a/src/tafnode.h b/src/tafnode.h
index 0fdcba7..cb4093f 100644
--- a/src/tafnode.h
+++ b/src/tafnode.h
@@ -52,6 +52,9 @@ namespace Bu
52 const TafGroup *getChild( const Bu::FString &sName ) const; 52 const TafGroup *getChild( const Bu::FString &sName ) const;
53 const GroupList &getChildren( const Bu::FString &sName ) const; 53 const GroupList &getChildren( const Bu::FString &sName ) const;
54 TafNode *addChild( TafNode *pNode ); 54 TafNode *addChild( TafNode *pNode );
55 TafGroup *addChild( TafGroup *pNode );
56 TafProperty *addChild( TafProperty *pNode );
57 TafComment *addChild( TafComment *pNode );
55 const NodeList &getChildren() const; 58 const NodeList &getChildren() const;
56 59
57 private: 60 private: