aboutsummaryrefslogtreecommitdiff
path: root/src/tafwriter.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2008-12-29 21:33:08 +0000
committerMike Buland <eichlan@xagasoft.com>2008-12-29 21:33:08 +0000
commitf461b3c1839e5cfc85685ed1cb828ecaa74d6912 (patch)
tree5b04dabaea17632ba7c8ab448c9472ecfdaf765e /src/tafwriter.cpp
parentfc9da0992217c7d593ad97d2f338850b40cbaaec (diff)
downloadlibbu++-f461b3c1839e5cfc85685ed1cb828ecaa74d6912.tar.gz
libbu++-f461b3c1839e5cfc85685ed1cb828ecaa74d6912.tar.bz2
libbu++-f461b3c1839e5cfc85685ed1cb828ecaa74d6912.tar.xz
libbu++-f461b3c1839e5cfc85685ed1cb828ecaa74d6912.zip
Fixed some horror inside the Taf writer. It had a strange corner case when
adding a property to a group that had a name but an empty value. Also added a isEmpty() function to Bu::FString, finally.
Diffstat (limited to 'src/tafwriter.cpp')
-rw-r--r--src/tafwriter.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/tafwriter.cpp b/src/tafwriter.cpp
index 8e5fcdc..b0f5def 100644
--- a/src/tafwriter.cpp
+++ b/src/tafwriter.cpp
@@ -58,7 +58,7 @@ void Bu::TafWriter::writeGroup( const Bu::TafGroup *pRoot )
58void Bu::TafWriter::writeProperty( const Bu::TafProperty *pProp ) 58void Bu::TafWriter::writeProperty( const Bu::TafProperty *pProp )
59{ 59{
60 ident(); 60 ident();
61 if( pProp->getName().getStr() != NULL && pProp->getName() != "" ) 61 if( !pProp->getName().isEmpty() )
62 { 62 {
63 writeString( pProp->getName() ); 63 writeString( pProp->getName() );
64 sOut.write("=", 1 ); 64 sOut.write("=", 1 );
@@ -90,8 +90,6 @@ void Bu::TafWriter::writeComment( const Bu::TafComment *pComment )
90 90
91void Bu::TafWriter::writeString( const Bu::FString &str ) 91void Bu::TafWriter::writeString( const Bu::FString &str )
92{ 92{
93 if( str.getStr() == NULL )
94 return;
95 sOut.write("\"", 1 ); 93 sOut.write("\"", 1 );
96 for( Bu::FString::const_iterator s = str.begin(); s != str.end(); s++ ) 94 for( Bu::FString::const_iterator s = str.begin(); s != str.end(); s++ )
97 { 95 {