Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bool true/false rather than 0/1 : #399 #469

Merged
merged 2 commits into from Aug 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tinyxml2.cpp
Expand Up @@ -538,7 +538,7 @@ void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize )

void XMLUtil::ToStr( bool v, char* buffer, int bufferSize )
{
TIXML_SNPRINTF( buffer, bufferSize, "%d", v ? 1 : 0 );
TIXML_SNPRINTF( buffer, bufferSize, "%s", v ? "true" : "false" );
}

/*
Expand Down
4 changes: 2 additions & 2 deletions xmltest.cpp
Expand Up @@ -451,7 +451,7 @@ int main( int argc, const char ** argv )
{
XMLPrinter streamer( 0, true );
doc->Print( &streamer );
XMLTest( "Compact mode", "<element><sub attrib=\"1\"/><sub/></element>", streamer.CStr(), false );
XMLTest( "Compact mode", "<element><sub attrib=\"true\"/><sub/></element>", streamer.CStr(), false );
}
doc->SaveFile( "./resources/out/pretty.xml" );
doc->SaveFile( "./resources/out/compact.xml", true );
Expand Down Expand Up @@ -679,7 +679,7 @@ int main( int argc, const char ** argv )
XMLTest( "SetText types", "1", element->GetText() );

element->SetText( true );
XMLTest( "SetText types", "1", element->GetText() ); // TODO: should be 'true'?
XMLTest( "SetText types", "true", element->GetText() );

element->SetText( 1.5f );
XMLTest( "SetText types", "1.5", element->GetText() );
Expand Down