50 #ifdef ICLUtils_EXPORTS 51 #define PUGIXML_API __declspec(dllexport) 53 #define PUGIXML_CLASS __declspec(dllimport) 57 #ifndef PUGIXML_VERSION 59 # define PUGIXML_VERSION 160 66 #if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS) 71 #ifndef PUGIXML_NO_STL 78 #ifndef PUGIXML_DEPRECATED 79 # if defined(__GNUC__) 80 # define PUGIXML_DEPRECATED __attribute__((deprecated)) 81 # elif defined(_MSC_VER) && _MSC_VER >= 1300 82 # define PUGIXML_DEPRECATED __declspec(deprecated) 84 # define PUGIXML_DEPRECATED 95 # define PUGIXML_CLASS PUGIXML_API 99 #ifndef PUGIXML_FUNCTION 100 # define PUGIXML_FUNCTION PUGIXML_API 104 #ifndef PUGIXML_HAS_LONG_LONG 105 # if __cplusplus >= 201103 106 # define PUGIXML_HAS_LONG_LONG 107 # elif defined(_MSC_VER) && _MSC_VER >= 1400 108 # define PUGIXML_HAS_LONG_LONG 113 #ifdef PUGIXML_WCHAR_MODE 114 # define PUGIXML_TEXT(t) L ## t 115 # define PUGIXML_CHAR wchar_t 117 # define PUGIXML_TEXT(t) t 118 # define PUGIXML_CHAR char 124 typedef PUGIXML_CHAR char_t;
126 #ifndef PUGIXML_NO_STL 128 typedef std::basic_string<PUGIXML_CHAR, std::char_traits<PUGIXML_CHAR>, std::allocator<PUGIXML_CHAR> > string_t;
153 const unsigned int parse_minimal = 0x0000;
156 const unsigned int parse_pi = 0x0001;
159 const unsigned int parse_comments = 0x0002;
162 const unsigned int parse_cdata = 0x0004;
166 const unsigned int parse_ws_pcdata = 0x0008;
169 const unsigned int parse_escapes = 0x0010;
172 const unsigned int parse_eol = 0x0020;
175 const unsigned int parse_wconv_attribute = 0x0040;
178 const unsigned int parse_wnorm_attribute = 0x0080;
181 const unsigned int parse_declaration = 0x0100;
184 const unsigned int parse_doctype = 0x0200;
189 const unsigned int parse_ws_pcdata_single = 0x0400;
192 const unsigned int parse_trim_pcdata = 0x0800;
196 const unsigned int parse_fragment = 0x1000;
201 const unsigned int parse_default = parse_cdata | parse_escapes | parse_wconv_attribute | parse_eol;
206 const unsigned int parse_full = parse_default | parse_pi | parse_comments | parse_declaration | parse_doctype;
226 const unsigned int format_indent = 0x01;
229 const unsigned int format_write_bom = 0x02;
232 const unsigned int format_raw = 0x04;
235 const unsigned int format_no_declaration = 0x08;
238 const unsigned int format_no_escapes = 0x10;
241 const unsigned int format_save_file_text = 0x20;
244 const unsigned int format_indent_attributes = 0x40;
248 const unsigned int format_default = format_indent;
251 struct xml_attribute_struct;
252 struct xml_node_struct;
254 class xml_node_iterator;
255 class xml_attribute_iterator;
256 class xml_named_node_iterator;
258 class xml_tree_walker;
260 struct xml_parse_result;
266 #ifndef PUGIXML_NO_XPATH 268 class xpath_node_set;
270 class xpath_variable_set;
274 template <
typename It>
class xml_object_range
277 typedef It const_iterator;
280 xml_object_range(It b, It e): _begin(b), _end(e)
284 It begin()
const {
return _begin; }
285 It end()
const {
return _end; }
292 class PUGIXML_CLASS xml_writer
295 virtual ~xml_writer() {}
298 virtual void write(
const void*
data,
size_t size) = 0;
302 class PUGIXML_CLASS xml_writer_file:
public xml_writer
306 xml_writer_file(
void* file);
308 virtual void write(
const void*
data,
size_t size);
314 #ifndef PUGIXML_NO_STL 316 class PUGIXML_CLASS xml_writer_stream:
public xml_writer
320 xml_writer_stream(std::basic_ostream<
char, std::char_traits<char> >& stream);
321 xml_writer_stream(std::basic_ostream<
wchar_t, std::char_traits<wchar_t> >& stream);
323 virtual void write(
const void*
data,
size_t size);
326 std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
327 std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream;
332 class PUGIXML_CLASS xml_attribute
334 friend class xml_attribute_iterator;
335 friend class xml_node;
338 xml_attribute_struct* _attr;
340 typedef void (*unspecified_bool_type)(xml_attribute***);
347 explicit xml_attribute(xml_attribute_struct* attr);
350 operator unspecified_bool_type()
const;
353 bool operator!()
const;
356 bool operator==(
const xml_attribute& r)
const;
357 bool operator!=(
const xml_attribute& r)
const;
358 bool operator<(
const xml_attribute& r)
const;
359 bool operator>(
const xml_attribute& r)
const;
360 bool operator<=(
const xml_attribute& r)
const;
361 bool operator>=(
const xml_attribute& r)
const;
367 const char_t* name()
const;
368 const char_t* value()
const;
371 const char_t* as_string(
const char_t* def = PUGIXML_TEXT(
""))
const;
374 int as_int(
int def = 0)
const;
375 unsigned int as_uint(
unsigned int def = 0)
const;
376 double as_double(
double def = 0)
const;
377 float as_float(
float def = 0)
const;
379 #ifdef PUGIXML_HAS_LONG_LONG 380 long long as_llong(
long long def = 0)
const;
381 unsigned long long as_ullong(
unsigned long long def = 0)
const;
385 bool as_bool(
bool def =
false)
const;
388 bool set_name(
const char_t* rhs);
389 bool set_value(
const char_t* rhs);
392 bool set_value(
int rhs);
393 bool set_value(
unsigned int rhs);
394 bool set_value(
double rhs);
395 bool set_value(
float rhs);
396 bool set_value(
bool rhs);
398 #ifdef PUGIXML_HAS_LONG_LONG 399 bool set_value(
long long rhs);
400 bool set_value(
unsigned long long rhs);
404 xml_attribute& operator=(
const char_t* rhs);
405 xml_attribute& operator=(
int rhs);
406 xml_attribute& operator=(
unsigned int rhs);
407 xml_attribute& operator=(
double rhs);
408 xml_attribute& operator=(
float rhs);
409 xml_attribute& operator=(
bool rhs);
411 #ifdef PUGIXML_HAS_LONG_LONG 412 xml_attribute& operator=(
long long rhs);
413 xml_attribute& operator=(
unsigned long long rhs);
417 xml_attribute next_attribute()
const;
418 xml_attribute previous_attribute()
const;
421 size_t hash_value()
const;
424 xml_attribute_struct* internal_object()
const;
429 bool PUGIXML_FUNCTION
operator&&(
const xml_attribute& lhs,
bool rhs);
430 bool PUGIXML_FUNCTION
operator||(
const xml_attribute& lhs,
bool rhs);
434 class PUGIXML_CLASS xml_node
436 friend class xml_attribute_iterator;
437 friend class xml_node_iterator;
438 friend class xml_named_node_iterator;
441 xml_node_struct* _root;
443 typedef void (*unspecified_bool_type)(xml_node***);
450 explicit xml_node(xml_node_struct* p);
453 operator unspecified_bool_type()
const;
456 bool operator!()
const;
459 bool operator==(
const xml_node& r)
const;
460 bool operator!=(
const xml_node& r)
const;
461 bool operator<(
const xml_node& r)
const;
462 bool operator>(
const xml_node& r)
const;
463 bool operator<=(
const xml_node& r)
const;
464 bool operator>=(
const xml_node& r)
const;
470 xml_node_type type()
const;
473 const char_t* name()
const;
477 const char_t* value()
const;
480 xml_attribute first_attribute()
const;
481 xml_attribute last_attribute()
const;
484 xml_node first_child()
const;
485 xml_node last_child()
const;
488 xml_node next_sibling()
const;
489 xml_node previous_sibling()
const;
492 xml_node parent()
const;
495 xml_node root()
const;
498 xml_text
text()
const;
501 xml_node child(
const char_t* name)
const;
502 xml_attribute attribute(
const char_t* name)
const;
503 xml_node next_sibling(
const char_t* name)
const;
504 xml_node previous_sibling(
const char_t* name)
const;
507 xml_attribute attribute(
const char_t* name, xml_attribute& hint)
const;
510 const char_t* child_value()
const;
513 const char_t* child_value(
const char_t* name)
const;
516 bool set_name(
const char_t* rhs);
517 bool set_value(
const char_t* rhs);
520 xml_attribute append_attribute(
const char_t* name);
521 xml_attribute prepend_attribute(
const char_t* name);
522 xml_attribute insert_attribute_after(
const char_t* name,
const xml_attribute& attr);
523 xml_attribute insert_attribute_before(
const char_t* name,
const xml_attribute& attr);
526 xml_attribute append_copy(
const xml_attribute& proto);
527 xml_attribute prepend_copy(
const xml_attribute& proto);
528 xml_attribute insert_copy_after(
const xml_attribute& proto,
const xml_attribute& attr);
529 xml_attribute insert_copy_before(
const xml_attribute& proto,
const xml_attribute& attr);
532 xml_node append_child(xml_node_type type = node_element);
533 xml_node prepend_child(xml_node_type type = node_element);
534 xml_node insert_child_after(xml_node_type type,
const xml_node& node);
535 xml_node insert_child_before(xml_node_type type,
const xml_node& node);
538 xml_node append_child(
const char_t* name);
539 xml_node prepend_child(
const char_t* name);
540 xml_node insert_child_after(
const char_t* name,
const xml_node& node);
541 xml_node insert_child_before(
const char_t* name,
const xml_node& node);
544 xml_node append_copy(
const xml_node& proto);
545 xml_node prepend_copy(
const xml_node& proto);
546 xml_node insert_copy_after(
const xml_node& proto,
const xml_node& node);
547 xml_node insert_copy_before(
const xml_node& proto,
const xml_node& node);
550 xml_node append_move(
const xml_node& moved);
551 xml_node prepend_move(
const xml_node& moved);
552 xml_node insert_move_after(
const xml_node& moved,
const xml_node& node);
553 xml_node insert_move_before(
const xml_node& moved,
const xml_node& node);
556 bool remove_attribute(
const xml_attribute& a);
557 bool remove_attribute(
const char_t* name);
560 bool remove_child(
const xml_node& n);
561 bool remove_child(
const char_t* name);
566 xml_parse_result append_buffer(
const void* contents,
size_t size,
unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
569 template <
typename Predicate> xml_attribute find_attribute(Predicate pred)
const 571 if (!_root)
return xml_attribute();
573 for (xml_attribute attrib = first_attribute(); attrib; attrib = attrib.next_attribute())
577 return xml_attribute();
581 template <
typename Predicate> xml_node find_child(Predicate pred)
const 583 if (!_root)
return xml_node();
585 for (xml_node node = first_child(); node; node = node.next_sibling())
593 template <
typename Predicate> xml_node find_node(Predicate pred)
const 595 if (!_root)
return xml_node();
597 xml_node cur = first_child();
599 while (cur._root && cur._root != _root)
601 if (pred(cur))
return cur;
603 if (cur.first_child()) cur = cur.first_child();
604 else if (cur.next_sibling()) cur = cur.next_sibling();
607 while (!cur.next_sibling() && cur._root != _root) cur = cur.parent();
609 if (cur._root != _root) cur = cur.next_sibling();
617 xml_node find_child_by_attribute(
const char_t* name,
const char_t* attr_name,
const char_t* attr_value)
const;
618 xml_node find_child_by_attribute(
const char_t* attr_name,
const char_t* attr_value)
const;
620 #ifndef PUGIXML_NO_STL 622 string_t path(char_t delimiter =
'/')
const;
626 xml_node first_element_by_path(
const char_t* path, char_t delimiter =
'/')
const;
629 bool traverse(xml_tree_walker& walker);
631 #ifndef PUGIXML_NO_XPATH 633 xpath_node select_node(
const char_t* query, xpath_variable_set* variables = 0)
const;
634 xpath_node select_node(
const xpath_query& query)
const;
637 xpath_node_set select_nodes(
const char_t* query, xpath_variable_set* variables = 0)
const;
638 xpath_node_set select_nodes(
const xpath_query& query)
const;
641 xpath_node select_single_node(
const char_t* query, xpath_variable_set* variables = 0)
const;
642 xpath_node select_single_node(
const xpath_query& query)
const;
647 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;
649 #ifndef PUGIXML_NO_STL 651 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;
652 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;
656 typedef xml_node_iterator iterator;
658 iterator begin()
const;
659 iterator end()
const;
662 typedef xml_attribute_iterator attribute_iterator;
664 attribute_iterator attributes_begin()
const;
665 attribute_iterator attributes_end()
const;
668 xml_object_range<xml_node_iterator> children()
const;
669 xml_object_range<xml_named_node_iterator> children(
const char_t* name)
const;
670 xml_object_range<xml_attribute_iterator> attributes()
const;
673 ptrdiff_t offset_debug()
const;
676 size_t hash_value()
const;
679 xml_node_struct* internal_object()
const;
684 bool PUGIXML_FUNCTION
operator&&(
const xml_node& lhs,
bool rhs);
685 bool PUGIXML_FUNCTION
operator||(
const xml_node& lhs,
bool rhs);
689 class PUGIXML_CLASS xml_text
691 friend class xml_node;
693 xml_node_struct* _root;
695 typedef void (*unspecified_bool_type)(xml_text***);
697 explicit xml_text(xml_node_struct* root);
699 xml_node_struct* _data_new();
700 xml_node_struct* _data()
const;
707 operator unspecified_bool_type()
const;
710 bool operator!()
const;
716 const char_t* get()
const;
719 const char_t* as_string(
const char_t* def = PUGIXML_TEXT(
""))
const;
722 int as_int(
int def = 0)
const;
723 unsigned int as_uint(
unsigned int def = 0)
const;
724 double as_double(
double def = 0)
const;
725 float as_float(
float def = 0)
const;
727 #ifdef PUGIXML_HAS_LONG_LONG 728 long long as_llong(
long long def = 0)
const;
729 unsigned long long as_ullong(
unsigned long long def = 0)
const;
733 bool as_bool(
bool def =
false)
const;
736 bool set(
const char_t* rhs);
740 bool set(
unsigned int rhs);
741 bool set(
double rhs);
745 #ifdef PUGIXML_HAS_LONG_LONG 746 bool set(
long long rhs);
747 bool set(
unsigned long long rhs);
751 xml_text& operator=(
const char_t* rhs);
752 xml_text& operator=(
int rhs);
753 xml_text& operator=(
unsigned int rhs);
754 xml_text& operator=(
double rhs);
755 xml_text& operator=(
float rhs);
756 xml_text& operator=(
bool rhs);
758 #ifdef PUGIXML_HAS_LONG_LONG 759 xml_text& operator=(
long long rhs);
760 xml_text& operator=(
unsigned long long rhs);
764 xml_node
data()
const;
769 bool PUGIXML_FUNCTION
operator&&(
const xml_text& lhs,
bool rhs);
770 bool PUGIXML_FUNCTION
operator||(
const xml_text& lhs,
bool rhs);
774 class PUGIXML_CLASS xml_node_iterator
776 friend class xml_node;
779 mutable xml_node _wrap;
782 xml_node_iterator(xml_node_struct* ref, xml_node_struct* parent);
786 typedef ptrdiff_t difference_type;
787 typedef xml_node value_type;
788 typedef xml_node* pointer;
789 typedef xml_node& reference;
791 #ifndef PUGIXML_NO_STL 792 typedef std::bidirectional_iterator_tag iterator_category;
799 xml_node_iterator(
const xml_node& node);
802 bool operator==(
const xml_node_iterator& rhs)
const;
803 bool operator!=(
const xml_node_iterator& rhs)
const;
806 xml_node* operator->()
const;
808 const xml_node_iterator& operator++();
809 xml_node_iterator operator++(
int);
811 const xml_node_iterator& operator--();
812 xml_node_iterator operator--(
int);
816 class PUGIXML_CLASS xml_attribute_iterator
818 friend class xml_node;
821 mutable xml_attribute _wrap;
824 xml_attribute_iterator(xml_attribute_struct* ref, xml_node_struct* parent);
828 typedef ptrdiff_t difference_type;
829 typedef xml_attribute value_type;
830 typedef xml_attribute* pointer;
831 typedef xml_attribute& reference;
833 #ifndef PUGIXML_NO_STL 834 typedef std::bidirectional_iterator_tag iterator_category;
838 xml_attribute_iterator();
841 xml_attribute_iterator(
const xml_attribute& attr,
const xml_node& parent);
844 bool operator==(
const xml_attribute_iterator& rhs)
const;
845 bool operator!=(
const xml_attribute_iterator& rhs)
const;
848 xml_attribute* operator->()
const;
850 const xml_attribute_iterator& operator++();
851 xml_attribute_iterator operator++(
int);
853 const xml_attribute_iterator& operator--();
854 xml_attribute_iterator operator--(
int);
858 class PUGIXML_CLASS xml_named_node_iterator
860 friend class xml_node;
864 typedef ptrdiff_t difference_type;
865 typedef xml_node value_type;
866 typedef xml_node* pointer;
867 typedef xml_node& reference;
869 #ifndef PUGIXML_NO_STL 870 typedef std::bidirectional_iterator_tag iterator_category;
874 xml_named_node_iterator();
877 xml_named_node_iterator(
const xml_node& node,
const char_t* name);
880 bool operator==(
const xml_named_node_iterator& rhs)
const;
881 bool operator!=(
const xml_named_node_iterator& rhs)
const;
884 xml_node* operator->()
const;
886 const xml_named_node_iterator& operator++();
887 xml_named_node_iterator operator++(
int);
889 const xml_named_node_iterator& operator--();
890 xml_named_node_iterator operator--(
int);
893 mutable xml_node _wrap;
897 xml_named_node_iterator(xml_node_struct* ref, xml_node_struct* parent,
const char_t* name);
901 class PUGIXML_CLASS xml_tree_walker
903 friend class xml_node;
914 virtual ~xml_tree_walker();
917 virtual bool begin(xml_node& node);
920 virtual bool for_each(xml_node& node) = 0;
923 virtual bool end(xml_node& node);
927 enum xml_parse_status
931 status_file_not_found,
933 status_out_of_memory,
934 status_internal_error,
936 status_unrecognized_tag,
943 status_bad_start_element,
944 status_bad_attribute,
945 status_bad_end_element,
946 status_end_element_mismatch,
948 status_append_invalid_root,
950 status_no_document_element
954 struct PUGIXML_CLASS xml_parse_result
957 xml_parse_status status;
963 xml_encoding encoding;
969 operator bool()
const;
972 const char* description()
const;
976 class PUGIXML_CLASS xml_document:
public xml_node
984 xml_document(
const xml_document&);
985 const xml_document& operator=(
const xml_document&);
1001 void reset(
const xml_document& proto);
1003 #ifndef PUGIXML_NO_STL 1005 xml_parse_result
load(std::basic_istream<
char, std::char_traits<char> >& stream,
1006 unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
1007 xml_parse_result
load(std::basic_istream<
wchar_t, std::char_traits<wchar_t> >& stream,
1008 unsigned int options = parse_default);
1009 xml_parse_result loadNext(std::basic_istream<
char, std::char_traits<char> >& stream,
1010 unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
1015 xml_parse_result
load(
const char_t* contents,
unsigned int options = parse_default);
1018 xml_parse_result load_string(
const char_t* contents,
unsigned int options = parse_default);
1021 xml_parse_result load_file(
const char* path,
unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
1022 xml_parse_result load_file(
const wchar_t* path,
unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
1025 xml_parse_result load_buffer(
const void* contents,
size_t size,
unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
1029 xml_parse_result load_buffer_inplace(
void* contents,
size_t size,
unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
1033 xml_parse_result load_buffer_inplace_own(
void* contents,
size_t size,
unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
1036 void save(xml_writer& writer,
const char_t* indent = PUGIXML_TEXT(
"\t"),
unsigned int flags = format_default, xml_encoding encoding = encoding_auto)
const;
1038 #ifndef PUGIXML_NO_STL 1040 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;
1041 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;
1045 bool save_file(
const char* path,
const char_t* indent = PUGIXML_TEXT(
"\t"),
unsigned int flags = format_default, xml_encoding encoding = encoding_auto)
const;
1046 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;
1049 xml_node document_element()
const;
1052 #ifndef PUGIXML_NO_XPATH 1054 enum xpath_value_type
1057 xpath_type_node_set,
1064 struct PUGIXML_CLASS xpath_parse_result
1073 xpath_parse_result();
1076 operator bool()
const;
1079 const char* description()
const;
1083 class PUGIXML_CLASS xpath_variable
1085 friend class xpath_variable_set;
1088 xpath_value_type _type;
1089 xpath_variable* _next;
1091 xpath_variable(xpath_value_type type);
1094 xpath_variable(
const xpath_variable&);
1095 xpath_variable& operator=(
const xpath_variable&);
1099 const char_t* name()
const;
1102 xpath_value_type type()
const;
1105 bool get_boolean()
const;
1106 double get_number()
const;
1107 const char_t* get_string()
const;
1108 const xpath_node_set& get_node_set()
const;
1111 bool set(
bool value);
1112 bool set(
double value);
1113 bool set(
const char_t* value);
1114 bool set(
const xpath_node_set& value);
1118 class PUGIXML_CLASS xpath_variable_set
1121 xpath_variable* _data[64];
1123 void _assign(
const xpath_variable_set& rhs);
1124 void _swap(xpath_variable_set& rhs);
1126 xpath_variable* _find(
const char_t* name)
const;
1128 static bool _clone(xpath_variable* var, xpath_variable** out_result);
1129 static void _destroy(xpath_variable* var);
1133 xpath_variable_set();
1134 ~xpath_variable_set();
1137 xpath_variable_set(
const xpath_variable_set& rhs);
1138 xpath_variable_set& operator=(
const xpath_variable_set& rhs);
1140 #if __cplusplus >= 201103 1142 xpath_variable_set(xpath_variable_set&& rhs);
1143 xpath_variable_set& operator=(xpath_variable_set&& rhs);
1147 xpath_variable* add(
const char_t* name, xpath_value_type type);
1150 bool set(
const char_t* name,
bool value);
1151 bool set(
const char_t* name,
double value);
1152 bool set(
const char_t* name,
const char_t* value);
1153 bool set(
const char_t* name,
const xpath_node_set& value);
1156 xpath_variable* get(
const char_t* name);
1157 const xpath_variable* get(
const char_t* name)
const;
1161 class PUGIXML_CLASS xpath_query
1165 xpath_parse_result _result;
1167 typedef void (*unspecified_bool_type)(xpath_query***);
1170 xpath_query(
const xpath_query&);
1171 xpath_query& operator=(
const xpath_query&);
1176 explicit xpath_query(
const char_t* query, xpath_variable_set* variables = 0);
1184 #if __cplusplus >= 201103 1186 xpath_query(xpath_query&& rhs);
1187 xpath_query& operator=(xpath_query&& rhs);
1191 xpath_value_type return_type()
const;
1195 bool evaluate_boolean(
const xpath_node& n)
const;
1199 double evaluate_number(
const xpath_node& n)
const;
1201 #ifndef PUGIXML_NO_STL 1204 string_t evaluate_string(
const xpath_node& n)
const;
1211 size_t evaluate_string(char_t* buffer,
size_t capacity,
const xpath_node& n)
const;
1216 xpath_node_set evaluate_node_set(
const xpath_node& n)
const;
1222 xpath_node evaluate_node(
const xpath_node& n)
const;
1225 const xpath_parse_result& result()
const;
1228 operator unspecified_bool_type()
const;
1231 bool operator!()
const;
1234 #ifndef PUGIXML_NO_EXCEPTIONS 1236 class PUGIXML_CLASS xpath_exception:
public std::exception
1239 xpath_parse_result _result;
1243 explicit xpath_exception(
const xpath_parse_result& result);
1246 virtual const char* what()
const throw();
1249 const xpath_parse_result& result() const;
1254 class PUGIXML_CLASS xpath_node
1258 xml_attribute _attribute;
1260 typedef void (*unspecified_bool_type)(xpath_node***);
1267 xpath_node(
const xml_node& node);
1268 xpath_node(
const xml_attribute& attribute,
const xml_node& parent);
1271 xml_node node()
const;
1272 xml_attribute attribute()
const;
1275 xml_node parent()
const;
1278 operator unspecified_bool_type()
const;
1281 bool operator!()
const;
1284 bool operator==(
const xpath_node& n)
const;
1285 bool operator!=(
const xpath_node& n)
const;
1290 bool PUGIXML_FUNCTION
operator&&(
const xpath_node& lhs,
bool rhs);
1291 bool PUGIXML_FUNCTION
operator||(
const xpath_node& lhs,
bool rhs);
1295 class PUGIXML_CLASS xpath_node_set
1307 typedef const xpath_node* const_iterator;
1310 typedef const xpath_node* iterator;
1316 xpath_node_set(const_iterator begin, const_iterator end, type_t type = type_unsorted);
1322 xpath_node_set(
const xpath_node_set& ns);
1323 xpath_node_set& operator=(
const xpath_node_set& ns);
1325 #if __cplusplus >= 201103 1327 xpath_node_set(xpath_node_set&& rhs);
1328 xpath_node_set& operator=(xpath_node_set&& rhs);
1332 type_t type()
const;
1335 size_t size()
const;
1338 const xpath_node& operator[](
size_t index)
const;
1341 const_iterator begin()
const;
1342 const_iterator end()
const;
1345 void sort(
bool reverse =
false);
1348 xpath_node first()
const;
1356 xpath_node _storage;
1361 void _assign(const_iterator begin, const_iterator end, type_t type);
1362 void _move(xpath_node_set& rhs);
1366 #ifndef PUGIXML_NO_STL 1368 std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(
const wchar_t*
str);
1369 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);
1372 std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(
const char*
str);
1373 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);
1377 typedef void* (*allocation_function)(
size_t size);
1380 typedef void (*deallocation_function)(
void* ptr);
1383 void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
1386 allocation_function PUGIXML_FUNCTION get_memory_allocation_function();
1387 deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function();
1390 #if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC)) 1394 std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(
const pugi::xml_node_iterator&);
1395 std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(
const pugi::xml_attribute_iterator&);
1396 std::bidirectional_iterator_tag PUGIXML_FUNCTION _Iter_cat(
const pugi::xml_named_node_iterator&);
1400 #if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC) 1404 std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(
const pugi::xml_node_iterator&);
1405 std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(
const pugi::xml_attribute_iterator&);
1406 std::bidirectional_iterator_tag PUGIXML_FUNCTION __iterator_category(
const pugi::xml_named_node_iterator&);
1412 #if defined(PUGIXML_HEADER_ONLY) && !defined(PUGIXML_SOURCE) 1413 # define PUGIXML_SOURCE "pugixml.cpp" 1414 # include PUGIXML_SOURCE bool operator||(const ProgArg &a, const ProgArg &b)
this allows to check if either of two progargs are defined
Definition: ProgArg.h:202
ICLQt_API void save(const core::ImgBase &image, const std::string &filename)
write an image to HD
ICLQt_API core::Img< T > create(const std::string &name, core::format fmt=icl::core::formatRGB)
create a test image (converted to destination core::format) (affinity for floats)
ICLQt_API void text(ImgQ &image, int x, int y, const string &text)
renders a text into an image (only available with Qt-Support)
ICLQt_API core::Img< T > load(const std::string &filename)
load an image file read file (affinity for floats)
ICLQt_API ImgROI data(ImgQ &r)
creates full ROI ROI-struct
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
ICLCV_API void error(const char *msg)
Display error message and terminate program.
ICLQt_API ImgQ operator *(const ImgQ &a, const ImgQ &b)
multiplies two images pixel-wise
depth
determines the pixel type of an image (8Bit-int or 32Bit-float)
Definition: Types.h:60
bool operator &&(const ProgArg &a, const ProgArg &b)
this allows to check if two progargs are defined
Definition: ProgArg.h:170
void print(const core::Img< T > &image)
print the images parameters to std::out