From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/stable/tafwriter.cpp | 112 +++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 56 deletions(-) (limited to 'src/stable/tafwriter.cpp') diff --git a/src/stable/tafwriter.cpp b/src/stable/tafwriter.cpp index 00d9f68..f17a237 100644 --- a/src/stable/tafwriter.cpp +++ b/src/stable/tafwriter.cpp @@ -9,8 +9,8 @@ #include "bu/stream.h" Bu::TafWriter::TafWriter( Bu::Stream &sOut ) : - sOut( sOut ), - iDepth( 0 ) + sOut( sOut ), + iDepth( 0 ) { } @@ -20,81 +20,81 @@ Bu::TafWriter::~TafWriter() void Bu::TafWriter::ident() { - for( int j = 0; j < iDepth; j++ ) - sOut.write(" ", 4 ); + for( int j = 0; j < iDepth; j++ ) + sOut.write(" ", 4 ); } void Bu::TafWriter::writeGroup( const Bu::TafGroup *pRoot ) { - ident(); - sOut.write("{", 1 ); - if( pRoot->getName().isSet() ) - writeString( pRoot->getName() ); - sOut.write(":\n", 2 ); - iDepth++; - const Bu::TafGroup::NodeList &nl = pRoot->getChildren(); - for( Bu::TafGroup::NodeList::const_iterator i = nl.begin(); i != nl.end(); i++ ) - { - switch( (*i)->getType() ) - { - case Bu::TafNode::typeGroup: - writeGroup( (Bu::TafGroup *)(*i) ); - break; + ident(); + sOut.write("{", 1 ); + if( pRoot->getName().isSet() ) + writeString( pRoot->getName() ); + sOut.write(":\n", 2 ); + iDepth++; + const Bu::TafGroup::NodeList &nl = pRoot->getChildren(); + for( Bu::TafGroup::NodeList::const_iterator i = nl.begin(); i != nl.end(); i++ ) + { + switch( (*i)->getType() ) + { + case Bu::TafNode::typeGroup: + writeGroup( (Bu::TafGroup *)(*i) ); + break; - case Bu::TafNode::typeProperty: - writeProperty( (Bu::TafProperty *)(*i) ); - break; + case Bu::TafNode::typeProperty: + writeProperty( (Bu::TafProperty *)(*i) ); + break; - case Bu::TafNode::typeComment: - writeComment( (Bu::TafComment *)(*i) ); - break; - } - } - iDepth--; - ident(); - sOut.write("}\n", 2 ); + case Bu::TafNode::typeComment: + writeComment( (Bu::TafComment *)(*i) ); + break; + } + } + iDepth--; + ident(); + sOut.write("}\n", 2 ); } void Bu::TafWriter::writeProperty( const Bu::TafProperty *pProp ) { - ident(); - if( !pProp->getName().isEmpty() ) - { - writeString( pProp->getName() ); - sOut.write("=", 1 ); - writeString( pProp->getValue() ); - } - else - { - writeString( pProp->getValue() ); - } - sOut.write("\n", 1 ); + ident(); + if( !pProp->getName().isEmpty() ) + { + writeString( pProp->getName() ); + sOut.write("=", 1 ); + writeString( pProp->getValue() ); + } + else + { + writeString( pProp->getValue() ); + } + sOut.write("\n", 1 ); } void Bu::TafWriter::writeComment( const Bu::TafComment *pComment ) { - ident(); - if( pComment->isEOLStyle() ) - { - sOut.write("//", 2 ); - sOut.write( pComment->getText().getStr(), pComment->getText().getSize() ); - sOut.write("\n", 1 ); - } - else - { - sOut.write("/*", 2 ); - sOut.write( pComment->getText().getStr(), pComment->getText().getSize() ); - sOut.write("*/ ", 3 ); - } + ident(); + if( pComment->isEOLStyle() ) + { + sOut.write("//", 2 ); + sOut.write( pComment->getText().getStr(), pComment->getText().getSize() ); + sOut.write("\n", 1 ); + } + else + { + sOut.write("/*", 2 ); + sOut.write( pComment->getText().getStr(), pComment->getText().getSize() ); + sOut.write("*/ ", 3 ); + } } void Bu::TafWriter::writeString( const Bu::String &str ) { - sOut.write("\"", 1 ); + sOut.write("\"", 1 ); for( Bu::String::const_iterator s = str.begin(); s != str.end(); s++ ) { if( *s == '\"' ) - sOut.write("\\\"", 2 ); + sOut.write("\\\"", 2 ); else if( *s == '\\' ) sOut.write("\\\\", 2 ); else if( *s < 32 || *s > 126 ) -- cgit v1.2.3