浏览代码

Merge remote-tracking branch 'IOBYTE/master'

Lee Thomason (grinliz) 13 年之前
父节点
当前提交
b476109083
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 4 4
      tinyxml2.cpp
  2. 2 2
      tinyxml2.h

+ 4 - 4
tinyxml2.cpp

@@ -1563,7 +1563,7 @@ int XMLDocument::LoadFile( FILE* fp )
 }
 
 
-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 @@ int XMLDocument::SaveFile( const char* filename )
 		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;
 }

+ 2 - 2
tinyxml2.h

@@ -1077,7 +1077,7 @@ public:
 		Returns XML_NO_ERROR (0) on success, or
 		an errorID.
 	*/
-	int SaveFile( const char* filename );
+	int SaveFile( const char* filename, bool compact = false );
 
 	/**
 		Save the XML file to disk. You are responsible
@@ -1086,7 +1086,7 @@ public:
 		Returns XML_NO_ERROR (0) on success, or
 		an errorID.
 	*/
-	int SaveFile( FILE* );
+	int SaveFile( FILE* fp, bool compact = false );
 
 	bool ProcessEntities() const						{ return processEntities; }