aboutsummaryrefslogtreecommitdiff
path: root/src/tests/taf.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-27 18:11:13 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-27 18:11:13 +0000
commitc86c0cf088492e02431dffb1f860ff2f6faa492d (patch)
tree1191879314028bb8f58daf45d48dacc6ba9ea583 /src/tests/taf.cpp
parent5ec9a131e12d021c42b46b601f5e79502485bebb (diff)
downloadlibbu++-c86c0cf088492e02431dffb1f860ff2f6faa492d.tar.gz
libbu++-c86c0cf088492e02431dffb1f860ff2f6faa492d.tar.bz2
libbu++-c86c0cf088492e02431dffb1f860ff2f6faa492d.tar.xz
libbu++-c86c0cf088492e02431dffb1f860ff2f6faa492d.zip
The taf system is new and improved. The writer works, we added C++ style
comment blocks, and it retains the order of all nodes.
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