diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tafreader.cpp | 3 | ||||
-rw-r--r-- | src/tests/taf.cpp | 42 |
2 files changed, 31 insertions, 14 deletions
diff --git a/src/tafreader.cpp b/src/tafreader.cpp index 6441ac3..5609f7c 100644 --- a/src/tafreader.cpp +++ b/src/tafreader.cpp | |||
@@ -79,7 +79,10 @@ Bu::TafComment *Bu::TafReader::readComment() | |||
79 | { | 79 | { |
80 | next(); | 80 | next(); |
81 | if( c == '*' && la == '/' ) | 81 | if( c == '*' && la == '/' ) |
82 | { | ||
83 | next(); next(); | ||
82 | break; | 84 | break; |
85 | } | ||
83 | sCmnt += c; | 86 | sCmnt += c; |
84 | } | 87 | } |
85 | 88 | ||
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 | ||