diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-11-09 22:38:47 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-11-09 22:38:47 +0000 |
commit | 2ab64959d83ed2793d71ab3fa03b8ebdd4925902 (patch) | |
tree | 5417aeff1cadeb36793cfee3bc0733b2b6c77f44 /src/tafwriter.cpp | |
parent | bb9c0dc8dd2c852d9b6e89b9fd883232019cea93 (diff) | |
download | libbu++-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 'src/tafwriter.cpp')
-rw-r--r-- | src/tafwriter.cpp | 15 |
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 ) | |||
65 | void Bu::TafWriter::writeComment( const Bu::TafComment *pComment ) | 65 | void 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 | ||
73 | void Bu::TafWriter::writeString( const Bu::FString &str ) | 82 | void Bu::TafWriter::writeString( const Bu::FString &str ) |