aboutsummaryrefslogtreecommitdiff
path: root/src/tafwriter.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-11-09 22:38:47 +0000
committerMike Buland <eichlan@xagasoft.com>2007-11-09 22:38:47 +0000
commit2ab64959d83ed2793d71ab3fa03b8ebdd4925902 (patch)
tree5417aeff1cadeb36793cfee3bc0733b2b6c77f44 /src/tafwriter.cpp
parentbb9c0dc8dd2c852d9b6e89b9fd883232019cea93 (diff)
downloadlibbu++-2ab64959d83ed2793d71ab3fa03b8ebdd4925902.tar.gz
libbu++-2ab64959d83ed2793d71ab3fa03b8ebdd4925902.tar.bz2
libbu++-2ab64959d83ed2793d71ab3fa03b8ebdd4925902.tar.xz
libbu++-2ab64959d83ed2793d71ab3fa03b8ebdd4925902.zip
Figured I might as well add single-line comments to taf, it now supports //
style comments.
Diffstat (limited to '')
-rw-r--r--src/tafwriter.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/tafwriter.cpp b/src/tafwriter.cpp
index b5690fc..c2fbc50 100644
--- a/src/tafwriter.cpp
+++ b/src/tafwriter.cpp
@@ -65,9 +65,18 @@ void Bu::TafWriter::writeProperty( const Bu::TafProperty *pProp )
65void Bu::TafWriter::writeComment( const Bu::TafComment *pComment ) 65void Bu::TafWriter::writeComment( const Bu::TafComment *pComment )
66{ 66{
67 ident(); 67 ident();
68 sOut.write("/*", 2 ); 68 if( pComment->isEOLStyle() )
69 sOut.write( pComment->getText().getStr(), pComment->getText().getSize() ); 69 {
70 sOut.write("*/ ", 3 ); 70 sOut.write("//", 2 );
71 sOut.write( pComment->getText().getStr(), pComment->getText().getSize() );
72 sOut.write("\n", 1 );
73 }
74 else
75 {
76 sOut.write("/*", 2 );
77 sOut.write( pComment->getText().getStr(), pComment->getText().getSize() );
78 sOut.write("*/ ", 3 );
79 }
71} 80}
72 81
73void Bu::TafWriter::writeString( const Bu::FString &str ) 82void Bu::TafWriter::writeString( const Bu::FString &str )