From bb9c0dc8dd2c852d9b6e89b9fd883232019cea93 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 9 Nov 2007 22:11:03 +0000 Subject: Fixed a silly bug in the taf system that interpreted the */ at the end of a comment block as a tag...oops. --- src/tests/taf.cpp | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'src/tests/taf.cpp') diff --git a/src/tests/taf.cpp b/src/tests/taf.cpp index cb9b75f..d832c9b 100644 --- a/src/tests/taf.cpp +++ b/src/tests/taf.cpp @@ -2,23 +2,37 @@ #include "bu/tafwriter.h" #include "bu/file.h" -int main() +int main( int argc, char *argv[] ) { - Bu::File f("test.taf", "rb"); - Bu::TafReader tr( f ); + if( argc == 1 ) + { + Bu::File f("test.taf", "rb"); + Bu::TafReader tr( f ); + + Bu::TafGroup *pGroup = tr.readGroup(); + + { + Bu::File fo("out.taf", "wb"); + Bu::TafWriter tw( fo ); + tw.writeGroup( pGroup ); + } - Bu::TafGroup *pGroup = tr.readGroup(); -/* - const Bu::TafGroup *pStats = pGroup->getChild("stats"); - printf("%s\n", pStats->getName().getStr() ); - printf(" str = %s\n", pStats->getProperty("str").getStr() );*/ -/* + delete pGroup; + } + else if( argc == 3 ) { - Bu::File fo("out.taf", "wb"); - Bu::TafWriter tw( fo ); - tw.writeGroup( pGroup ); - }*/ + Bu::File f( argv[1], "rb"); + Bu::TafReader tr( f ); + + Bu::TafGroup *pGroup = tr.readGroup(); + + { + Bu::File fo( argv[2], "wb"); + Bu::TafWriter tw( fo ); + tw.writeGroup( pGroup ); + } - delete pGroup; + delete pGroup; + } } -- cgit v1.2.3