Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
XMLParser.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Thales Lima Oliveira <thales@ufu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef XMLPARSER_H
19#define XMLPARSER_H
20
21#include "../extLibs/rapidXML/rapidxml.hpp"
22// Modified: http://stackoverflow.com/questions/14113923/rapidxml-print-header-has-undefined-methods
23#include "../extLibs/rapidXML/rapidxml_print.hpp"
24#include "../extLibs/rapidXML/rapidxml_utils.hpp"
25
26#include <wx/string.h>
27
36{
37 public:
38 XMLParser();
39 ~XMLParser();
40
41 static rapidxml::xml_node<>* AppendNode(rapidxml::xml_document<>& doc,
42 rapidxml::xml_node<>* parentNode,
43 const char* name,
44 rapidxml::node_type nodeType = rapidxml::node_element);
45 static void SetNodeValue(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* node, wxString value);
46 static void SetNodeValue(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* node, int value);
47 static void SetNodeValue(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* node, double value);
48 static void SetNodeAttribute(rapidxml::xml_document<>& doc,
49 rapidxml::xml_node<>* node,
50 const char* atrName,
51 wxString value);
52 static void SetNodeAttribute(rapidxml::xml_document<>& doc,
53 rapidxml::xml_node<>* node,
54 const char* atrName,
55 int value);
56 static void SetNodeAttribute(rapidxml::xml_document<>& doc,
57 rapidxml::xml_node<>* node,
58 const char* atrName,
59 double value);
60 static double GetNodeValueDouble(rapidxml::xml_node<>* parent, const char* nodeName);
61 static int GetNodeValueInt(rapidxml::xml_node<>* parent, const char* nodeName);
62 static int GetAttributeValueInt(rapidxml::xml_node<>* parent, const char* nodeName, const char* atrName);
63 static int GetAttributeValueInt(rapidxml::xml_node<>* node, const char* atrName);
64};
65
66#endif // XMLPARSER_H
XML parser to save and open project and control files.
Definition XMLParser.h:36