OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLXmlParser.hpp
Go to the documentation of this file.
1/*
2 * OpenXLSX-NX - Modern High-Performance C++ Excel Library
3 *
4 * Original work Copyright (c) 2018-2025, Kenneth Troldal Balslev and OpenXLSX contributors
5 * Modified work Copyright (c) 2026, Curry Tang and OpenXLSX-NX contributors
6 *
7 * Distributed under the BSD 3-Clause License.
8 * See LICENSE.md in the project root or https://opensource.org/licenses/BSD-3-Clause
9 */
10
11#ifndef OPENXLSX_XLXMLPARSER_HPP
12#define OPENXLSX_XLXMLPARSER_HPP
13
14#include <cstddef>
15#include <cstdint>
16#include <memory> // shared_ptr, unique_ptr
17#include <cstring> // std::strchr
18#include <string>
19#include <ostream>
20#include <iterator> // std::ptrdiff_t, std::forward_iterator_tag
21#include <functional> // std::function
22
23// ===== OpenXLSX Includes ===== //
24#include "OpenXLSX-Exports.hpp"
25
26// Forward declarations for pugixml structs and classes to avoid including pugixml.hpp
27namespace pugi
28{
29 struct xml_node_struct;
30 struct xml_attribute_struct;
31 class xml_node;
32 class xml_attribute;
33 class xml_document;
34 class xml_writer;
35 class xpath_node;
36 class xpath_node_set;
37}
38
39namespace OpenXLSX
40{
41#define ENABLE_XML_NAMESPACES 1
42
43#ifdef ENABLE_XML_NAMESPACES
44 #define NAMESPACED_NAME(name_, force_ns_) namespaced_name_proxy(name_, force_ns_).c_str()
45#else
46 #define NAMESPACED_NAME(name_, force_ns_) name_
47#endif
48
49 constexpr const bool XLForceNamespace = true;
50
53
54 // Forward declarations
57 class XMLAttribute;
58 class XMLText;
59 class XMLNodeIterator;
60 class XMLNodeRange;
63
66
67 // XMLNodeType as int with constants to prevent -Wenum-compare warnings when comparing with pugixml enums
68 using XMLNodeType = int;
69 constexpr XMLNodeType node_null = 0;
72 constexpr XMLNodeType node_pcdata = 3;
73 constexpr XMLNodeType node_cdata = 4;
77 constexpr XMLNodeType node_pi = 8;
78
79 // XMLParseStatus mapping
80 using XMLParseStatus = int;
98
99 struct OPENXLSX_EXPORT XMLParseResult {
100 explicit operator bool() const { return m_bool; }
101 const char* description() const { return m_description; }
103
104 bool m_bool{false};
105 const char* m_description{""};
106 };
107
108 class NameProxy {
109 std::string m_str;
110 const char* m_ptr;
111 public:
112 NameProxy(const char* ptr) : m_str(), m_ptr(ptr) {}
113 NameProxy(std::string str) : m_str(std::move(str)), m_ptr(m_str.c_str()) {}
114 const char* c_str() const { return m_ptr; }
115 };
116
117 // ===== Custom OpenXLSX_xml_node wrapper class =====
118 class OPENXLSX_EXPORT OpenXLSX_xml_node
119 {
120 public:
122 OpenXLSX_xml_node(pugi::xml_node_struct* node);
123 OpenXLSX_xml_node(const pugi::xml_node& node); // Implicit conversion constructor
124
125 bool operator==(const OpenXLSX_xml_node& other) const;
126 bool operator!=(const OpenXLSX_xml_node& other) const;
127 bool operator<(const OpenXLSX_xml_node& other) const;
128 explicit operator bool() const;
129 bool empty() const;
130
131 const char* name() const;
132 const char* raw_name() const;
133 const char* value() const;
134 bool set_name(const char* rhs, bool force_ns = false);
135 bool set_name(const char* rhs, size_t size, bool force_ns = false);
136 bool set_value(const char* rhs);
137
138 XMLAttribute attribute(const char* name_) const;
141 XMLAttribute append_attribute(const char* name_);
142 XMLAttribute prepend_attribute(const char* name_);
143 bool remove_attribute(const char* name_);
144 bool remove_attribute(const XMLAttribute& a);
145 void remove_attributes();
146
147 XMLNode parent() const;
148 XMLNode child(const char* name_) const;
149 XMLNode next_sibling(const char* name_) const;
150 XMLNode next_sibling() const;
151 XMLNode previous_sibling(const char* name_) const;
153 const char* child_value() const;
154 const char* child_value(const char* name_) const;
155
156 XMLNode first_child() const;
157 XMLNode last_child() const;
158
159 template<typename T = XMLNodeType>
161 return append_child_impl(static_cast<int>(type_));
162 }
163 template<typename T = XMLNodeType>
165 return prepend_child_impl(static_cast<int>(type_));
166 }
167
168 XMLNode append_child(const char* name_, bool force_ns = false);
169 XMLNode prepend_child(const char* name_, bool force_ns = false);
170
171 template<typename T = XMLNodeType>
172 XMLNode insert_child_after(T type_, const XMLNode& node) {
173 return insert_child_after_impl(static_cast<int>(type_), node);
174 }
175 template<typename T = XMLNodeType>
176 XMLNode insert_child_before(T type_, const XMLNode& node) {
177 return insert_child_before_impl(static_cast<int>(type_), node);
178 }
179
180 XMLNode insert_child_after(const char* name_, const XMLNode& node, bool force_ns = false);
181 XMLNode insert_child_before(const char* name_, const XMLNode& node, bool force_ns = false);
182
183 bool remove_child(const char* name_);
184 bool remove_child(const XMLNode& n);
185 void remove_children();
186
187 XMLNode find_child_by_attribute(const char* name_, const char* attr_name, const char* attr_value) const;
188 XMLNode find_child_by_attribute(const char* attr_name, const char* attr_value) const;
189
190 template<typename Predicate>
191 XMLNode find_child(Predicate pred) const {
192 return find_child_impl([&pred](pugi::xml_node_struct* n) {
193 return pred(XMLNode(n));
194 });
195 }
196
197 pugi::xpath_node select_node(const char* query) const;
198 pugi::xpath_node_set select_nodes(const char* query) const;
199
200 XMLText text() const;
201 XMLNodeType type() const;
202
203 template<typename T = XMLNodeType>
205 return first_child_of_type_impl(static_cast<int>(type_));
206 }
207 template<typename T = XMLNodeType>
209 return last_child_of_type_impl(static_cast<int>(type_));
210 }
211 template<typename T = XMLNodeType>
212 size_t child_count_of_type(T type_ = node_element) const {
213 return child_count_of_type_impl(static_cast<int>(type_));
214 }
215 template<typename T = XMLNodeType>
217 return next_sibling_of_type_impl(static_cast<int>(type_));
218 }
219 template<typename T = XMLNodeType>
221 return previous_sibling_of_type_impl(static_cast<int>(type_));
222 }
223 template<typename T = XMLNodeType>
224 XMLNode next_sibling_of_type(const char* name_, T type_ = node_element) const {
225 return next_sibling_of_type_name_impl(name_, static_cast<int>(type_));
226 }
227 template<typename T = XMLNodeType>
228 XMLNode previous_sibling_of_type(const char* name_, T type_ = node_element) const {
229 return previous_sibling_of_type_name_impl(name_, static_cast<int>(type_));
230 }
231
232 // Copy and move methods (analogous to pugixml)
233 XMLNode append_copy(const XMLNode& node);
234 XMLNode prepend_copy(const XMLNode& node);
235 XMLNode insert_copy_after(const XMLNode& node, const XMLNode& ref);
236 XMLNode insert_copy_before(const XMLNode& node, const XMLNode& ref);
237
238 XMLNode append_move(const XMLNode& node);
239 XMLNode prepend_move(const XMLNode& node);
240 XMLNode insert_move_after(const XMLNode& node, const XMLNode& ref);
241 XMLNode insert_move_before(const XMLNode& node, const XMLNode& ref);
242
243 XMLAttribute append_copy(const XMLAttribute& attr);
244
245 // Conversion operator to pugi::xml_node (implemented in cpp)
246 operator pugi::xml_node() const;
247
248 // Iteration ranges
249 XMLNodeRange children() const;
250 XMLNodeRange children(const char* name_) const;
251 XMLAttributeRange attributes() const;
252
253 void print(std::ostream& os, const char* indent = "\t", unsigned int flags = 1 /* format_default */) const;
254
255 const char* name_without_namespace(const char* name_) const;
256 NameProxy namespaced_name_proxy(const char* name_, bool force_ns) const;
257
258 pugi::xml_node_struct* internal_object() const { return m_node; }
259
260 private:
261 XMLNode append_child_impl(int type_);
262 XMLNode prepend_child_impl(int type_);
263 XMLNode insert_child_after_impl(int type_, const XMLNode& node);
264 XMLNode insert_child_before_impl(int type_, const XMLNode& node);
265 XMLNode first_child_of_type_impl(int type_) const;
266 XMLNode last_child_of_type_impl(int type_) const;
267 size_t child_count_of_type_impl(int type_) const;
268 XMLNode next_sibling_of_type_impl(int type_) const;
269 XMLNode previous_sibling_of_type_impl(int type_) const;
270 XMLNode next_sibling_of_type_name_impl(const char* name_, int type_) const;
271 XMLNode previous_sibling_of_type_name_impl(const char* name_, int type_) const;
272
273 // Non-templated helper for find_child
274 XMLNode find_child_impl(std::function<bool(pugi::xml_node_struct*)> pred) const;
275
276 protected:
277 pugi::xml_node_struct* m_node{nullptr};
278 size_t name_begin{0};
279 };
280
281 // ===== XMLAttribute wrapper class =====
282 class OPENXLSX_EXPORT XMLAttribute
283 {
284 public:
285 XMLAttribute();
286 XMLAttribute(pugi::xml_attribute_struct* attr);
287 XMLAttribute(const pugi::xml_attribute& attr); // Implicit conversion constructor
288
289 bool operator==(const XMLAttribute& other) const;
290 bool operator!=(const XMLAttribute& other) const;
291 explicit operator bool() const;
292 bool empty() const;
293
294 const char* name() const;
295 const char* value() const;
296 bool set_name(const char* rhs);
297 bool set_value(const char* rhs);
298 bool set_value(int rhs);
299 bool set_value(unsigned int rhs);
300 bool set_value(long rhs);
301 bool set_value(unsigned long rhs);
302 bool set_value(double rhs);
303 bool set_value(bool rhs);
304 bool set_value(long long rhs);
305 bool set_value(unsigned long long rhs);
306
307 // Assignment overloads
308 XMLAttribute& operator=(const char* rhs) { set_value(rhs); return *this; }
309 XMLAttribute& operator=(int rhs) { set_value(rhs); return *this; }
310 XMLAttribute& operator=(unsigned int rhs) { set_value(rhs); return *this; }
311 XMLAttribute& operator=(long rhs) { set_value(rhs); return *this; }
312 XMLAttribute& operator=(unsigned long rhs) { set_value(rhs); return *this; }
313 XMLAttribute& operator=(double rhs) { set_value(rhs); return *this; }
314 XMLAttribute& operator=(bool rhs) { set_value(rhs); return *this; }
315 XMLAttribute& operator=(long long rhs) { set_value(rhs); return *this; }
316 XMLAttribute& operator=(unsigned long long rhs) { set_value(rhs); return *this; }
317
318 const char* as_string(const char* def = "") const;
319 int as_int(int def = 0) const;
320 unsigned int as_uint(unsigned int def = 0) const;
321 double as_double(double def = 0) const;
322 float as_float(float def = 0.0f) const;
323 bool as_bool(bool def = false) const;
324 unsigned long long as_ullong(unsigned long long def = 0) const;
325 long long as_llong(long long def = 0) const;
326
327 XMLAttribute next_attribute() const;
328 XMLAttribute previous_attribute() const;
329
330 operator pugi::xml_attribute() const; // Conversion operator
331
332 pugi::xml_attribute_struct* internal_object() const { return m_attr; }
333
334 private:
335 pugi::xml_attribute_struct* m_attr{nullptr};
336 };
337
338 // ===== XMLText wrapper class =====
339 class OPENXLSX_EXPORT XMLText
340 {
341 public:
342 XMLText();
343 XMLText(pugi::xml_node_struct* node);
344
345 bool empty() const;
346 const char* get() const;
347
348 const char* as_string(const char* def = "") const;
349 int as_int(int def = 0) const;
350 unsigned int as_uint(unsigned int def = 0) const;
351 double as_double(double def = 0) const;
352 float as_float(float def = 0.0f) const;
353 bool as_bool(bool def = false) const;
354 unsigned long long as_ullong(unsigned long long def = 0) const;
355 long long as_llong(long long def = 0) const;
356
357 bool set(const char* rhs);
358 bool set(int rhs);
359 bool set(unsigned int rhs);
360 bool set(long rhs);
361 bool set(unsigned long rhs);
362 bool set(double rhs);
363 bool set(bool rhs);
364 bool set(long long rhs);
365 bool set(unsigned long long rhs);
366
367 private:
368 pugi::xml_node_struct* m_node{nullptr};
369 };
370
371 // ===== XMLNodeIterator for children range loop =====
372 class OPENXLSX_EXPORT XMLNodeIterator
373 {
374 public:
375 using difference_type = std::ptrdiff_t;
377 using pointer = XMLNode*;
378 using reference = XMLNode&; // Returns reference to internal wrap
379 using iterator_category = std::forward_iterator_tag;
380
382 XMLNodeIterator(pugi::xml_node_struct* node, const char* filter = nullptr);
383
384 XMLNode& operator*() const;
385 XMLNode* operator->() const { return &m_wrap; }
386 XMLNodeIterator& operator++();
387 bool operator==(const XMLNodeIterator& other) const;
388 bool operator!=(const XMLNodeIterator& other) const;
389
390 private:
391 pugi::xml_node_struct* m_node{nullptr};
392 const char* m_filter{nullptr};
393 mutable XMLNode m_wrap;
394 };
395
396 class OPENXLSX_EXPORT XMLNodeRange
397 {
398 public:
399 XMLNodeRange(pugi::xml_node_struct* first, const char* filter = nullptr);
400 XMLNodeIterator begin() const;
401 XMLNodeIterator end() const;
402 private:
403 pugi::xml_node_struct* m_first{nullptr};
404 const char* m_filter{nullptr};
405 };
406
407 // ===== XMLAttributeIterator for attributes range loop =====
408 class OPENXLSX_EXPORT XMLAttributeIterator
409 {
410 public:
411 using difference_type = std::ptrdiff_t;
414 using reference = XMLAttribute&; // Returns reference to internal wrap
415 using iterator_category = std::forward_iterator_tag;
416
418 XMLAttributeIterator(pugi::xml_attribute_struct* attr);
419
420 XMLAttribute& operator*() const;
421 XMLAttribute* operator->() const { return &m_wrap; }
422 XMLAttributeIterator& operator++();
423 bool operator==(const XMLAttributeIterator& other) const;
424 bool operator!=(const XMLAttributeIterator& other) const;
425
426 private:
427 pugi::xml_attribute_struct* m_attr{nullptr};
428 mutable XMLAttribute m_wrap;
429 };
430
431 class OPENXLSX_EXPORT XMLAttributeRange
432 {
433 public:
434 XMLAttributeRange(pugi::xml_attribute_struct* first);
437 private:
438 pugi::xml_attribute_struct* m_first{nullptr};
439 };
440
441 // ===== Custom OpenXLSX_xml_document wrapper class =====
442 class OPENXLSX_EXPORT OpenXLSX_xml_document : public XMLNode
443 {
444 public:
447
450
453
455 void print(std::ostream& ostr) const;
456
457 XMLParseResult load_string(const char* contents, unsigned int options = 0x0016 /* parse_default */);
458 XMLParseResult load_buffer(const void* contents, size_t size, unsigned int settings = 0x0016 /* parse_default */);
459
460 void save(pugi::xml_writer& writer, const char* indent = "\t", unsigned int flags = 1 /* format_default */) const;
461 void save(std::ostream& stream, const char* indent = "\t", unsigned int flags = 1 /* format_default */) const;
462
463 void reset();
464 void reset(const XMLDocument& proto);
465
466 operator pugi::xml_document&();
467 operator const pugi::xml_document&() const;
468
469 pugi::xml_document& internal_document() { return *m_doc; }
470 const pugi::xml_document& internal_document() const { return *m_doc; }
471
472 private:
473 std::unique_ptr<pugi::xml_document> m_doc;
474 };
475
476} // namespace OpenXLSX
477
478#endif // OPENXLSX_XLXMLPARSER_HPP
Definition XLXmlParser.hpp:108
NameProxy(std::string str)
Definition XLXmlParser.hpp:113
const char * c_str() const
Definition XLXmlParser.hpp:114
NameProxy(const char *ptr)
Definition XLXmlParser.hpp:112
Definition XLXmlParser.hpp:443
const pugi::xml_document & internal_document() const
Definition XLXmlParser.hpp:470
XMLParseResult load_string(const char *contents, unsigned int options=0x0016)
Definition XLXmlParser.cpp:876
void print(std::ostream &ostr) const
Definition XLXmlParser.cpp:871
OpenXLSX_xml_document(const OpenXLSX_xml_document &)=delete
XMLNode document_element() const
Definition XLXmlParser.cpp:866
pugi::xml_document & internal_document()
Definition XLXmlParser.hpp:469
void save(pugi::xml_writer &writer, const char *indent="\t", unsigned int flags=1) const
Definition XLXmlParser.cpp:902
XMLParseResult load_buffer(const void *contents, size_t size, unsigned int settings=0x0016)
Definition XLXmlParser.cpp:889
OpenXLSX_xml_document & operator=(const OpenXLSX_xml_document &)=delete
OpenXLSX_xml_document()
Definition XLXmlParser.cpp:842
void reset()
Definition XLXmlParser.cpp:912
Definition XLXmlParser.hpp:119
XMLNode previous_sibling_of_type(T type_=node_element) const
Definition XLXmlParser.hpp:220
XMLAttribute last_attribute() const
Definition XLXmlParser.cpp:108
XMLNode previous_sibling(const char *name_) const
Definition XLXmlParser.cpp:168
bool remove_attribute(const char *name_)
Definition XLXmlParser.cpp:126
XMLAttribute append_attribute(const char *name_)
Definition XLXmlParser.cpp:114
XMLNode prepend_child(T type_=node_element)
Definition XLXmlParser.hpp:164
XMLAttribute first_attribute() const
Definition XLXmlParser.cpp:102
XMLNode child(const char *name_) const
Definition XLXmlParser.cpp:150
XMLNode find_child(Predicate pred) const
Definition XLXmlParser.hpp:191
XMLNode last_child_of_type(T type_=node_element) const
Definition XLXmlParser.hpp:208
XMLNode next_sibling_of_type(const char *name_, T type_=node_element) const
Definition XLXmlParser.hpp:224
bool set_value(const char *rhs)
Definition XLXmlParser.cpp:90
XMLAttribute attribute(const char *name_) const
Definition XLXmlParser.cpp:96
XMLNode first_child() const
Definition XLXmlParser.cpp:192
size_t child_count_of_type(T type_=node_element) const
Definition XLXmlParser.hpp:212
XMLNode previous_sibling_of_type(const char *name_, T type_=node_element) const
Definition XLXmlParser.hpp:228
XMLNode next_sibling(const char *name_) const
Definition XLXmlParser.cpp:156
OpenXLSX_xml_node()
Definition XLXmlParser.cpp:33
XMLAttribute prepend_attribute(const char *name_)
Definition XLXmlParser.cpp:120
XMLNode insert_child_before(T type_, const XMLNode &node)
Definition XLXmlParser.hpp:176
void remove_attributes()
Definition XLXmlParser.cpp:138
bool operator!=(const OpenXLSX_xml_node &other) const
Definition XLXmlParser.cpp:50
const char * child_value() const
Definition XLXmlParser.cpp:180
size_t name_begin
Definition XLXmlParser.hpp:278
bool set_name(const char *rhs, bool force_ns=false)
Definition XLXmlParser.cpp:78
XMLNode first_child_of_type(T type_=node_element) const
Definition XLXmlParser.hpp:204
pugi::xml_node_struct * internal_object() const
Definition XLXmlParser.hpp:258
bool empty() const
Definition XLXmlParser.cpp:58
bool operator<(const OpenXLSX_xml_node &other) const
Definition XLXmlParser.cpp:52
XMLNode last_child() const
Definition XLXmlParser.cpp:198
const char * name() const
Definition XLXmlParser.cpp:60
const char * value() const
Definition XLXmlParser.cpp:72
bool operator==(const OpenXLSX_xml_node &other) const
Definition XLXmlParser.cpp:49
pugi::xml_node_struct * m_node
Definition XLXmlParser.hpp:277
const char * raw_name() const
Definition XLXmlParser.cpp:66
XMLNode next_sibling_of_type(T type_=node_element) const
Definition XLXmlParser.hpp:216
XMLNode insert_child_after(T type_, const XMLNode &node)
Definition XLXmlParser.hpp:172
XMLNode append_child(T type_=node_element)
Definition XLXmlParser.hpp:160
XMLNode parent() const
Definition XLXmlParser.cpp:144
Definition XLXmlParser.hpp:409
XMLAttribute & operator*() const
Definition XLXmlParser.cpp:821
XMLAttribute * operator->() const
Definition XLXmlParser.hpp:421
XMLAttribute value_type
Definition XLXmlParser.hpp:412
std::ptrdiff_t difference_type
Definition XLXmlParser.hpp:411
std::forward_iterator_tag iterator_category
Definition XLXmlParser.hpp:415
XMLAttributeIterator()
Definition XLXmlParser.cpp:814
XMLAttribute & reference
Definition XLXmlParser.hpp:414
XMLAttribute * pointer
Definition XLXmlParser.hpp:413
Definition XLXmlParser.hpp:432
XMLAttributeIterator begin() const
Definition XLXmlParser.cpp:837
XMLAttributeIterator end() const
Definition XLXmlParser.cpp:838
XMLAttributeRange(pugi::xml_attribute_struct *first)
Definition XLXmlParser.cpp:836
Definition XLXmlParser.hpp:283
XMLAttribute & operator=(unsigned long long rhs)
Definition XLXmlParser.hpp:316
XMLAttribute & operator=(long long rhs)
Definition XLXmlParser.hpp:315
XMLAttribute & operator=(long rhs)
Definition XLXmlParser.hpp:311
bool set_name(const char *rhs)
Definition XLXmlParser.cpp:527
bool set_value(const char *rhs)
Definition XLXmlParser.cpp:533
XMLAttribute & operator=(bool rhs)
Definition XLXmlParser.hpp:314
const char * name() const
Definition XLXmlParser.cpp:515
const char * value() const
Definition XLXmlParser.cpp:521
XMLAttribute & operator=(unsigned int rhs)
Definition XLXmlParser.hpp:310
bool operator!=(const XMLAttribute &other) const
Definition XLXmlParser.cpp:511
XMLAttribute & operator=(unsigned long rhs)
Definition XLXmlParser.hpp:312
bool operator==(const XMLAttribute &other) const
Definition XLXmlParser.cpp:510
bool empty() const
Definition XLXmlParser.cpp:513
XMLAttribute & operator=(int rhs)
Definition XLXmlParser.hpp:309
XMLAttribute()
Definition XLXmlParser.cpp:506
XMLAttribute & operator=(const char *rhs)
Definition XLXmlParser.hpp:308
pugi::xml_attribute_struct * internal_object() const
Definition XLXmlParser.hpp:332
XMLAttribute & operator=(double rhs)
Definition XLXmlParser.hpp:313
Definition XLXmlParser.hpp:373
XMLNode value_type
Definition XLXmlParser.hpp:376
std::ptrdiff_t difference_type
Definition XLXmlParser.hpp:375
XMLNode & reference
Definition XLXmlParser.hpp:378
XMLNode & operator*() const
Definition XLXmlParser.cpp:783
std::forward_iterator_tag iterator_category
Definition XLXmlParser.hpp:379
XMLNode * operator->() const
Definition XLXmlParser.hpp:385
XMLNode * pointer
Definition XLXmlParser.hpp:377
XMLNodeIterator()
Definition XLXmlParser.cpp:768
Definition XLXmlParser.hpp:397
XMLNodeIterator end() const
Definition XLXmlParser.cpp:810
XMLNodeIterator begin() const
Definition XLXmlParser.cpp:809
XMLNodeRange(pugi::xml_node_struct *first, const char *filter=nullptr)
Definition XLXmlParser.cpp:807
Definition XLXmlParser.hpp:340
bool empty() const
Definition XLXmlParser.cpp:656
int as_int(int def=0) const
Definition XLXmlParser.cpp:670
double as_double(double def=0) const
Definition XLXmlParser.cpp:682
float as_float(float def=0.0f) const
Definition XLXmlParser.cpp:688
bool set(const char *rhs)
Definition XLXmlParser.cpp:712
const char * get() const
Definition XLXmlParser.cpp:658
long long as_llong(long long def=0) const
Definition XLXmlParser.cpp:706
bool as_bool(bool def=false) const
Definition XLXmlParser.cpp:694
XMLText()
Definition XLXmlParser.cpp:654
unsigned int as_uint(unsigned int def=0) const
Definition XLXmlParser.cpp:676
unsigned long long as_ullong(unsigned long long def=0) const
Definition XLXmlParser.cpp:700
const char * as_string(const char *def="") const
Definition XLXmlParser.cpp:664
Definition IXLCellProvider.hpp:24
constexpr XMLParseStatus status_file_not_found
Definition XLXmlParser.hpp:82
constexpr XMLParseStatus status_bad_start_element
Definition XLXmlParser.hpp:92
constexpr const bool XLForceNamespace
Definition XLXmlParser.hpp:49
constexpr XMLNodeType node_comment
Definition XLXmlParser.hpp:74
bool disable_xml_namespaces()
Definition XLXmlParser.cpp:26
constexpr XMLNodeType node_document
Definition XLXmlParser.hpp:70
constexpr XMLParseStatus status_bad_end_element
Definition XLXmlParser.hpp:94
constexpr XMLParseStatus status_io_error
Definition XLXmlParser.hpp:83
constexpr XMLParseStatus status_ok
Definition XLXmlParser.hpp:81
bool enable_xml_namespaces()
Definition XLXmlParser.cpp:21
constexpr XMLNodeType node_cdata
Definition XLXmlParser.hpp:73
int XMLParseStatus
Definition XLXmlParser.hpp:80
int XMLNodeType
Definition XLXmlParser.hpp:68
bool operator==(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:314
bool operator!=(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:321
constexpr XMLParseStatus status_bad_attribute
Definition XLXmlParser.hpp:93
constexpr XMLParseStatus status_unrecognized_tag
Definition XLXmlParser.hpp:86
constexpr XMLParseStatus status_internal_error
Definition XLXmlParser.hpp:85
constexpr XMLParseStatus status_out_of_memory
Definition XLXmlParser.hpp:84
constexpr XMLNodeType node_element
Definition XLXmlParser.hpp:71
constexpr XMLParseStatus status_bad_comment
Definition XLXmlParser.hpp:88
constexpr XMLNodeType node_doctype
Definition XLXmlParser.hpp:76
constexpr XMLNodeType node_pi
Definition XLXmlParser.hpp:77
constexpr XMLParseStatus status_no_document_element
Definition XLXmlParser.hpp:97
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
constexpr XMLParseStatus status_bad_doctype
Definition XLXmlParser.hpp:90
constexpr XMLNodeType node_null
Definition XLXmlParser.hpp:69
constexpr XMLParseStatus status_bad_cdata
Definition XLXmlParser.hpp:89
OpenXLSX_xml_document XMLDocument
Definition XLXmlParser.hpp:65
constexpr XMLParseStatus status_bad_pi
Definition XLXmlParser.hpp:87
constexpr XMLParseStatus status_end_element_mismatch
Definition XLXmlParser.hpp:95
constexpr XMLNodeType node_pcdata
Definition XLXmlParser.hpp:72
constexpr XMLNodeType node_declaration
Definition XLXmlParser.hpp:75
constexpr XMLParseStatus status_append_invalid_root
Definition XLXmlParser.hpp:96
constexpr XMLParseStatus status_bad_pcdata
Definition XLXmlParser.hpp:91
Definition XLXmlParser.hpp:28
Definition XLCellIterator.hpp:131
Definition XLXmlParser.hpp:99
const char * description() const
Definition XLXmlParser.hpp:101
XMLParseStatus status
Definition XLXmlParser.hpp:102
const char * m_description
Definition XLXmlParser.hpp:105
bool m_bool
Definition XLXmlParser.hpp:104