mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Add XMLUtils.cpp and XMLUtils.h
These XML functions will be useful for de-duplicating copy-pasted XML handling code, while also making it so elements will get updated in place instead of being thrown out and starting from scratch every time a file is saved.
This commit is contained in:
27
desktop_version/src/XMLUtils.h
Normal file
27
desktop_version/src/XMLUtils.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// Forward decl, avoid including tinyxml2.h
|
||||
namespace tinyxml2
|
||||
{
|
||||
class XMLComment;
|
||||
class XMLDocument;
|
||||
class XMLDeclaration;
|
||||
class XMLElement;
|
||||
class XMLNode;
|
||||
}
|
||||
|
||||
namespace xml
|
||||
{
|
||||
|
||||
tinyxml2::XMLElement* update_element(tinyxml2::XMLNode* parent, const char* name);
|
||||
// Same thing as above, but takes &parent instead of *parent
|
||||
tinyxml2::XMLElement* update_element(tinyxml2::XMLNode& parent, const char* name);
|
||||
|
||||
tinyxml2::XMLElement* update_element_delete_contents(tinyxml2::XMLNode* parent, const char* name);
|
||||
|
||||
tinyxml2::XMLElement* update_tag(tinyxml2::XMLNode* parent, const char* name, const char* value);
|
||||
tinyxml2::XMLElement* update_tag(tinyxml2::XMLNode* parent, const char* name, const int value);
|
||||
|
||||
tinyxml2::XMLDeclaration* update_declaration(tinyxml2::XMLDocument& doc);
|
||||
|
||||
tinyxml2::XMLComment* update_comment(tinyxml2::XMLNode* parent, const char* text);
|
||||
|
||||
} // namespace xml
|
||||
Reference in New Issue
Block a user