Remove TinyXML-1

This removes the TinyXML source files, removes it from CMakeLists.txt,
removes all the includes, and removes the functions
FILESYSTEM_saveTiXmlDocument() and FILESYSTEM_loadTiXmlDocument() (use
FILESYSTEM_saveTiXml2Document() and FILESYSTEM_loadTiXml2Document()
instead).

Additionally I've cleaned up the tinyxml2.h include in FileSystemUtils.h
so that it doesn't actually include tinyxml2.h unnecessarily, meaning a
change to TinyXML2 shouldn't rebuild all files that include
FileSystemUtils.h.
This commit is contained in:
Misa
2020-06-03 19:37:01 -07:00
committed by Ethan Lee
parent c397c898fc
commit 3f4df82583
13 changed files with 4 additions and 6373 deletions

View File

@@ -16,7 +16,7 @@
#include <SDL.h>
#include <physfs.h>
#include "tinyxml.h"
#include "tinyxml2.h"
#if defined(_WIN32)
#include <windows.h>
@@ -253,35 +253,6 @@ void FILESYSTEM_freeMemory(unsigned char **mem)
*mem = NULL;
}
bool FILESYSTEM_saveTiXmlDocument(const char *name, TiXmlDocument *doc)
{
/* TiXmlDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */
TiXmlPrinter printer;
doc->Accept(&printer);
PHYSFS_File* handle = PHYSFS_openWrite(name);
if (handle == NULL)
{
return false;
}
PHYSFS_writeBytes(handle, printer.CStr(), printer.Size());
PHYSFS_close(handle);
return true;
}
bool FILESYSTEM_loadTiXmlDocument(const char *name, TiXmlDocument *doc)
{
/* TiXmlDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */
unsigned char *mem = NULL;
FILESYSTEM_loadFileToMemory(name, &mem, NULL, true);
if (mem == NULL)
{
return false;
}
doc->Parse((const char*)mem, NULL, TIXML_ENCODING_UTF8);
FILESYSTEM_freeMemory(&mem);
return true;
}
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc)
{
/* XMLDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */