From c86c0cf088492e02431dffb1f860ff2f6faa492d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 27 Jun 2007 18:11:13 +0000 Subject: The taf system is new and improved. The writer works, we added C++ style comment blocks, and it retains the order of all nodes. --- src/tests/taf.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/tests/taf.cpp') 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 @@ #include "bu/tafreader.h" +#include "bu/tafwriter.h" #include "bu/file.h" int main() @@ -6,12 +7,18 @@ int main() Bu::File f("test.taf", "rb"); Bu::TafReader tr( f ); - Bu::TafNode *pNode = tr.getNode(); + Bu::TafGroup *pGroup = tr.readGroup(); - const Bu::TafNode *pStats = pNode->getChild("stats"); + const Bu::TafGroup *pStats = pGroup->getChild("stats"); printf("%s\n", pStats->getName().getStr() ); printf(" str = %s\n", pStats->getProperty("str").getStr() ); - delete pNode; + { + Bu::File fo("out.taf", "wb"); + Bu::TafWriter tw( fo ); + tw.writeGroup( pGroup ); + } + + delete pGroup; } -- cgit v1.2.3