diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-06-25 21:15:55 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-06-25 21:15:55 +0000 |
commit | 3f26c19b0b7a9fa73c58189788972ea43b72f014 (patch) | |
tree | 8f34928a267fb35becdf939d21187a526f235869 /src/tafwriter.cpp | |
parent | 2b0fa89df615cb4789668014475ae64d99e773b5 (diff) | |
download | libbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.tar.gz libbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.tar.bz2 libbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.tar.xz libbu++-3f26c19b0b7a9fa73c58189788972ea43b72f014.zip |
I think the plugger and programchain are all up to date to work with the new
libbu++. The program chain may undergo heavy changes still, or be removed
entirely, but we need it for congo and squirrelmud, so here it is for a while
longer.
The TafWriter isn't much closer, you still only get the groups in the output.
Diffstat (limited to '')
-rw-r--r-- | src/tafwriter.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/tafwriter.cpp b/src/tafwriter.cpp index 3e6c025..ac42d3d 100644 --- a/src/tafwriter.cpp +++ b/src/tafwriter.cpp | |||
@@ -1,9 +1,32 @@ | |||
1 | #include "tafwriter.h" | 1 | #include "tafwriter.h" |
2 | 2 | ||
3 | Bu::TafWriter::TafWriter() | 3 | Bu::TafWriter::TafWriter( Bu::Stream &sOut ) : |
4 | sOut( sOut ) | ||
4 | { | 5 | { |
5 | } | 6 | } |
6 | 7 | ||
7 | Bu::TafWriter::~TafWriter() | 8 | Bu::TafWriter::~TafWriter() |
8 | { | 9 | { |
9 | } | 10 | } |
11 | |||
12 | void Bu::TafWriter::writeNode( Bu::TafNode *pRoot ) | ||
13 | { | ||
14 | sOut.write("{", 1 ); | ||
15 | writeString( pRoot->getName().getStr() ); | ||
16 | sOut.write(": ", 2 ); | ||
17 | sOut.write("}", 1 ); | ||
18 | } | ||
19 | |||
20 | void Bu::TafWriter::writeString( const Bu::FString &str ) | ||
21 | { | ||
22 | sOut.write("\"", 1 ); | ||
23 | for( const char *s = str.getStr(); *s; s++ ) | ||
24 | { | ||
25 | if( *s == '\"' ) | ||
26 | sOut.write("\\\"", 2 ); | ||
27 | else | ||
28 | sOut.write( s, 1 ); | ||
29 | } | ||
30 | sOut.write("\"", 1 ); | ||
31 | } | ||
32 | |||