From 3f26c19b0b7a9fa73c58189788972ea43b72f014 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 25 Jun 2007 21:15:55 +0000 Subject: 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. --- src/tafwriter.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/tafwriter.cpp') 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 @@ #include "tafwriter.h" -Bu::TafWriter::TafWriter() +Bu::TafWriter::TafWriter( Bu::Stream &sOut ) : + sOut( sOut ) { } Bu::TafWriter::~TafWriter() { } + +void Bu::TafWriter::writeNode( Bu::TafNode *pRoot ) +{ + sOut.write("{", 1 ); + writeString( pRoot->getName().getStr() ); + sOut.write(": ", 2 ); + sOut.write("}", 1 ); +} + +void Bu::TafWriter::writeString( const Bu::FString &str ) +{ + sOut.write("\"", 1 ); + for( const char *s = str.getStr(); *s; s++ ) + { + if( *s == '\"' ) + sOut.write("\\\"", 2 ); + else + sOut.write( s, 1 ); + } + sOut.write("\"", 1 ); +} + -- cgit v1.2.3