Add support to XMLDocument to save file in compact mode.
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index 8069d04..86a76a9 100644
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -1563,7 +1563,7 @@
}
-int XMLDocument::SaveFile( const char* filename )
+int XMLDocument::SaveFile( const char* filename, bool compact )
{
#if defined(_MSC_VER)
#pragma warning ( push )
@@ -1577,15 +1577,15 @@
SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );
return errorID;
}
- SaveFile(fp);
+ SaveFile(fp, compact);
fclose( fp );
return errorID;
}
-int XMLDocument::SaveFile( FILE* fp )
+int XMLDocument::SaveFile( FILE* fp, bool compact )
{
- XMLPrinter stream( fp );
+ XMLPrinter stream( fp, compact );
Print( &stream );
return errorID;
}