aboutsummaryrefslogtreecommitdiff
path: root/src/tests/taf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/taf.cpp')
-rw-r--r--src/tests/taf.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/tests/taf.cpp b/src/tests/taf.cpp
index d135e78..e3da120 100644
--- a/src/tests/taf.cpp
+++ b/src/tests/taf.cpp
@@ -1,4 +1,5 @@
1#include "bu/tafreader.h" 1#include "bu/tafreader.h"
2#include "bu/tafwriter.h"
2#include "bu/file.h" 3#include "bu/file.h"
3 4
4int main() 5int main()
@@ -6,12 +7,18 @@ int main()
6 Bu::File f("test.taf", "rb"); 7 Bu::File f("test.taf", "rb");
7 Bu::TafReader tr( f ); 8 Bu::TafReader tr( f );
8 9
9 Bu::TafNode *pNode = tr.getNode(); 10 Bu::TafGroup *pGroup = tr.readGroup();
10 11
11 const Bu::TafNode *pStats = pNode->getChild("stats"); 12 const Bu::TafGroup *pStats = pGroup->getChild("stats");
12 printf("%s\n", pStats->getName().getStr() ); 13 printf("%s\n", pStats->getName().getStr() );
13 printf(" str = %s\n", pStats->getProperty("str").getStr() ); 14 printf(" str = %s\n", pStats->getProperty("str").getStr() );
14 15
15 delete pNode; 16 {
17 Bu::File fo("out.taf", "wb");
18 Bu::TafWriter tw( fo );
19 tw.writeGroup( pGroup );
20 }
21
22 delete pGroup;
16} 23}
17 24