XMLParserCPP 1.0
Loading...
Searching...
No Matches
XMLParserCPP.h
1/*
2 * Copyright (C) 2025 Yury Bobylev <bobilev_yury@mail.ru>
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation, version 3.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16#ifndef XMLPARSERCPP_H
17#define XMLPARSERCPP_H
18
19#include <XMLElement.h>
20#include <memory>
21#include <stdexcept>
22#include <string>
23#include <vector>
24
41
48{
49public:
54
65 std::vector<XMLElement>
66 parseDocument(const std::string &xml_document);
67
68private:
69 void
70 parseElementAttribute(const std::string &document, size_t &position,
71 std::shared_ptr<XMLElement> element);
72
73 void
74 parseProgramControlElement(const std::string &document, size_t &position,
75 std::shared_ptr<XMLElement> element);
76
77 void
78 parseSpecialElement(const std::string &document, size_t &position,
79 std::shared_ptr<XMLElement> element);
80
81 void
82 parseElementContent(const std::string &document, size_t &position,
83 std::shared_ptr<XMLElement> element);
84
85 void
86 replaceXMLEntities(std::vector<XMLElement> &elements);
87
88 void
89 replacementFunc(std::string &str);
90
91 std::vector<std::tuple<std::string, std::string>> replacement;
92};
93
94#endif // XMLPARSERCPP_H
XMLParserCPP()
XMLParserCPP constructor.
std::vector< XMLElement > parseDocument(const std::string &xml_document)
Parses XML document.