diff options
Diffstat (limited to '')
-rw-r--r-- | src/tests/taf.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
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 @@ | |||
2 | #include "bu/tafwriter.h" | 2 | #include "bu/tafwriter.h" |
3 | #include "bu/file.h" | 3 | #include "bu/file.h" |
4 | 4 | ||
5 | int main() | 5 | int main( int argc, char *argv[] ) |
6 | { | 6 | { |
7 | Bu::File f("test.taf", "rb"); | 7 | if( argc == 1 ) |
8 | Bu::TafReader tr( f ); | 8 | { |
9 | Bu::File f("test.taf", "rb"); | ||
10 | Bu::TafReader tr( f ); | ||
11 | |||
12 | Bu::TafGroup *pGroup = tr.readGroup(); | ||
13 | |||
14 | { | ||
15 | Bu::File fo("out.taf", "wb"); | ||
16 | Bu::TafWriter tw( fo ); | ||
17 | tw.writeGroup( pGroup ); | ||
18 | } | ||
9 | 19 | ||
10 | Bu::TafGroup *pGroup = tr.readGroup(); | 20 | delete pGroup; |
11 | /* | 21 | } |
12 | const Bu::TafGroup *pStats = pGroup->getChild("stats"); | 22 | else if( argc == 3 ) |
13 | printf("%s\n", pStats->getName().getStr() ); | ||
14 | printf(" str = %s\n", pStats->getProperty("str").getStr() );*/ | ||
15 | /* | ||
16 | { | 23 | { |
17 | Bu::File fo("out.taf", "wb"); | 24 | Bu::File f( argv[1], "rb"); |
18 | Bu::TafWriter tw( fo ); | 25 | Bu::TafReader tr( f ); |
19 | tw.writeGroup( pGroup ); | 26 | |
20 | }*/ | 27 | Bu::TafGroup *pGroup = tr.readGroup(); |
28 | |||
29 | { | ||
30 | Bu::File fo( argv[2], "wb"); | ||
31 | Bu::TafWriter tw( fo ); | ||
32 | tw.writeGroup( pGroup ); | ||
33 | } | ||
21 | 34 | ||
22 | delete pGroup; | 35 | delete pGroup; |
36 | } | ||
23 | } | 37 | } |
24 | 38 | ||