XMLParserCPP 1.0
Loading...
Searching...
No Matches
XMLAlgorithms.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 XMLALGORITHMS_H
17#define XMLALGORITHMS_H
18
19#include <XMLElement.h>
20
27{
28public:
33
49 static void
50 searchElement(const std::vector<XMLElement> &elements,
51 const std::string &element_name,
52 std::vector<XMLElement *> &result);
53
69 static void
70 searchElement(const std::vector<XMLElement> &elements,
71 const XMLElement::Type &element_type,
72 std::vector<XMLElement *> &result);
73
90 static void
91 searchElement(const std::vector<XMLElement> &elements,
92 const std::string &element_name,
93 const std::string &attribute_id,
94 std::vector<XMLElement *> &result);
95
113 static void
114 searchElement(const std::vector<XMLElement> &elements,
115 const std::string &element_name,
116 const std::string &attribute_id,
117 const std::string &attribute_value,
118 std::vector<XMLElement *> &result);
119
133 static void
134 searchElement(const std::vector<XMLElement *> &elements,
135 const std::string &element_name,
136 std::vector<XMLElement *> &result);
137
151 static void
152 searchElement(const std::vector<XMLElement *> &elements,
153 const XMLElement::Type &element_type,
154 std::vector<XMLElement *> &result);
155
170 static void
171 searchElement(const std::vector<XMLElement *> &elements,
172 const std::string &element_name,
173 const std::string &attribute_id,
174 std::vector<XMLElement *> &result);
175
192 static void
193 searchElement(const std::vector<XMLElement *> &elements,
194 const std::string &element_name,
195 const std::string &attribute_id,
196 const std::string &attribute_value,
197 std::vector<XMLElement *> &result);
198
204 static void
205 writeXML(const std::vector<XMLElement> &elements, std::string &result);
206
212 static void
213 writeXML(const std::vector<XMLElement *> &elements, std::string &result);
214
215private:
216 void
217 writeXMLRecursive(const std::vector<XMLElement> &elements,
218 std::string &result, size_t &tab_count);
219
220 void
221 writeXMLRecursive(const std::vector<XMLElement *> &elements,
222 std::string &result, size_t &tab_count);
223
224 void
225 copyAndReplaceProhibitedSymbols(const std::string &source,
226 std::string &result);
227};
228
229#endif // XMLALGORITHMS_H
static void searchElement(const std::vector< XMLElement * > &elements, const XMLElement::Type &element_type, std::vector< XMLElement * > &result)
Searches for XML elements.
static void searchElement(const std::vector< XMLElement > &elements, const XMLElement::Type &element_type, std::vector< XMLElement * > &result)
Searches for XML elements.
static void searchElement(const std::vector< XMLElement * > &elements, const std::string &element_name, const std::string &attribute_id, std::vector< XMLElement * > &result)
Searches for XML elements.
XMLAlgorithms()
XMLAlgorithms constructor.
static void searchElement(const std::vector< XMLElement > &elements, const std::string &element_name, const std::string &attribute_id, const std::string &attribute_value, std::vector< XMLElement * > &result)
Searches for XML elements.
static void writeXML(const std::vector< XMLElement * > &elements, std::string &result)
Writes XML elements to given string.
static void searchElement(const std::vector< XMLElement > &elements, const std::string &element_name, const std::string &attribute_id, std::vector< XMLElement * > &result)
Searches for XML elements.
static void writeXML(const std::vector< XMLElement > &elements, std::string &result)
Writes XML elements to given string.
static void searchElement(const std::vector< XMLElement > &elements, const std::string &element_name, std::vector< XMLElement * > &result)
Searches for XML elements.
static void searchElement(const std::vector< XMLElement * > &elements, const std::string &element_name, std::vector< XMLElement * > &result)
Searches for XML elements.
static void searchElement(const std::vector< XMLElement * > &elements, const std::string &element_name, const std::string &attribute_id, const std::string &attribute_value, std::vector< XMLElement * > &result)
Searches for XML elements.
Type
XML elements types enumerator.
Definition XMLElement.h:80