16#ifndef PUGIXML_VERSION
17# define PUGIXML_VERSION 1130
23#ifndef HEADER_PUGIXML_HPP
24#define HEADER_PUGIXML_HPP
30#if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS)
42#ifndef PUGIXML_DEPRECATED
44# define PUGIXML_DEPRECATED __attribute__((deprecated))
45# elif defined(_MSC_VER) && _MSC_VER >= 1300
46# define PUGIXML_DEPRECATED __declspec(deprecated)
48# define PUGIXML_DEPRECATED
59# define PUGIXML_CLASS PUGIXML_API
63#ifndef PUGIXML_FUNCTION
64# define PUGIXML_FUNCTION PUGIXML_API
68#ifndef PUGIXML_HAS_LONG_LONG
69# if __cplusplus >= 201103
70# define PUGIXML_HAS_LONG_LONG
71# elif defined(_MSC_VER) && _MSC_VER >= 1400
72# define PUGIXML_HAS_LONG_LONG
77#ifndef PUGIXML_HAS_MOVE
78# if __cplusplus >= 201103
79# define PUGIXML_HAS_MOVE
80# elif defined(_MSC_VER) && _MSC_VER >= 1600
81# define PUGIXML_HAS_MOVE
86#ifndef PUGIXML_NOEXCEPT
87# if __cplusplus >= 201103
88# define PUGIXML_NOEXCEPT noexcept
89# elif defined(_MSC_VER) && _MSC_VER >= 1900
90# define PUGIXML_NOEXCEPT noexcept
92# define PUGIXML_NOEXCEPT
98# define PUGIXML_NOEXCEPT_IF_NOT_COMPACT
100# define PUGIXML_NOEXCEPT_IF_NOT_COMPACT PUGIXML_NOEXCEPT
104#ifndef PUGIXML_OVERRIDE
105# if __cplusplus >= 201103
106# define PUGIXML_OVERRIDE override
107# elif defined(_MSC_VER) && _MSC_VER >= 1700
108# define PUGIXML_OVERRIDE override
110# define PUGIXML_OVERRIDE
116# if __cplusplus >= 201103
117# define PUGIXML_NULL nullptr
118# elif defined(_MSC_VER) && _MSC_VER >= 1600
119# define PUGIXML_NULL nullptr
121# define PUGIXML_NULL 0
126#ifdef PUGIXML_WCHAR_MODE
127# define PUGIXML_TEXT(t) L ## t
128# define PUGIXML_CHAR wchar_t
130# define PUGIXML_TEXT(t) t
131# define PUGIXML_CHAR char
139#ifndef PUGIXML_NO_STL
141 typedef std::basic_string<PUGIXML_CHAR, std::char_traits<PUGIXML_CHAR>, std::allocator<PUGIXML_CHAR> >
string_t;
296 #ifndef PUGIXML_NO_XPATH
315 It
end()
const {
return _end; }
317 bool empty()
const {
return _begin == _end; }
330 virtual void write(
const void* data,
size_t size) = 0;
346 #ifndef PUGIXML_NO_STL
353 xml_writer_stream(std::basic_ostream<
wchar_t, std::char_traits<wchar_t> >& stream);
358 std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
359 std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream;
382 operator unspecified_bool_type()
const;
406 int as_int(
int def = 0)
const;
407 unsigned int as_uint(
unsigned int def = 0)
const;
409 float as_float(
float def = 0)
const;
411 #ifdef PUGIXML_HAS_LONG_LONG
412 long long as_llong(
long long def = 0)
const;
413 unsigned long long as_ullong(
unsigned long long def = 0)
const;
417 bool as_bool(
bool def =
false)
const;
430 bool set_value(
double rhs,
int precision);
432 bool set_value(
float rhs,
int precision);
435 #ifdef PUGIXML_HAS_LONG_LONG
450 #ifdef PUGIXML_HAS_LONG_LONG
647 if (pred(cur))
return cur;
666 #ifndef PUGIXML_NO_STL
677 #ifndef PUGIXML_NO_XPATH
695 #ifndef PUGIXML_NO_STL
698 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;
741 typedef void (*unspecified_bool_type)(xml_text***);
753 operator unspecified_bool_type()
const;
768 int as_int(
int def = 0)
const;
769 unsigned int as_uint(
unsigned int def = 0)
const;
771 float as_float(
float def = 0)
const;
773 #ifdef PUGIXML_HAS_LONG_LONG
774 long long as_llong(
long long def = 0)
const;
775 unsigned long long as_ullong(
unsigned long long def = 0)
const;
779 bool as_bool(
bool def =
false)
const;
787 bool set(
unsigned int rhs);
789 bool set(
unsigned long rhs);
790 bool set(
double rhs);
791 bool set(
double rhs,
int precision);
793 bool set(
float rhs,
int precision);
796 #ifdef PUGIXML_HAS_LONG_LONG
797 bool set(
long long rhs);
798 bool set(
unsigned long long rhs);
811 #ifdef PUGIXML_HAS_LONG_LONG
813 xml_text&
operator=(
unsigned long long rhs);
844 #ifndef PUGIXML_NO_STL
852 xml_node_iterator(
const xml_node& node);
855 bool operator==(
const xml_node_iterator& rhs)
const;
856 bool operator!=(
const xml_node_iterator& rhs)
const;
886 #ifndef PUGIXML_NO_STL
891 xml_attribute_iterator();
897 bool operator==(
const xml_attribute_iterator& rhs)
const;
898 bool operator!=(
const xml_attribute_iterator& rhs)
const;
922 #ifndef PUGIXML_NO_STL
1022 operator bool()
const;
1037 xml_document(
const xml_document&);
1038 xml_document&
operator=(
const xml_document&);
1051 #ifdef PUGIXML_HAS_MOVE
1061 void reset(
const xml_document& proto);
1063 #ifndef PUGIXML_NO_STL
1093 #ifndef PUGIXML_NO_STL
1107#ifndef PUGIXML_NO_XPATH
1131 operator bool()
const;
1166 bool set(
bool value);
1167 bool set(
double value);
1195 #ifdef PUGIXML_HAS_MOVE
1205 bool set(
const char_t* name,
bool value);
1206 bool set(
const char_t* name,
double value);
1222 typedef void (*unspecified_bool_type)(xpath_query***);
1225 xpath_query(
const xpath_query&);
1226 xpath_query&
operator=(
const xpath_query&);
1239 #ifdef PUGIXML_HAS_MOVE
1256 #ifndef PUGIXML_NO_STL
1283 operator unspecified_bool_type()
const;
1289 #ifndef PUGIXML_NO_EXCEPTIONS
1290 #if defined(_MSC_VER)
1293 #pragma warning(push)
1294 #pragma warning(disable: 4275)
1312 #if defined(_MSC_VER)
1313 #pragma warning(pop)
1324 typedef void (*unspecified_bool_type)(
xpath_node***);
1342 operator unspecified_bool_type()
const;
1389 #ifdef PUGIXML_HAS_MOVE
1399 size_t size()
const;
1430#ifndef PUGIXML_NO_STL
1432 std::basic_string<char, std::char_traits<char>, std::allocator<char> >
PUGIXML_FUNCTION as_utf8(
const wchar_t* str);
1433 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);
1436 std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
PUGIXML_FUNCTION as_wide(
const char* str);
1437 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);
1441 typedef void* (*allocation_function)(
size_t size);
1454#if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC))
1464#if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC)
1468 std::bidirectional_iterator_tag
PUGIXML_FUNCTION __iterator_category(
const pugi::xml_node_iterator&);
1469 std::bidirectional_iterator_tag
PUGIXML_FUNCTION __iterator_category(
const pugi::xml_attribute_iterator&);
1470 std::bidirectional_iterator_tag
PUGIXML_FUNCTION __iterator_category(
const pugi::xml_named_node_iterator&);
1478#if defined(PUGIXML_HEADER_ONLY) && !defined(PUGIXML_SOURCE)
1479# define PUGIXML_SOURCE "pugixml.cpp"
1480# include PUGIXML_SOURCE
G4ErrorMatrix operator*(const G4ErrorMatrix &m1, const G4ErrorMatrix &m2)
G4bool operator!=(const G4GeometryCell &k1, const G4GeometryCell &k2)
G4bool operator==(const G4GeometryCell &k1, const G4GeometryCell &k2)
G4PVDivision & operator=(const G4PVDivision &)=delete
void print(G4double elem)
ptrdiff_t difference_type
xml_attribute_iterator & operator--()
xml_attribute * operator->() const
xml_attribute_iterator & operator++()
std::bidirectional_iterator_tag iterator_category
xml_attribute & reference
const char_t * as_string(const char_t *def=PUGIXML_TEXT("")) const
bool operator>=(const xml_attribute &r) const
bool as_bool(bool def=false) const
bool operator<(const xml_attribute &r) const
int as_int(int def=0) const
float as_float(float def=0) const
size_t hash_value() const
const char_t * name() const
xml_attribute previous_attribute() const
xml_attribute next_attribute() const
bool operator<=(const xml_attribute &r) const
double as_double(double def=0) const
bool set_value(const char_t *rhs, size_t sz)
bool set_name(const char_t *rhs)
friend class xml_attribute_iterator
unsigned int as_uint(unsigned int def=0) const
xml_attribute_struct * internal_object() const
bool operator>(const xml_attribute &r) const
const char_t * value() const
xml_parse_result load_buffer_inplace(void *contents, size_t size, unsigned int options=parse_default, xml_encoding encoding=encoding_auto)
xml_node document_element() const
xml_parse_result load_string(const char_t *contents, unsigned int options=parse_default)
bool save_file(const char *path, const char_t *indent=PUGIXML_TEXT("\t"), unsigned int flags=format_default, xml_encoding encoding=encoding_auto) const
xml_parse_result load_buffer_inplace_own(void *contents, size_t size, unsigned int options=parse_default, xml_encoding encoding=encoding_auto)
xml_parse_result load_file(const char *path, unsigned int options=parse_default, xml_encoding encoding=encoding_auto)
xml_parse_result load_buffer(const void *contents, size_t size, unsigned int options=parse_default, xml_encoding encoding=encoding_auto)
xml_parse_result load(std::basic_istream< char, std::char_traits< char > > &stream, unsigned int options=parse_default, xml_encoding encoding=encoding_auto)
void save(xml_writer &writer, const char_t *indent=PUGIXML_TEXT("\t"), unsigned int flags=format_default, xml_encoding encoding=encoding_auto) const
xml_named_node_iterator()
ptrdiff_t difference_type
xml_node * operator->() const
xml_named_node_iterator & operator--()
xml_named_node_iterator & operator++()
std::bidirectional_iterator_tag iterator_category
xml_node_iterator & operator--()
xml_node_iterator & operator++()
xml_node * operator->() const
std::bidirectional_iterator_tag iterator_category
ptrdiff_t difference_type
string_t path(char_t delimiter='/') const
size_t hash_value() const
xml_node_type type() const
xml_node append_child(xml_node_type type=node_element)
xml_node child(const char_t *name) const
bool set_value(const char_t *rhs, size_t sz)
friend class xml_named_node_iterator
xml_node insert_move_after(const xml_node &moved, const xml_node &node)
xml_node last_child() const
xml_node append_move(const xml_node &moved)
xml_node first_child() const
bool operator>(const xml_node &r) const
xml_object_range< xml_node_iterator > children() const
xml_node prepend_move(const xml_node &moved)
xml_node next_sibling() const
xml_node_struct * internal_object() const
xml_attribute find_attribute(Predicate pred) const
xml_object_range< xml_attribute_iterator > attributes() const
bool remove_child(const xml_node &n)
xml_attribute append_copy(const xml_attribute &proto)
xml_node insert_child_after(xml_node_type type, const xml_node &node)
xml_attribute last_attribute() const
attribute_iterator attributes_end() const
xml_node previous_sibling() const
ptrdiff_t offset_debug() const
bool operator<(const xml_node &r) const
xml_parse_result append_buffer(const void *contents, size_t size, unsigned int options=parse_default, xml_encoding encoding=encoding_auto)
const char_t * value() const
void(* unspecified_bool_type)(xml_node ***)
xml_node find_node(Predicate pred) const
xml_attribute_iterator attribute_iterator
const char_t * child_value() const
bool set_name(const char_t *rhs)
xml_node prepend_child(xml_node_type type=node_element)
friend class xml_node_iterator
xml_attribute first_attribute() const
bool operator>=(const xml_node &r) const
xml_attribute insert_copy_after(const xml_attribute &proto, const xml_attribute &attr)
xml_attribute prepend_copy(const xml_attribute &proto)
xml_node insert_move_before(const xml_node &moved, const xml_node &node)
xml_attribute attribute(const char_t *name) const
const char_t * name() const
xml_attribute insert_copy_before(const xml_attribute &proto, const xml_attribute &attr)
attribute_iterator attributes_begin() const
xml_node find_child(Predicate pred) const
xml_node_iterator iterator
bool operator<=(const xml_node &r) const
friend class xml_attribute_iterator
xml_node insert_child_before(xml_node_type type, const xml_node &node)
xml_object_range(It b, It e)
const char_t * as_string(const char_t *def=PUGIXML_TEXT("")) const
double as_double(double def=0) const
float as_float(float def=0) const
bool set(const char_t *rhs, size_t sz)
bool as_bool(bool def=false) const
int as_int(int def=0) const
unsigned int as_uint(unsigned int def=0) const
const char_t * get() const
virtual bool end(xml_node &node)
virtual bool for_each(xml_node &node)=0
virtual bool begin(xml_node &node)
xml_writer_file(void *file)
virtual void write(const void *data, size_t size) PUGIXML_OVERRIDE
xml_writer_stream(std::basic_ostream< char, std::char_traits< char > > &stream)
virtual void write(const void *data, size_t size) PUGIXML_OVERRIDE
virtual void write(const void *data, size_t size)=0
virtual const char * what() const PUGIXML_OVERRIDE
const xpath_parse_result & result() const
xpath_exception(const xpath_parse_result &result)
const_iterator end() const
const xpath_node * const_iterator
const_iterator begin() const
const xpath_node * iterator
const xpath_node & operator[](size_t index) const
xml_attribute attribute() const
string_t evaluate_string(const xpath_node &n) const
double evaluate_number(const xpath_node &n) const
xpath_node_set evaluate_node_set(const xpath_node &n) const
xpath_value_type return_type() const
const xpath_parse_result & result() const
bool evaluate_boolean(const xpath_node &n) const
xpath_node evaluate_node(const xpath_node &n) const
xpath_variable * add(const char_t *name, xpath_value_type type)
bool set(const char_t *name, bool value)
xpath_variable * get(const char_t *name)
xpath_variable(xpath_value_type type)
xpath_variable(const xpath_variable &)
double get_number() const
const char_t * get_string() const
const xpath_node_set & get_node_set() const
xpath_variable & operator=(const xpath_variable &)
xpath_value_type type() const
const char_t * name() const
friend class xpath_variable_set
const unsigned int format_no_empty_element_tags
std::basic_string< PUGIXML_CHAR, std::char_traits< PUGIXML_CHAR >, std::allocator< PUGIXML_CHAR > > string_t
const unsigned int format_no_declaration
const unsigned int parse_trim_pcdata
const unsigned int parse_wconv_attribute
const unsigned int format_skip_control_chars
const unsigned int format_raw
const unsigned int format_default
void(* deallocation_function)(void *ptr)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > PUGIXML_FUNCTION as_utf8(const wchar_t *str)
const int default_double_precision
const unsigned int parse_cdata
void *(* allocation_function)(size_t size)
const unsigned int parse_fragment
const unsigned int parse_full
const unsigned int parse_embed_pcdata
const unsigned int parse_wnorm_attribute
const unsigned int format_indent_attributes
const unsigned int parse_pi
@ status_append_invalid_root
@ status_end_element_mismatch
@ status_bad_start_element
@ status_unrecognized_tag
@ status_no_document_element
void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate)
deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function()
std::basic_string< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > PUGIXML_FUNCTION as_wide(const char *str)
const unsigned int format_save_file_text
allocation_function PUGIXML_FUNCTION get_memory_allocation_function()
const unsigned int parse_escapes
const unsigned int format_write_bom
const unsigned int format_attribute_single_quote
const unsigned int format_indent
const unsigned int parse_eol
const unsigned int parse_default
const unsigned int parse_declaration
const unsigned int parse_comments
const unsigned int parse_ws_pcdata
const unsigned int parse_minimal
const unsigned int parse_ws_pcdata_single
const unsigned int format_no_escapes
const int default_float_precision
const unsigned int parse_doctype
PUGI__FN void reverse(I begin, I end)
void remove_attribute(xml_attribute_struct *attr, xml_node_struct *node)
PUGI__FN void sort(I begin, I end, const Pred &pred)
void insert_attribute_before(xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node)
void append_attribute(xml_attribute_struct *attr, xml_node_struct *node)
void prepend_attribute(xml_attribute_struct *attr, xml_node_struct *node)
allocation_function xml_memory_management_function_storage< T >::allocate
deallocation_function xml_memory_management_function_storage< T >::deallocate
void insert_attribute_after(xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node)
#define PUGIXML_DEPRECATED
#define PUGIXML_NOEXCEPT_IF_NOT_COMPACT
const char * description() const
const char * description() const