14 #ifndef PUGIXML_VERSION 16 # define PUGIXML_VERSION 190 22 #ifndef HEADER_PUGIXML_HPP 23 #define HEADER_PUGIXML_HPP 29 #if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS) 34 #ifndef PUGIXML_NO_STL 41 #ifndef PUGIXML_DEPRECATED 42 # if defined(__GNUC__) 43 # define PUGIXML_DEPRECATED __attribute__((deprecated)) 44 # elif defined(_MSC_VER) && _MSC_VER >= 1300 45 # define PUGIXML_DEPRECATED __declspec(deprecated) 47 # define PUGIXML_DEPRECATED 58 # define PUGIXML_CLASS PUGIXML_API 62 #ifndef PUGIXML_FUNCTION 63 # define PUGIXML_FUNCTION PUGIXML_API 67 #ifndef PUGIXML_HAS_LONG_LONG 68 # if __cplusplus >= 201103 69 # define PUGIXML_HAS_LONG_LONG 70 # elif defined(_MSC_VER) && _MSC_VER >= 1400 71 # define PUGIXML_HAS_LONG_LONG 76 #ifndef PUGIXML_HAS_MOVE 77 # if __cplusplus >= 201103 78 # define PUGIXML_HAS_MOVE 79 # elif defined(_MSC_VER) && _MSC_VER >= 1600 80 # define PUGIXML_HAS_MOVE 85 #define PUGIXML_NOEXCEPT 88 #ifndef PUGIXML_NOEXCEPT 89 # if __cplusplus >= 201103 90 # define PUGIXML_NOEXCEPT noexcept 91 # elif defined(_MSC_VER) && _MSC_VER >= 1900 92 # define PUGIXML_NOEXCEPT noexcept 94 # define PUGIXML_NOEXCEPT 99 #ifdef PUGIXML_COMPACT 100 # define PUGIXML_NOEXCEPT_IF_NOT_COMPACT 102 # define PUGIXML_NOEXCEPT_IF_NOT_COMPACT PUGIXML_NOEXCEPT 106 #ifndef PUGIXML_OVERRIDE 107 # if __cplusplus >= 201103 108 # define PUGIXML_OVERRIDE override 109 # elif defined(_MSC_VER) && _MSC_VER >= 1700 110 # define PUGIXML_OVERRIDE override 112 # define PUGIXML_OVERRIDE 117 #ifdef PUGIXML_WCHAR_MODE 118 # define PUGIXML_TEXT(t) L ## t 119 # define PUGIXML_CHAR wchar_t 121 # define PUGIXML_TEXT(t) t 122 # define PUGIXML_CHAR char 130 #ifndef PUGIXML_NO_STL 132 typedef std::basic_string<PUGIXML_CHAR, std::char_traits<PUGIXML_CHAR>, std::allocator<PUGIXML_CHAR> >
string_t;
278 #ifndef PUGIXML_NO_XPATH 310 virtual void write(
const void* data,
size_t size) = 0;
326 #ifndef PUGIXML_NO_STL 333 xml_writer_stream(std::basic_ostream<
wchar_t, std::char_traits<wchar_t> >& stream);
339 std::basic_ostream<wchar_t, std::char_traits<wchar_t> >*
wide_stream;
362 operator unspecified_bool_type()
const;
365 bool operator!()
const;
379 const char_t* name()
const;
380 const char_t* value()
const;
386 int as_int(
int def = 0)
const;
387 unsigned int as_uint(
unsigned int def = 0)
const;
388 double as_double(
double def = 0)
const;
389 float as_float(
float def = 0)
const;
391 #ifdef PUGIXML_HAS_LONG_LONG 392 long long as_llong(
long long def = 0)
const;
393 unsigned long long as_ullong(
unsigned long long def = 0)
const;
397 bool as_bool(
bool def =
false)
const;
400 bool set_name(
const char_t* rhs);
401 bool set_value(
const char_t* rhs);
404 bool set_value(
int rhs);
405 bool set_value(
unsigned int rhs);
406 bool set_value(
long rhs);
407 bool set_value(
unsigned long rhs);
408 bool set_value(
double rhs);
409 bool set_value(
float rhs);
410 bool set_value(
bool rhs);
412 #ifdef PUGIXML_HAS_LONG_LONG 413 bool set_value(
long long rhs);
414 bool set_value(
unsigned long long rhs);
427 #ifdef PUGIXML_HAS_LONG_LONG 437 size_t hash_value()
const;
459 typedef void (*unspecified_bool_type)(
xml_node***);
469 operator unspecified_bool_type()
const;
472 bool operator!()
const;
477 bool operator<(
const xml_node& r)
const;
478 bool operator>(
const xml_node& r)
const;
480 bool operator>=(
const xml_node& r)
const;
489 const char_t* name()
const;
493 const char_t* value()
const;
526 const char_t* child_value()
const;
532 bool set_name(
const char_t* rhs);
533 bool set_value(
const char_t* rhs);
576 bool remove_child(
const xml_node& n);
577 bool remove_child(
const char_t* name);
617 if (pred(cur))
return cur;
636 #ifndef PUGIXML_NO_STL 647 #ifndef PUGIXML_NO_XPATH 665 #ifndef PUGIXML_NO_STL 667 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;
668 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;
674 iterator
begin()
const;
675 iterator
end()
const;
680 attribute_iterator attributes_begin()
const;
681 attribute_iterator attributes_end()
const;
689 ptrdiff_t offset_debug()
const;
692 size_t hash_value()
const;
711 typedef void (*unspecified_bool_type)(
xml_text***);
723 operator unspecified_bool_type()
const;
726 bool operator!()
const;
732 const char_t*
get()
const;
738 int as_int(
int def = 0)
const;
739 unsigned int as_uint(
unsigned int def = 0)
const;
740 double as_double(
double def = 0)
const;
741 float as_float(
float def = 0)
const;
743 #ifdef PUGIXML_HAS_LONG_LONG 744 long long as_llong(
long long def = 0)
const;
745 unsigned long long as_ullong(
unsigned long long def = 0)
const;
749 bool as_bool(
bool def =
false)
const;
752 bool set(
const char_t* rhs);
756 bool set(
unsigned int rhs);
758 bool set(
unsigned long rhs);
759 bool set(
double rhs);
763 #ifdef PUGIXML_HAS_LONG_LONG 764 bool set(
long long rhs);
765 bool set(
unsigned long long rhs);
771 xml_text& operator=(
unsigned int rhs);
773 xml_text& operator=(
unsigned long rhs);
778 #ifdef PUGIXML_HAS_LONG_LONG 780 xml_text& operator=(
unsigned long long rhs);
811 #ifndef PUGIXML_NO_STL 853 #ifndef PUGIXML_NO_STL 889 #ifndef PUGIXML_NO_STL 940 virtual bool for_each(
xml_node& node) = 0;
989 operator bool()
const;
992 const char* description()
const;
1018 #ifdef PUGIXML_HAS_MOVE 1030 #ifndef PUGIXML_NO_STL 1033 xml_parse_result load(std::basic_istream<
wchar_t, std::char_traits<wchar_t> >& stream,
unsigned int options = parse_default);
1060 #ifndef PUGIXML_NO_STL 1063 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;
1074 #ifndef PUGIXML_NO_XPATH 1098 operator bool()
const;
1101 const char* description()
const;
1121 const char_t* name()
const;
1127 bool get_boolean()
const;
1128 double get_number()
const;
1129 const char_t* get_string()
const;
1133 bool set(
bool value);
1134 bool set(
double value);
1135 bool set(
const char_t* value);
1162 #ifdef PUGIXML_HAS_MOVE 1172 bool set(
const char_t* name,
bool value);
1173 bool set(
const char_t* name,
double value);
1206 #ifdef PUGIXML_HAS_MOVE 1217 bool evaluate_boolean(
const xpath_node& n)
const;
1221 double evaluate_number(
const xpath_node& n)
const;
1223 #ifndef PUGIXML_NO_STL 1233 size_t evaluate_string(
char_t* buffer,
size_t capacity,
const xpath_node& n)
const;
1250 operator unspecified_bool_type()
const;
1253 bool operator!()
const;
1256 #ifndef PUGIXML_NO_EXCEPTIONS 1300 operator unspecified_bool_type()
const;
1303 bool operator!()
const;
1347 #ifdef PUGIXML_HAS_MOVE 1357 size_t size()
const;
1360 const xpath_node& operator[](
size_t index)
const;
1363 const_iterator
begin()
const;
1364 const_iterator
end()
const;
1383 void _assign(const_iterator
begin, const_iterator
end,
type_t type);
1388 #ifndef PUGIXML_NO_STL 1390 std::basic_string<char, std::char_traits<char>, std::allocator<char> >
PUGIXML_FUNCTION as_utf8(
const wchar_t* str);
1391 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);
1394 std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
PUGIXML_FUNCTION as_wide(
const char* str);
1395 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);
1399 typedef void* (*allocation_function)(
size_t size);
1412 #if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC)) 1422 #if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC) 1436 #if defined(PUGIXML_HEADER_ONLY) && !defined(PUGIXML_SOURCE) 1437 # define PUGIXML_SOURCE "pugixml.cpp" 1438 # include PUGIXML_SOURCE
xml_attribute next_attribute() const
xml_node_iterator iterator
xml_node find_child(Predicate pred) const
std::basic_ostream< char, std::char_traits< char > > * narrow_stream
PUGI__FN std::basic_string< wchar_t > PUGIXML_FUNCTION as_wide(const char *str)
xml_node find_node(Predicate pred) const
std::basic_string< PUGIXML_CHAR, std::char_traits< PUGIXML_CHAR >, std::allocator< PUGIXML_CHAR > > string_t
std::bidirectional_iterator_tag iterator_category
ptrdiff_t difference_type
const unsigned int parse_ws_pcdata_single
xml_object_range(It b, It e)
void append_attribute(xml_attribute_struct *attr, xml_node_struct *node)
const unsigned int parse_embed_pcdata
const unsigned int parse_minimal
void remove_attribute(xml_attribute_struct *attr, xml_node_struct *node)
xml_node next_sibling() const
bool operator==(const Waypoint &lhs, const Waypoint &rhs)
std::bidirectional_iterator_tag iterator_category
void reverse(I begin, I end)
const unsigned int parse_escapes
void(* deallocation_function)(void *ptr)
void insert_attribute_before(xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node)
const unsigned int format_write_bom
const unsigned int parse_trim_pcdata
static std::string as_string(const Buffer &buf)
PUGI__FN std::string PUGIXML_FUNCTION as_utf8(const wchar_t *str)
const unsigned int format_no_empty_element_tags
const unsigned int parse_comments
const unsigned int parse_wnorm_attribute
#define PUGIXML_DEPRECATED
const unsigned int parse_eol
#define PUGIXML_NOEXCEPT_IF_NOT_COMPACT
xml_attribute & reference
const unsigned int parse_ws_pcdata
ptrdiff_t difference_type
PUGI__FN allocation_function PUGIXML_FUNCTION get_memory_allocation_function()
xpath_parse_result _result
const unsigned int format_default
std::bidirectional_iterator_tag iterator_category
xml_attribute find_attribute(Predicate pred) const
bool operator!=(const Waypoint &lhs, const Waypoint &rhs)
const unsigned int parse_full
const xpath_node * iterator
PUGI__FN deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function()
PUGI__FN void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate)
const unsigned int format_save_file_text
const unsigned int parse_declaration
const unsigned int parse_fragment
void insert_attribute_after(xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node)
const unsigned int parse_default
ptrdiff_t difference_type
const unsigned int format_no_declaration
const unsigned int format_raw
const unsigned int format_no_escapes
std::basic_ostream< wchar_t, std::char_traits< wchar_t > > * wide_stream
const unsigned int parse_doctype
xml_attribute_struct * _attr
void *(* allocation_function)(size_t size)
xml_attribute_iterator attribute_iterator
xml_node first_child() const
const unsigned int format_indent
const unsigned int parse_pi
const unsigned int parse_wconv_attribute
void prepend_attribute(xml_attribute_struct *attr, xml_node_struct *node)
const xpath_node * const_iterator
void sort(I begin, I end, const Pred &pred)
xpath_parse_result _result
const unsigned int parse_cdata
const unsigned int format_indent_attributes