ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
pugixml.hpp
Go to the documentation of this file.
1 
14 #ifndef PUGIXML_VERSION
15 // Define version macro; evaluates to major * 100 + minor so that it's safe to use in less-than comparisons
16 # define PUGIXML_VERSION 140
17 #endif
18 
19 // Include user configuration file (this can define various configuration macros)
20 #ifndef NO_ETISS
22 #else
23 #include "fault/xml/pugiconfig.hpp"
24 #endif
25 
26 #ifndef HEADER_PUGIXML_HPP
27 #define HEADER_PUGIXML_HPP
28 
29 // Include stddef.h for size_t and ptrdiff_t
30 #include <stddef.h>
31 
32 // Include exception header for XPath
33 #if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS)
34 # include <exception>
35 #endif
36 
37 // Include STL headers
38 #ifndef PUGIXML_NO_STL
39 # include <iterator>
40 # include <iosfwd>
41 # include <string>
42 #endif
43 
44 // Macro for deprecated features
45 #ifndef PUGIXML_DEPRECATED
46 # if defined(__GNUC__)
47 # define PUGIXML_DEPRECATED __attribute__((deprecated))
48 # elif defined(_MSC_VER) && _MSC_VER >= 1300
49 # define PUGIXML_DEPRECATED __declspec(deprecated)
50 # else
51 # define PUGIXML_DEPRECATED
52 # endif
53 #endif
54 
55 // If no API is defined, assume default
56 #ifndef PUGIXML_API
57 # define PUGIXML_API
58 #endif
59 
60 // If no API for classes is defined, assume default
61 #ifndef PUGIXML_CLASS
62 # define PUGIXML_CLASS PUGIXML_API
63 #endif
64 
65 // If no API for functions is defined, assume default
66 #ifndef PUGIXML_FUNCTION
67 # define PUGIXML_FUNCTION PUGIXML_API
68 #endif
69 
70 // If the platform is known to have long long support, enable long long functions
71 #ifndef PUGIXML_HAS_LONG_LONG
72 # if defined(__cplusplus) && __cplusplus >= 201103
73 # define PUGIXML_HAS_LONG_LONG
74 # elif defined(_MSC_VER) && _MSC_VER >= 1400
75 # define PUGIXML_HAS_LONG_LONG
76 # endif
77 #endif
78 
79 // Character interface macros
80 #ifdef PUGIXML_WCHAR_MODE
81 # define PUGIXML_TEXT(t) L ## t
82 # define PUGIXML_CHAR wchar_t
83 #else
84 # define PUGIXML_TEXT(t) t
85 # define PUGIXML_CHAR char
86 #endif
87 
88 namespace pugi
89 {
90  // Character type used for all internal storage and operations; depends on PUGIXML_WCHAR_MODE
92 
93 #ifndef PUGIXML_NO_STL
94  // String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE
95  typedef std::basic_string<PUGIXML_CHAR, std::char_traits<PUGIXML_CHAR>, std::allocator<PUGIXML_CHAR> > string_t;
96 #endif
97 }
98 
99 // The PugiXML namespace
100 namespace pugi
101 {
102  // Tree node types
104  {
105  node_null, // Empty (null) node handle
106  node_document, // A document tree's absolute root
107  node_element, // Element tag, i.e. '<node/>'
108  node_pcdata, // Plain character data, i.e. 'text'
109  node_cdata, // Character data, i.e. '<![CDATA[text]]>'
110  node_comment, // Comment tag, i.e. '<!-- text -->'
111  node_pi, // Processing instruction, i.e. '<?name?>'
112  node_declaration, // Document declaration, i.e. '<?xml version="1.0"?>'
113  node_doctype // Document type declaration, i.e. '<!DOCTYPE doc>'
114  };
115 
116  // Parsing options
117 
118  // Minimal parsing mode (equivalent to turning all other flags off).
119  // Only elements and PCDATA sections are added to the DOM tree, no text conversions are performed.
120  const unsigned int parse_minimal = 0x0000;
121 
122  // This flag determines if processing instructions (node_pi) are added to the DOM tree. This flag is off by default.
123  const unsigned int parse_pi = 0x0001;
124 
125  // This flag determines if comments (node_comment) are added to the DOM tree. This flag is off by default.
126  const unsigned int parse_comments = 0x0002;
127 
128  // This flag determines if CDATA sections (node_cdata) are added to the DOM tree. This flag is on by default.
129  const unsigned int parse_cdata = 0x0004;
130 
131  // This flag determines if plain character data (node_pcdata) that consist only of whitespace are added to the DOM tree.
132  // This flag is off by default; turning it on usually results in slower parsing and more memory consumption.
133  const unsigned int parse_ws_pcdata = 0x0008;
134 
135  // This flag determines if character and entity references are expanded during parsing. This flag is on by default.
136  const unsigned int parse_escapes = 0x0010;
137 
138  // This flag determines if EOL characters are normalized (converted to #xA) during parsing. This flag is on by default.
139  const unsigned int parse_eol = 0x0020;
140 
141  // This flag determines if attribute values are normalized using CDATA normalization rules during parsing. This flag is on by default.
142  const unsigned int parse_wconv_attribute = 0x0040;
143 
144  // This flag determines if attribute values are normalized using NMTOKENS normalization rules during parsing. This flag is off by default.
145  const unsigned int parse_wnorm_attribute = 0x0080;
146 
147  // This flag determines if document declaration (node_declaration) is added to the DOM tree. This flag is off by default.
148  const unsigned int parse_declaration = 0x0100;
149 
150  // This flag determines if document type declaration (node_doctype) is added to the DOM tree. This flag is off by default.
151  const unsigned int parse_doctype = 0x0200;
152 
153  // This flag determines if plain character data (node_pcdata) that is the only child of the parent node and that consists only
154  // of whitespace is added to the DOM tree.
155  // This flag is off by default; turning it on may result in slower parsing and more memory consumption.
156  const unsigned int parse_ws_pcdata_single = 0x0400;
157 
158  // This flag determines if leading and trailing whitespace is to be removed from plain character data. This flag is off by default.
159  const unsigned int parse_trim_pcdata = 0x0800;
160 
161  // This flag determines if plain character data that does not have a parent node is added to the DOM tree, and if an empty document
162  // is a valid document. This flag is off by default.
163  const unsigned int parse_fragment = 0x1000;
164 
165  // The default parsing mode.
166  // Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
167  // End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
169 
170  // The full parsing mode.
171  // Nodes of all types are added to the DOM tree, character/reference entities are expanded,
172  // End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
174 
175  // These flags determine the encoding of input data for XML document
177  {
178  encoding_auto, // Auto-detect input encoding using BOM or < / <? detection; use UTF8 if BOM is not found
179  encoding_utf8, // UTF8 encoding
180  encoding_utf16_le, // Little-endian UTF16
181  encoding_utf16_be, // Big-endian UTF16
182  encoding_utf16, // UTF16 with native endianness
183  encoding_utf32_le, // Little-endian UTF32
184  encoding_utf32_be, // Big-endian UTF32
185  encoding_utf32, // UTF32 with native endianness
186  encoding_wchar, // The same encoding wchar_t has (either UTF16 or UTF32)
188  };
189 
190  // Formatting flags
191 
192  // Indent the nodes that are written to output stream with as many indentation strings as deep the node is in DOM tree. This flag is on by default.
193  const unsigned int format_indent = 0x01;
194 
195  // Write encoding-specific BOM to the output stream. This flag is off by default.
196  const unsigned int format_write_bom = 0x02;
197 
198  // Use raw output mode (no indentation and no line breaks are written). This flag is off by default.
199  const unsigned int format_raw = 0x04;
200 
201  // Omit default XML declaration even if there is no declaration in the document. This flag is off by default.
202  const unsigned int format_no_declaration = 0x08;
203 
204  // Don't escape attribute values and PCDATA contents. This flag is off by default.
205  const unsigned int format_no_escapes = 0x10;
206 
207  // Open file using text mode in xml_document::save_file. This enables special character (i.e. new-line) conversions on some systems. This flag is off by default.
208  const unsigned int format_save_file_text = 0x20;
209 
210  // The default set of formatting flags.
211  // Nodes are indented depending on their depth in DOM tree, a default declaration is output if document has none.
212  const unsigned int format_default = format_indent;
213 
214  // Forward declarations
215  struct xml_attribute_struct;
216  struct xml_node_struct;
217 
218  class xml_node_iterator;
221 
222  class xml_tree_walker;
223 
224  struct xml_parse_result;
225 
226  class xml_node;
227 
228  class xml_text;
229 
230  #ifndef PUGIXML_NO_XPATH
231  class xpath_node;
232  class xpath_node_set;
233  class xpath_query;
234  class xpath_variable_set;
235  #endif
236 
237  // Range-based for loop support
238  template <typename It> class xml_object_range
239  {
240  public:
241  typedef It const_iterator;
242  typedef It iterator;
243 
244  xml_object_range(It b, It e): _begin(b), _end(e)
245  {
246  }
247 
248  It begin() const { return _begin; }
249  It end() const { return _end; }
250 
251  private:
253  };
254 
255  // Writer interface for node printing (see xml_node::print)
257  {
258  public:
259  virtual ~xml_writer() {}
260 
261  // Write memory chunk into stream/file/whatever
262  virtual void write(const void* data, size_t size) = 0;
263  };
264 
265  // xml_writer implementation for FILE*
267  {
268  public:
269  // Construct writer from a FILE* object; void* is used to avoid header dependencies on stdio
270  xml_writer_file(void* file);
271 
272  virtual void write(const void* data, size_t size);
273 
274  private:
275  void* file;
276  };
277 
278  #ifndef PUGIXML_NO_STL
279  // xml_writer implementation for streams
281  {
282  public:
283  // Construct writer from an output stream object
284  xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream);
285  xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream);
286 
287  virtual void write(const void* data, size_t size);
288 
289  private:
290  std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
291  std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream;
292  };
293  #endif
294 
295  // A light-weight handle for manipulating attributes in DOM tree
297  {
299  friend class xml_node;
300 
301  private:
303 
304  typedef void (*unspecified_bool_type)(xml_attribute***);
305 
306  public:
307  // Default constructor. Constructs an empty attribute.
308  xml_attribute();
309 
310  // Constructs attribute from internal pointer
311  explicit xml_attribute(xml_attribute_struct* attr);
312 
313  // Safe bool conversion operator
314  operator unspecified_bool_type() const;
315 
316  // Borland C++ workaround
317  bool operator!() const;
318 
319  // Comparison operators (compares wrapped attribute pointers)
320  bool operator==(const xml_attribute& r) const;
321  bool operator!=(const xml_attribute& r) const;
322  bool operator<(const xml_attribute& r) const;
323  bool operator>(const xml_attribute& r) const;
324  bool operator<=(const xml_attribute& r) const;
325  bool operator>=(const xml_attribute& r) const;
326 
327  // Check if attribute is empty
328  bool empty() const;
329 
330  // Get attribute name/value, or "" if attribute is empty
331  const char_t* name() const;
332  const char_t* value() const;
333 
334  // Get attribute value, or the default value if attribute is empty
335  const char_t* as_string(const char_t* def = PUGIXML_TEXT("")) const;
336 
337  // Get attribute value as a number, or the default value if conversion did not succeed or attribute is empty
338  int as_int(int def = 0) const;
339  unsigned int as_uint(unsigned int def = 0) const;
340  double as_double(double def = 0) const;
341  float as_float(float def = 0) const;
342 
343  #ifdef PUGIXML_HAS_LONG_LONG
344  long long as_llong(long long def = 0) const;
345  unsigned long long as_ullong(unsigned long long def = 0) const;
346  #endif
347 
348  // Get attribute value as bool (returns true if first character is in '1tTyY' set), or the default value if attribute is empty
349  bool as_bool(bool def = false) const;
350 
351  // Set attribute name/value (returns false if attribute is empty or there is not enough memory)
352  bool set_name(const char_t* rhs);
353  bool set_value(const char_t* rhs);
354 
355  // Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
356  bool set_value(int rhs);
357  bool set_value(unsigned int rhs);
358  bool set_value(double rhs);
359  bool set_value(bool rhs);
360 
361  #ifdef PUGIXML_HAS_LONG_LONG
362  bool set_value(long long rhs);
363  bool set_value(unsigned long long rhs);
364  #endif
365 
366  // Set attribute value (equivalent to set_value without error checking)
367  xml_attribute& operator=(const char_t* rhs);
368  xml_attribute& operator=(int rhs);
369  xml_attribute& operator=(unsigned int rhs);
370  xml_attribute& operator=(double rhs);
371  xml_attribute& operator=(bool rhs);
372 
373  #ifdef PUGIXML_HAS_LONG_LONG
374  xml_attribute& operator=(long long rhs);
375  xml_attribute& operator=(unsigned long long rhs);
376  #endif
377 
378  // Get next/previous attribute in the attribute list of the parent node
379  xml_attribute next_attribute() const;
380  xml_attribute previous_attribute() const;
381 
382  // Get hash value (unique for handles to the same object)
383  size_t hash_value() const;
384 
385  // Get internal pointer
386  xml_attribute_struct* internal_object() const;
387  };
388 
389 #ifdef __BORLANDC__
390  // Borland C++ workaround
391  bool PUGIXML_FUNCTION operator&&(const xml_attribute& lhs, bool rhs);
392  bool PUGIXML_FUNCTION operator||(const xml_attribute& lhs, bool rhs);
393 #endif
394 
395  // A light-weight handle for manipulating nodes in DOM tree
397  {
399  friend class xml_node_iterator;
401 
402  protected:
404 
405  typedef void (*unspecified_bool_type)(xml_node***);
406 
407  public:
408  // Default constructor. Constructs an empty node.
409  xml_node();
410 
411  // Constructs node from internal pointer
412  explicit xml_node(xml_node_struct* p);
413 
414  // Safe bool conversion operator
415  operator unspecified_bool_type() const;
416 
417  // Borland C++ workaround
418  bool operator!() const;
419 
420  // Comparison operators (compares wrapped node pointers)
421  bool operator==(const xml_node& r) const;
422  bool operator!=(const xml_node& r) const;
423  bool operator<(const xml_node& r) const;
424  bool operator>(const xml_node& r) const;
425  bool operator<=(const xml_node& r) const;
426  bool operator>=(const xml_node& r) const;
427 
428  // Check if node is empty.
429  bool empty() const;
430 
431  // Get node type
432  xml_node_type type() const;
433 
434  // Get node name, or "" if node is empty or it has no name
435  const char_t* name() const;
436 
437  // Get node value, or "" if node is empty or it has no value
438  // Note: For <node>text</node> node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes.
439  const char_t* value() const;
440 
441  // Get attribute list
442  xml_attribute first_attribute() const;
443  xml_attribute last_attribute() const;
444 
445  // Get children list
446  xml_node first_child() const;
447  xml_node last_child() const;
448 
449  // Get next/previous sibling in the children list of the parent node
450  xml_node next_sibling() const;
451  xml_node previous_sibling() const;
452 
453  // Get parent node
454  xml_node parent() const;
455 
456  // Get root of DOM tree this node belongs to
457  xml_node root() const;
458 
459  // Get text object for the current node
460  xml_text text() const;
461 
462  // Get child, attribute or next/previous sibling with the specified name
463  xml_node child(const char_t* name) const;
464  xml_attribute attribute(const char_t* name) const;
465  xml_node next_sibling(const char_t* name) const;
466  xml_node previous_sibling(const char_t* name) const;
467 
468  // Get child value of current node; that is, value of the first child node of type PCDATA/CDATA
469  const char_t* child_value() const;
470 
471  // Get child value of child with specified name. Equivalent to child(name).child_value().
472  const char_t* child_value(const char_t* name) const;
473 
474  // Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
475  bool set_name(const char_t* rhs);
476  bool set_value(const char_t* rhs);
477 
478  // Add attribute with specified name. Returns added attribute, or empty attribute on errors.
479  xml_attribute append_attribute(const char_t* name);
480  xml_attribute prepend_attribute(const char_t* name);
481  xml_attribute insert_attribute_after(const char_t* name, const xml_attribute& attr);
482  xml_attribute insert_attribute_before(const char_t* name, const xml_attribute& attr);
483 
484  // Add a copy of the specified attribute. Returns added attribute, or empty attribute on errors.
485  xml_attribute append_copy(const xml_attribute& proto);
486  xml_attribute prepend_copy(const xml_attribute& proto);
487  xml_attribute insert_copy_after(const xml_attribute& proto, const xml_attribute& attr);
488  xml_attribute insert_copy_before(const xml_attribute& proto, const xml_attribute& attr);
489 
490  // Add child node with specified type. Returns added node, or empty node on errors.
491  xml_node append_child(xml_node_type type = node_element);
492  xml_node prepend_child(xml_node_type type = node_element);
493  xml_node insert_child_after(xml_node_type type, const xml_node& node);
494  xml_node insert_child_before(xml_node_type type, const xml_node& node);
495 
496  // Add child element with specified name. Returns added node, or empty node on errors.
497  xml_node append_child(const char_t* name);
498  xml_node prepend_child(const char_t* name);
499  xml_node insert_child_after(const char_t* name, const xml_node& node);
500  xml_node insert_child_before(const char_t* name, const xml_node& node);
501 
502  // Add a copy of the specified node as a child. Returns added node, or empty node on errors.
503  xml_node append_copy(const xml_node& proto);
504  xml_node prepend_copy(const xml_node& proto);
505  xml_node insert_copy_after(const xml_node& proto, const xml_node& node);
506  xml_node insert_copy_before(const xml_node& proto, const xml_node& node);
507 
508  // Remove specified attribute
509  bool remove_attribute(const xml_attribute& a);
510  bool remove_attribute(const char_t* name);
511 
512  // Remove specified child
513  bool remove_child(const xml_node& n);
514  bool remove_child(const char_t* name);
515 
516  // Parses buffer as an XML document fragment and appends all nodes as children of the current node.
517  // Copies/converts the buffer, so it may be deleted or changed after the function returns.
518  // Note: append_buffer allocates memory that has the lifetime of the owning document; removing the appended nodes does not immediately reclaim that memory.
519  xml_parse_result append_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
520 
521  // Find attribute using predicate. Returns first attribute for which predicate returned true.
522  template <typename Predicate> xml_attribute find_attribute(Predicate pred) const
523  {
524  if (!_root) return xml_attribute();
525 
526  for (xml_attribute attrib = first_attribute(); attrib; attrib = attrib.next_attribute())
527  if (pred(attrib))
528  return attrib;
529 
530  return xml_attribute();
531  }
532 
533  // Find child node using predicate. Returns first child for which predicate returned true.
534  template <typename Predicate> xml_node find_child(Predicate pred) const
535  {
536  if (!_root) return xml_node();
537 
538  for (xml_node node = first_child(); node; node = node.next_sibling())
539  if (pred(node))
540  return node;
541 
542  return xml_node();
543  }
544 
545  // Find node from subtree using predicate. Returns first node from subtree (depth-first), for which predicate returned true.
546  template <typename Predicate> xml_node find_node(Predicate pred) const
547  {
548  if (!_root) return xml_node();
549 
550  xml_node cur = first_child();
551 
552  while (cur._root && cur._root != _root)
553  {
554  if (pred(cur)) return cur;
555 
556  if (cur.first_child()) cur = cur.first_child();
557  else if (cur.next_sibling()) cur = cur.next_sibling();
558  else
559  {
560  while (!cur.next_sibling() && cur._root != _root) cur = cur.parent();
561 
562  if (cur._root != _root) cur = cur.next_sibling();
563  }
564  }
565 
566  return xml_node();
567  }
568 
569  // Find child node by attribute name/value
570  xml_node find_child_by_attribute(const char_t* name, const char_t* attr_name, const char_t* attr_value) const;
571  xml_node find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const;
572 
573  #ifndef PUGIXML_NO_STL
574  // Get the absolute node path from root as a text string.
575  string_t path(char_t delimiter = '/') const;
576  #endif
577 
578  // Search for a node by path consisting of node names and . or .. elements.
579  xml_node first_element_by_path(const char_t* path, char_t delimiter = '/') const;
580 
581  // Recursively traverse subtree with xml_tree_walker
582  bool traverse(xml_tree_walker& walker);
583 
584  #ifndef PUGIXML_NO_XPATH
585  // Select single node by evaluating XPath query. Returns first node from the resulting node set.
586  xpath_node select_single_node(const char_t* query, xpath_variable_set* variables = 0) const;
587  xpath_node select_single_node(const xpath_query& query) const;
588 
589  // Select node set by evaluating XPath query
590  xpath_node_set select_nodes(const char_t* query, xpath_variable_set* variables = 0) const;
591  xpath_node_set select_nodes(const xpath_query& query) const;
592  #endif
593 
594  // Print subtree using a writer object
595  void print(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
596 
597  #ifndef PUGIXML_NO_STL
598  // Print subtree to stream
599  void print(std::basic_ostream<char, std::char_traits<char> >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
600  void print(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const;
601  #endif
602 
603  // Child nodes iterators
605 
606  iterator begin() const;
607  iterator end() const;
608 
609  // Attribute iterators
611 
612  attribute_iterator attributes_begin() const;
613  attribute_iterator attributes_end() const;
614 
615  // Range-based for support
616  xml_object_range<xml_node_iterator> children() const;
617  xml_object_range<xml_named_node_iterator> children(const char_t* name) const;
618  xml_object_range<xml_attribute_iterator> attributes() const;
619 
620  // Get node offset in parsed file/string (in char_t units) for debugging purposes
621  ptrdiff_t offset_debug() const;
622 
623  // Get hash value (unique for handles to the same object)
624  size_t hash_value() const;
625 
626  // Get internal pointer
627  xml_node_struct* internal_object() const;
628  };
629 
630 #ifdef __BORLANDC__
631  // Borland C++ workaround
632  bool PUGIXML_FUNCTION operator&&(const xml_node& lhs, bool rhs);
633  bool PUGIXML_FUNCTION operator||(const xml_node& lhs, bool rhs);
634 #endif
635 
636  // A helper for working with text inside PCDATA nodes
638  {
639  friend class xml_node;
640 
642 
643  typedef void (*unspecified_bool_type)(xml_text***);
644 
645  explicit xml_text(xml_node_struct* root);
646 
647  xml_node_struct* _data_new();
648  xml_node_struct* _data() const;
649 
650  public:
651  // Default constructor. Constructs an empty object.
652  xml_text();
653 
654  // Safe bool conversion operator
655  operator unspecified_bool_type() const;
656 
657  // Borland C++ workaround
658  bool operator!() const;
659 
660  // Check if text object is empty
661  bool empty() const;
662 
663  // Get text, or "" if object is empty
664  const char_t* get() const;
665 
666  // Get text, or the default value if object is empty
667  const char_t* as_string(const char_t* def = PUGIXML_TEXT("")) const;
668 
669  // Get text as a number, or the default value if conversion did not succeed or object is empty
670  int as_int(int def = 0) const;
671  unsigned int as_uint(unsigned int def = 0) const;
672  double as_double(double def = 0) const;
673  float as_float(float def = 0) const;
674 
675  #ifdef PUGIXML_HAS_LONG_LONG
676  long long as_llong(long long def = 0) const;
677  unsigned long long as_ullong(unsigned long long def = 0) const;
678  #endif
679 
680  // Get text as bool (returns true if first character is in '1tTyY' set), or the default value if object is empty
681  bool as_bool(bool def = false) const;
682 
683  // Set text (returns false if object is empty or there is not enough memory)
684  bool set(const char_t* rhs);
685 
686  // Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
687  bool set(int rhs);
688  bool set(unsigned int rhs);
689  bool set(double rhs);
690  bool set(bool rhs);
691 
692  #ifdef PUGIXML_HAS_LONG_LONG
693  bool set(long long rhs);
694  bool set(unsigned long long rhs);
695  #endif
696 
697  // Set text (equivalent to set without error checking)
698  xml_text& operator=(const char_t* rhs);
699  xml_text& operator=(int rhs);
700  xml_text& operator=(unsigned int rhs);
701  xml_text& operator=(double rhs);
702  xml_text& operator=(bool rhs);
703 
704  #ifdef PUGIXML_HAS_LONG_LONG
705  xml_text& operator=(long long rhs);
706  xml_text& operator=(unsigned long long rhs);
707  #endif
708 
709  // Get the data node (node_pcdata or node_cdata) for this object
710  xml_node data() const;
711  };
712 
713 #ifdef __BORLANDC__
714  // Borland C++ workaround
715  bool PUGIXML_FUNCTION operator&&(const xml_text& lhs, bool rhs);
716  bool PUGIXML_FUNCTION operator||(const xml_text& lhs, bool rhs);
717 #endif
718 
719  // Child node iterator (a bidirectional iterator over a collection of xml_node)
721  {
722  friend class xml_node;
723 
724  private:
725  mutable xml_node _wrap;
727 
729 
730  public:
731  // Iterator traits
734  typedef xml_node* pointer;
735  typedef xml_node& reference;
736 
737  #ifndef PUGIXML_NO_STL
738  typedef std::bidirectional_iterator_tag iterator_category;
739  #endif
740 
741  // Default constructor
743 
744  // Construct an iterator which points to the specified node
745  xml_node_iterator(const xml_node& node);
746 
747  // Iterator operators
748  bool operator==(const xml_node_iterator& rhs) const;
749  bool operator!=(const xml_node_iterator& rhs) const;
750 
751  xml_node& operator*() const;
752  xml_node* operator->() const;
753 
754  const xml_node_iterator& operator++();
755  xml_node_iterator operator++(int);
756 
757  const xml_node_iterator& operator--();
758  xml_node_iterator operator--(int);
759  };
760 
761  // Attribute iterator (a bidirectional iterator over a collection of xml_attribute)
763  {
764  friend class xml_node;
765 
766  private:
769 
771 
772  public:
773  // Iterator traits
778 
779  #ifndef PUGIXML_NO_STL
780  typedef std::bidirectional_iterator_tag iterator_category;
781  #endif
782 
783  // Default constructor
785 
786  // Construct an iterator which points to the specified attribute
787  xml_attribute_iterator(const xml_attribute& attr, const xml_node& parent);
788 
789  // Iterator operators
790  bool operator==(const xml_attribute_iterator& rhs) const;
791  bool operator!=(const xml_attribute_iterator& rhs) const;
792 
793  xml_attribute& operator*() const;
794  xml_attribute* operator->() const;
795 
796  const xml_attribute_iterator& operator++();
797  xml_attribute_iterator operator++(int);
798 
799  const xml_attribute_iterator& operator--();
800  xml_attribute_iterator operator--(int);
801  };
802 
803  // Named node range helper
805  {
806  friend class xml_node;
807 
808  public:
809  // Iterator traits
812  typedef xml_node* pointer;
813  typedef xml_node& reference;
814 
815  #ifndef PUGIXML_NO_STL
816  typedef std::bidirectional_iterator_tag iterator_category;
817  #endif
818 
819  // Default constructor
821 
822  // Construct an iterator which points to the specified node
823  xml_named_node_iterator(const xml_node& node, const char_t* name);
824 
825  // Iterator operators
826  bool operator==(const xml_named_node_iterator& rhs) const;
827  bool operator!=(const xml_named_node_iterator& rhs) const;
828 
829  xml_node& operator*() const;
830  xml_node* operator->() const;
831 
832  const xml_named_node_iterator& operator++();
833  xml_named_node_iterator operator++(int);
834 
835  const xml_named_node_iterator& operator--();
836  xml_named_node_iterator operator--(int);
837 
838  private:
839  mutable xml_node _wrap;
841  const char_t* _name;
842 
844  };
845 
846  // Abstract tree walker class (see xml_node::traverse)
848  {
849  friend class xml_node;
850 
851  private:
852  int _depth;
853 
854  protected:
855  // Get current traversal depth
856  int depth() const;
857 
858  public:
859  xml_tree_walker();
860  virtual ~xml_tree_walker();
861 
862  // Callback that is called when traversal begins
863  virtual bool begin(xml_node& node);
864 
865  // Callback that is called for each node traversed
866  virtual bool for_each(xml_node& node) = 0;
867 
868  // Callback that is called when traversal ends
869  virtual bool end(xml_node& node);
870  };
871 
872  // Parsing status, returned as part of xml_parse_result object
874  {
875  status_ok = 0, // No error
876 
877  status_file_not_found, // File was not found during load_file()
878  status_io_error, // Error reading from file/stream
879  status_out_of_memory, // Could not allocate memory
880  status_internal_error, // Internal error occurred
881 
882  status_unrecognized_tag, // Parser could not determine tag type
883 
884  status_bad_pi, // Parsing error occurred while parsing document declaration/processing instruction
885  status_bad_comment, // Parsing error occurred while parsing comment
886  status_bad_cdata, // Parsing error occurred while parsing CDATA section
887  status_bad_doctype, // Parsing error occurred while parsing document type declaration
888  status_bad_pcdata, // Parsing error occurred while parsing PCDATA section
889  status_bad_start_element, // Parsing error occurred while parsing start element tag
890  status_bad_attribute, // Parsing error occurred while parsing element attribute
891  status_bad_end_element, // Parsing error occurred while parsing end element tag
892  status_end_element_mismatch,// There was a mismatch of start-end tags (closing tag had incorrect name, some tag was not closed or there was an excessive closing tag)
893 
894  status_append_invalid_root, // Unable to append nodes since root type is not node_element or node_document (exclusive to xml_node::append_buffer)
895 
896  status_no_document_element // Parsing resulted in a document without element nodes
897  };
898 
899  // Parsing result
901  {
902  // Parsing status (see xml_parse_status)
904 
905  // Last parsed offset (in char_t units from start of input data)
907 
908  // Source document encoding
910 
911  // Default constructor, initializes object to failed state
913 
914  // Cast to bool operator
915  operator bool() const;
916 
917  // Get error description
918  const char* description() const;
919  };
920 
921  // Document class (DOM tree root)
923  {
924  private:
926 
927  char _memory[192];
928 
929  // Non-copyable semantics
932 
933  void create();
934  void destroy();
935 
936  public:
937  // Default constructor, makes empty document
938  xml_document();
939 
940  // Destructor, invalidates all node/attribute handles to this document
941  ~xml_document();
942 
943  // Removes all nodes, leaving the empty document
944  void reset();
945 
946  // Removes all nodes, then copies the entire contents of the specified document
947  void reset(const xml_document& proto);
948 
949  #ifndef PUGIXML_NO_STL
950  // Load document from stream.
951  xml_parse_result load(std::basic_istream<char, std::char_traits<char> >& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
952  xml_parse_result load(std::basic_istream<wchar_t, std::char_traits<wchar_t> >& stream, unsigned int options = parse_default);
953  #endif
954 
955  // Load document from zero-terminated string. No encoding conversions are applied.
956  xml_parse_result load(const char_t* contents, unsigned int options = parse_default);
957 
958  // Load document from file
959  xml_parse_result load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
960  xml_parse_result load_file(const wchar_t* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
961 
962  // Load document from buffer. Copies/converts the buffer, so it may be deleted or changed after the function returns.
963  xml_parse_result load_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
964 
965  // Load document from buffer, using the buffer for in-place parsing (the buffer is modified and used for storage of document data).
966  // You should ensure that buffer data will persist throughout the document's lifetime, and free the buffer memory manually once document is destroyed.
967  xml_parse_result load_buffer_inplace(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
968 
969  // Load document from buffer, using the buffer for in-place parsing (the buffer is modified and used for storage of document data).
970  // You should allocate the buffer with pugixml allocation function; document will free the buffer when it is no longer needed (you can't use it anymore).
971  xml_parse_result load_buffer_inplace_own(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
972 
973  // Save XML document to writer (semantics is slightly different from xml_node::print, see documentation for details).
974  void save(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
975 
976  #ifndef PUGIXML_NO_STL
977  // Save XML document to stream (semantics is slightly different from xml_node::print, see documentation for details).
978  void save(std::basic_ostream<char, std::char_traits<char> >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
979  void save(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const;
980  #endif
981 
982  // Save XML to file
983  bool save_file(const char* path, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
984  bool save_file(const wchar_t* path, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
985 
986  // Get document element
987  xml_node document_element() const;
988  };
989 
990 #ifndef PUGIXML_NO_XPATH
991  // XPath query return type
993  {
994  xpath_type_none, // Unknown type (query failed to compile)
995  xpath_type_node_set, // Node set (xpath_node_set)
996  xpath_type_number, // Number
997  xpath_type_string, // String
998  xpath_type_boolean // Boolean
999  };
1000 
1001  // XPath parsing result
1003  {
1004  // Error message (0 if no error)
1005  const char* error;
1006 
1007  // Last parsed offset (in char_t units from string start)
1009 
1010  // Default constructor, initializes object to failed state
1012 
1013  // Cast to bool operator
1014  operator bool() const;
1015 
1016  // Get error description
1017  const char* description() const;
1018  };
1019 
1020  // A single XPath variable
1022  {
1023  friend class xpath_variable_set;
1024 
1025  protected:
1028 
1029  xpath_variable();
1030 
1031  // Non-copyable semantics
1034 
1035  public:
1036  // Get variable name
1037  const char_t* name() const;
1038 
1039  // Get variable type
1040  xpath_value_type type() const;
1041 
1042  // Get variable value; no type conversion is performed, default value (false, NaN, empty string, empty node set) is returned on type mismatch error
1043  bool get_boolean() const;
1044  double get_number() const;
1045  const char_t* get_string() const;
1046  const xpath_node_set& get_node_set() const;
1047 
1048  // Set variable value; no type conversion is performed, false is returned on type mismatch error
1049  bool set(bool value);
1050  bool set(double value);
1051  bool set(const char_t* value);
1052  bool set(const xpath_node_set& value);
1053  };
1054 
1055  // A set of XPath variables
1057  {
1058  private:
1059  xpath_variable* _data[64];
1060 
1061  // Non-copyable semantics
1064 
1065  xpath_variable* find(const char_t* name) const;
1066 
1067  public:
1068  // Default constructor/destructor
1070  ~xpath_variable_set();
1071 
1072  // Add a new variable or get the existing one, if the types match
1073  xpath_variable* add(const char_t* name, xpath_value_type type);
1074 
1075  // Set value of an existing variable; no type conversion is performed, false is returned if there is no such variable or if types mismatch
1076  bool set(const char_t* name, bool value);
1077  bool set(const char_t* name, double value);
1078  bool set(const char_t* name, const char_t* value);
1079  bool set(const char_t* name, const xpath_node_set& value);
1080 
1081  // Get existing variable by name
1082  xpath_variable* get(const char_t* name);
1083  const xpath_variable* get(const char_t* name) const;
1084  };
1085 
1086  // A compiled XPath query object
1088  {
1089  private:
1090  void* _impl;
1092 
1093  typedef void (*unspecified_bool_type)(xpath_query***);
1094 
1095  // Non-copyable semantics
1098 
1099  public:
1100  // Construct a compiled object from XPath expression.
1101  // If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on compilation errors.
1102  explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0);
1103 
1104  // Destructor
1105  ~xpath_query();
1106 
1107  // Get query expression return type
1108  xpath_value_type return_type() const;
1109 
1110  // Evaluate expression as boolean value in the specified context; performs type conversion if necessary.
1111  // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
1112  bool evaluate_boolean(const xpath_node& n) const;
1113 
1114  // Evaluate expression as double value in the specified context; performs type conversion if necessary.
1115  // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
1116  double evaluate_number(const xpath_node& n) const;
1117 
1118  #ifndef PUGIXML_NO_STL
1119  // Evaluate expression as string value in the specified context; performs type conversion if necessary.
1120  // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
1121  string_t evaluate_string(const xpath_node& n) const;
1122  #endif
1123 
1124  // Evaluate expression as string value in the specified context; performs type conversion if necessary.
1125  // At most capacity characters are written to the destination buffer, full result size is returned (includes terminating zero).
1126  // If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
1127  // If PUGIXML_NO_EXCEPTIONS is defined, returns empty set instead.
1128  size_t evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const;
1129 
1130  // Evaluate expression as node set in the specified context.
1131  // If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on type mismatch and std::bad_alloc on out of memory errors.
1132  // If PUGIXML_NO_EXCEPTIONS is defined, returns empty node set instead.
1133  xpath_node_set evaluate_node_set(const xpath_node& n) const;
1134 
1135  // Get parsing result (used to get compilation errors in PUGIXML_NO_EXCEPTIONS mode)
1136  const xpath_parse_result& result() const;
1137 
1138  // Safe bool conversion operator
1139  operator unspecified_bool_type() const;
1140 
1141  // Borland C++ workaround
1142  bool operator!() const;
1143  };
1144 
1145  #ifndef PUGIXML_NO_EXCEPTIONS
1146  // XPath exception class
1147  class PUGIXML_CLASS xpath_exception: public std::exception
1148  {
1149  private:
1151 
1152  public:
1153  // Construct exception from parse result
1154  explicit xpath_exception(const xpath_parse_result& result);
1155 
1156  // Get error message
1157  virtual const char* what() const throw();
1158 
1159  // Get parse result
1160  const xpath_parse_result& result() const;
1161  };
1162  #endif
1163 
1164  // XPath node class (either xml_node or xml_attribute)
1166  {
1167  private:
1170 
1171  typedef void (*unspecified_bool_type)(xpath_node***);
1172 
1173  public:
1174  // Default constructor; constructs empty XPath node
1175  xpath_node();
1176 
1177  // Construct XPath node from XML node/attribute
1178  xpath_node(const xml_node& node);
1179  xpath_node(const xml_attribute& attribute, const xml_node& parent);
1180 
1181  // Get node/attribute, if any
1182  xml_node node() const;
1183  xml_attribute attribute() const;
1184 
1185  // Get parent of contained node/attribute
1186  xml_node parent() const;
1187 
1188  // Safe bool conversion operator
1189  operator unspecified_bool_type() const;
1190 
1191  // Borland C++ workaround
1192  bool operator!() const;
1193 
1194  // Comparison operators
1195  bool operator==(const xpath_node& n) const;
1196  bool operator!=(const xpath_node& n) const;
1197  };
1198 
1199 #ifdef __BORLANDC__
1200  // Borland C++ workaround
1201  bool PUGIXML_FUNCTION operator&&(const xpath_node& lhs, bool rhs);
1202  bool PUGIXML_FUNCTION operator||(const xpath_node& lhs, bool rhs);
1203 #endif
1204 
1205  // A fixed-size collection of XPath nodes
1207  {
1208  public:
1209  // Collection type
1210  enum type_t
1211  {
1212  type_unsorted, // Not ordered
1213  type_sorted, // Sorted by document order (ascending)
1214  type_sorted_reverse // Sorted by document order (descending)
1215  };
1216 
1217  // Constant iterator type
1218  typedef const xpath_node* const_iterator;
1219 
1220  // Default constructor. Constructs empty set.
1221  xpath_node_set();
1222 
1223  // Constructs a set from iterator range; data is not checked for duplicates and is not sorted according to provided type, so be careful
1224  xpath_node_set(const_iterator begin, const_iterator end, type_t type = type_unsorted);
1225 
1226  // Destructor
1227  ~xpath_node_set();
1228 
1229  // Copy constructor/assignment operator
1230  xpath_node_set(const xpath_node_set& ns);
1231  xpath_node_set& operator=(const xpath_node_set& ns);
1232 
1233  // Get collection type
1234  type_t type() const;
1235 
1236  // Get collection size
1237  size_t size() const;
1238 
1239  // Indexing operator
1240  const xpath_node& operator[](size_t index) const;
1241 
1242  // Collection iterators
1243  const_iterator begin() const;
1244  const_iterator end() const;
1245 
1246  // Sort the collection in ascending/descending order by document order
1247  void sort(bool reverse = false);
1248 
1249  // Get first node in the collection by document order
1250  xpath_node first() const;
1251 
1252  // Check if collection is empty
1253  bool empty() const;
1254 
1255  private:
1257 
1259 
1262 
1263  void _assign(const_iterator begin, const_iterator end);
1264  };
1265 #endif
1266 
1267 #ifndef PUGIXML_NO_STL
1268  // Convert wide string to UTF8
1269  std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str);
1270  std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >& str);
1271 
1272  // Convert UTF8 to wide string
1273  std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
1274  std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >& str);
1275 #endif
1276 
1277  // Memory allocation function interface; returns pointer to allocated memory or NULL on failure
1278  typedef void* (*allocation_function)(size_t size);
1279 
1280  // Memory deallocation function interface
1281  typedef void (*deallocation_function)(void* ptr);
1282 
1283  // Override default memory management functions. All subsequent allocations/deallocations will be performed via supplied functions.
1285 
1286  // Get current memory management functions
1289 }
1290 
1291 #if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC))
1292 namespace std
1293 {
1294  // Workarounds for (non-standard) iterator category detection for older versions (MSVC7/IC8 and earlier)
1295  std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(const pugi::xml_node_iterator&);
1296  std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(const pugi::xml_attribute_iterator&);
1297  std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(const pugi::xml_named_node_iterator&);
1298 }
1299 #endif
1300 
1301 #if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC)
1302 namespace std
1303 {
1304  // Workarounds for (non-standard) iterator category detection
1305  std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(const pugi::xml_node_iterator&);
1306  std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(const pugi::xml_attribute_iterator&);
1307  std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(const pugi::xml_named_node_iterator&);
1308 }
1309 #endif
1310 
1311 #endif
1312 
ETISS_PLUGIN_EXPORT etiss::CPUArch std::map< std::string, std::string > options
create new instance of the CPUArch type at index
__device__ __2f16 b
xml_attribute * pointer
Definition: pugixml.hpp:776
std::bidirectional_iterator_tag iterator_category
Definition: pugixml.hpp:780
xml_attribute & reference
Definition: pugixml.hpp:777
xml_attribute_struct * _attr
Definition: pugixml.hpp:302
xml_attribute next_attribute() const
Definition: pugixml.cpp:4378
xml_parse_result load(std::basic_istream< char, std::char_traits< char > > &stream, unsigned int options=parse_default, xml_encoding encoding=encoding_auto)
xml_document(const xml_document &)
xml_parse_result load(std::basic_istream< wchar_t, std::char_traits< wchar_t > > &stream, unsigned int options=parse_default)
void save(std::basic_ostream< wchar_t, std::char_traits< wchar_t > > &stream, const char_t *indent=PUGIXML_TEXT("\t"), unsigned int flags=format_default) const
const xml_document & operator=(const xml_document &)
char_t * _buffer
Definition: pugixml.hpp:925
void save(std::basic_ostream< char, std::char_traits< char > > &stream, const char_t *indent=PUGIXML_TEXT("\t"), unsigned int flags=format_default, xml_encoding encoding=encoding_auto) const
std::bidirectional_iterator_tag iterator_category
Definition: pugixml.hpp:816
std::bidirectional_iterator_tag iterator_category
Definition: pugixml.hpp:738
ptrdiff_t difference_type
Definition: pugixml.hpp:732
xml_node first_child() const
Definition: pugixml.cpp:4797
xml_node next_sibling() const
Definition: pugixml.cpp:4715
xml_attribute find_attribute(Predicate pred) const
Definition: pugixml.hpp:522
xml_node_struct * _root
Definition: pugixml.hpp:403
xml_node parent() const
Definition: pugixml.cpp:4749
void print(std::basic_ostream< char, std::char_traits< char > > &os, const char_t *indent=PUGIXML_TEXT("\t"), unsigned int flags=format_default, xml_encoding encoding=encoding_auto, unsigned int depth=0) const
xml_node find_node(Predicate pred) const
Definition: pugixml.hpp:546
xml_attribute_iterator attribute_iterator
Definition: pugixml.hpp:610
xml_node find_child(Predicate pred) const
Definition: pugixml.hpp:534
xml_node_iterator iterator
Definition: pugixml.hpp:604
void print(std::basic_ostream< wchar_t, std::char_traits< wchar_t > > &os, const char_t *indent=PUGIXML_TEXT("\t"), unsigned int flags=format_default, unsigned int depth=0) const
xml_object_range(It b, It e)
Definition: pugixml.hpp:244
xml_node_struct * _root
Definition: pugixml.hpp:641
virtual bool for_each(xml_node &node)=0
xml_writer_stream(std::basic_ostream< wchar_t, std::char_traits< wchar_t > > &stream)
std::basic_ostream< wchar_t, std::char_traits< wchar_t > > * wide_stream
Definition: pugixml.hpp:291
xml_writer_stream(std::basic_ostream< char, std::char_traits< char > > &stream)
std::basic_ostream< char, std::char_traits< char > > * narrow_stream
Definition: pugixml.hpp:290
virtual ~xml_writer()
Definition: pugixml.hpp:259
virtual void write(const void *data, size_t size)=0
xpath_parse_result _result
Definition: pugixml.hpp:1150
const xpath_node * const_iterator
Definition: pugixml.hpp:1218
xpath_node * _begin
Definition: pugixml.hpp:1260
xpath_node * _end
Definition: pugixml.hpp:1261
xpath_node _storage
Definition: pugixml.hpp:1258
xml_node _node
Definition: pugixml.hpp:1168
xml_attribute _attribute
Definition: pugixml.hpp:1169
xpath_parse_result _result
Definition: pugixml.hpp:1091
xpath_query & operator=(const xpath_query &)
xpath_query(const xpath_query &)
xpath_variable_set & operator=(const xpath_variable_set &)
xpath_variable_set(const xpath_variable_set &)
xpath_variable * _next
Definition: pugixml.hpp:1027
xpath_variable & operator=(const xpath_variable &)
xpath_variable(const xpath_variable &)
xpath_value_type _type
Definition: pugixml.hpp:1026
static std::string depth(Dot::Node *node)
Definition: Dot.cpp:848
Definition: pugixml.hpp:89
xml_encoding
Definition: pugixml.hpp:177
@ encoding_utf32
Definition: pugixml.hpp:185
@ encoding_utf16_le
Definition: pugixml.hpp:180
@ encoding_utf32_be
Definition: pugixml.hpp:184
@ encoding_utf16_be
Definition: pugixml.hpp:181
@ encoding_utf8
Definition: pugixml.hpp:179
@ encoding_latin1
Definition: pugixml.hpp:187
@ encoding_utf16
Definition: pugixml.hpp:182
@ encoding_utf32_le
Definition: pugixml.hpp:183
@ encoding_auto
Definition: pugixml.hpp:178
@ encoding_wchar
Definition: pugixml.hpp:186
std::basic_string< PUGIXML_CHAR, std::char_traits< PUGIXML_CHAR >, std::allocator< PUGIXML_CHAR > > string_t
Definition: pugixml.hpp:95
const unsigned int format_no_declaration
Definition: pugixml.hpp:202
xml_node_type
Definition: pugixml.hpp:104
@ node_comment
Definition: pugixml.hpp:110
@ node_pcdata
Definition: pugixml.hpp:108
@ node_element
Definition: pugixml.hpp:107
@ node_doctype
Definition: pugixml.hpp:113
@ node_document
Definition: pugixml.hpp:106
@ node_declaration
Definition: pugixml.hpp:112
@ node_pi
Definition: pugixml.hpp:111
@ node_null
Definition: pugixml.hpp:105
@ node_cdata
Definition: pugixml.hpp:109
const unsigned int parse_trim_pcdata
Definition: pugixml.hpp:159
const unsigned int parse_wconv_attribute
Definition: pugixml.hpp:142
const unsigned int format_raw
Definition: pugixml.hpp:199
const unsigned int format_default
Definition: pugixml.hpp:212
void(* deallocation_function)(void *ptr)
Definition: pugixml.hpp:1281
std::basic_string< char, std::char_traits< char >, std::allocator< char > > PUGIXML_FUNCTION as_utf8(const wchar_t *str)
Definition: pugixml.cpp:6198
const unsigned int parse_cdata
Definition: pugixml.hpp:129
const unsigned int parse_fragment
Definition: pugixml.hpp:163
void *(* allocation_function)(size_t size)
Definition: pugixml.hpp:1278
const unsigned int parse_full
Definition: pugixml.hpp:173
const unsigned int parse_wnorm_attribute
Definition: pugixml.hpp:145
const unsigned int parse_pi
Definition: pugixml.hpp:123
xml_parse_status
Definition: pugixml.hpp:874
@ status_append_invalid_root
Definition: pugixml.hpp:894
@ status_end_element_mismatch
Definition: pugixml.hpp:892
@ status_bad_end_element
Definition: pugixml.hpp:891
@ status_io_error
Definition: pugixml.hpp:878
@ status_bad_attribute
Definition: pugixml.hpp:890
@ status_file_not_found
Definition: pugixml.hpp:877
@ status_internal_error
Definition: pugixml.hpp:880
@ status_bad_start_element
Definition: pugixml.hpp:889
@ status_ok
Definition: pugixml.hpp:875
@ status_bad_comment
Definition: pugixml.hpp:885
@ status_bad_doctype
Definition: pugixml.hpp:887
@ status_out_of_memory
Definition: pugixml.hpp:879
@ status_unrecognized_tag
Definition: pugixml.hpp:882
@ status_bad_cdata
Definition: pugixml.hpp:886
@ status_bad_pcdata
Definition: pugixml.hpp:888
@ status_bad_pi
Definition: pugixml.hpp:884
@ status_no_document_element
Definition: pugixml.hpp:896
void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate)
Definition: pugixml.cpp:6223
deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function()
Definition: pugixml.cpp:6235
std::basic_string< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > PUGIXML_FUNCTION as_wide(const char *str)
Definition: pugixml.cpp:6210
const unsigned int format_save_file_text
Definition: pugixml.hpp:208
allocation_function PUGIXML_FUNCTION get_memory_allocation_function()
Definition: pugixml.cpp:6230
const unsigned int parse_escapes
Definition: pugixml.hpp:136
const unsigned int format_write_bom
Definition: pugixml.hpp:196
const unsigned int format_indent
Definition: pugixml.hpp:193
const unsigned int parse_eol
Definition: pugixml.hpp:139
const unsigned int parse_default
Definition: pugixml.hpp:168
const unsigned int parse_declaration
Definition: pugixml.hpp:148
const unsigned int parse_comments
Definition: pugixml.hpp:126
xpath_value_type
Definition: pugixml.hpp:993
@ xpath_type_number
Definition: pugixml.hpp:996
@ xpath_type_boolean
Definition: pugixml.hpp:998
@ xpath_type_none
Definition: pugixml.hpp:994
@ xpath_type_string
Definition: pugixml.hpp:997
@ xpath_type_node_set
Definition: pugixml.hpp:995
const unsigned int parse_ws_pcdata
Definition: pugixml.hpp:133
const unsigned int parse_minimal
Definition: pugixml.hpp:120
const unsigned int parse_ws_pcdata_single
Definition: pugixml.hpp:156
const unsigned int format_no_escapes
Definition: pugixml.hpp:205
PUGIXML_CHAR char_t
Definition: pugixml.hpp:91
const unsigned int parse_doctype
Definition: pugixml.hpp:151
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
Definition: opencl-c-base.h:48
#define as_int(x)
Definition: opencl-c.h:6372
#define as_uint(x)
Definition: opencl-c.h:6379
#define as_float(x)
Definition: opencl-c.h:6400
void sort(I begin, I end, const Pred &pred)
Definition: pugixml.cpp:6511
void reverse(I begin, I end)
Definition: pugixml.cpp:6344
#define PUGIXML_FUNCTION
Definition: pugixml.hpp:67
#define PUGIXML_CLASS
Definition: pugixml.hpp:62
#define PUGIXML_TEXT(t)
Definition: pugixml.hpp:84
#define PUGIXML_CHAR
Definition: pugixml.hpp:85
#define bool
Definition: stdbool.h:15
A 'name=value' XML attribute structure.
Definition: pugixml.cpp:522
An XML document tree node.
Definition: pugixml.cpp:540
xml_encoding encoding
Definition: pugixml.hpp:909
xml_parse_status status
Definition: pugixml.hpp:903