aboutsummaryrefslogtreecommitdiff
path: root/src/tafnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tafnode.cpp')
-rw-r--r--src/tafnode.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/tafnode.cpp b/src/tafnode.cpp
index ed8adc0..3060606 100644
--- a/src/tafnode.cpp
+++ b/src/tafnode.cpp
@@ -6,13 +6,13 @@ Bu::TafNode::TafNode()
6 6
7Bu::TafNode::~TafNode() 7Bu::TafNode::~TafNode()
8{ 8{
9 printf("Entering Bu::TafNode::~TafNode() \"%s\"\n", sName.getStr() ); 9 //printf("Entering Bu::TafNode::~TafNode() \"%s\"\n", sName.getStr() );
10 for( NodeHash::iterator i = hChildren.begin(); i != hChildren.end(); i++ ) 10 for( NodeHash::iterator i = hChildren.begin(); i != hChildren.end(); i++ )
11 { 11 {
12 NodeList &l = i.getValue(); 12 NodeList &l = i.getValue();
13 for( NodeList::iterator k = l.begin(); k != l.end(); k++ ) 13 for( NodeList::iterator k = l.begin(); k != l.end(); k++ )
14 { 14 {
15 printf("deleting: [%08X] %s\n", *k, "" );//(*k)->getName().getStr() ); 15 //printf("deleting: [%08X] %s\n", *k, "" );//(*k)->getName().getStr() );
16 delete (*k); 16 delete (*k);
17 } 17 }
18 } 18 }
@@ -35,27 +35,37 @@ void Bu::TafNode::addChild( TafNode *pNode )
35 hChildren.insert( pNode->getName(), NodeList() ); 35 hChildren.insert( pNode->getName(), NodeList() );
36 } 36 }
37 37
38 printf("Appending \"%s\"\n", pNode->getName().getStr() ); 38 //printf("Appending \"%s\"\n", pNode->getName().getStr() );
39 hChildren.get( pNode->getName() ).append( pNode ); 39 hChildren.get( pNode->getName() ).append( pNode );
40 printf("[%08X]\n", hChildren.get( pNode->getName() ).last() ); 40 //printf("[%08X]\n", hChildren.get( pNode->getName() ).last() );
41} 41}
42 42
43const Bu::TafNode::PropList &Bu::TafNode::getProperty( const Bu::FString &sName ) 43const Bu::TafNode::PropList &Bu::TafNode::getProperties( const Bu::FString &sName ) const
44{ 44{
45 return hProp.get( sName ); 45 return hProp.get( sName );
46} 46}
47 47
48const Bu::TafNode::NodeList &Bu::TafNode::getNode( const Bu::FString &sName ) 48const Bu::TafNode::NodeList &Bu::TafNode::getNodes( const Bu::FString &sName ) const
49{ 49{
50 return hChildren.get( sName ); 50 return hChildren.get( sName );
51} 51}
52 52
53const Bu::FString &Bu::TafNode::getProperty( const Bu::FString &sName ) const
54{
55 return getProperties( sName ).first();
56}
57
58const Bu::TafNode *Bu::TafNode::getNode( const Bu::FString &sName ) const
59{
60 return getNodes( sName ).first();
61}
62
53void Bu::TafNode::setName( const Bu::FString &sName ) 63void Bu::TafNode::setName( const Bu::FString &sName )
54{ 64{
55 this->sName = sName; 65 this->sName = sName;
56} 66}
57 67
58const Bu::FString &Bu::TafNode::getName() 68const Bu::FString &Bu::TafNode::getName() const
59{ 69{
60 return sName; 70 return sName;
61} 71}