1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00
rpcs3/Utilities/rXml.h

42 lines
957 B
C
Raw Normal View History

2020-12-25 03:18:36 +01:00
#pragma once
2021-04-03 18:38:02 +02:00
#ifdef _MSC_VER
#pragma warning(push, 0)
#include <pugixml.hpp>
2021-04-03 18:38:02 +02:00
#pragma warning(pop)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Weffc++"
#include <pugixml.hpp>
#pragma GCC diagnostic pop
#endif
2020-02-22 20:42:49 +01:00
#include <memory>
struct rXmlNode
{
rXmlNode();
rXmlNode(const pugi::xml_node& node);
std::shared_ptr<rXmlNode> GetChildren();
std::shared_ptr<rXmlNode> GetNext();
std::string GetName();
std::string GetAttribute(const std::string& name);
std::string GetNodeContent();
2021-04-03 18:38:02 +02:00
pugi::xml_node handle{};
};
struct rXmlDocument
{
rXmlDocument();
rXmlDocument(const rXmlDocument& other) = delete;
rXmlDocument &operator=(const rXmlDocument& other) = delete;
pugi::xml_parse_result Read(const std::string& data);
virtual std::shared_ptr<rXmlNode> GetRoot();
2021-04-03 18:38:02 +02:00
pugi::xml_document handle{};
};