15 #ifndef PUGIXML_VERSION
17 # define PUGIXML_VERSION 180
23 #ifndef HEADER_PUGIXML_HPP
24 #define HEADER_PUGIXML_HPP
27 #define USING_OIIO_PUGI 1
33 #if !defined(PUGIXML_NO_XPATH) && !defined(PUGIXML_NO_EXCEPTIONS)
38 #ifndef PUGIXML_NO_STL
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)
51 # define PUGIXML_DEPRECATED
62 # define PUGIXML_CLASS PUGIXML_API
66 #ifndef PUGIXML_FUNCTION
67 # define PUGIXML_FUNCTION PUGIXML_API
71 #ifndef PUGIXML_HAS_LONG_LONG
72 # if __cplusplus >= 201103
73 # define PUGIXML_HAS_LONG_LONG
74 # elif defined(_MSC_VER) && _MSC_VER >= 1400
75 # define PUGIXML_HAS_LONG_LONG
80 #ifndef PUGIXML_HAS_MOVE
81 # if __cplusplus >= 201103
82 # define PUGIXML_HAS_MOVE
83 # elif defined(_MSC_VER) && _MSC_VER >= 1600
84 # define PUGIXML_HAS_MOVE
89 #ifndef PUGIXML_OVERRIDE
90 # if __cplusplus >= 201103
91 # define PUGIXML_OVERRIDE override
93 # define PUGIXML_OVERRIDE
98 #ifdef PUGIXML_WCHAR_MODE
99 # define PUGIXML_TEXT(t) L ## t
100 # define PUGIXML_CHAR wchar_t
102 # define PUGIXML_TEXT(t) t
103 # define PUGIXML_CHAR char
110 namespace pugi = OIIO::pugi;
119 #ifndef PUGIXML_NO_STL
252 struct xml_attribute_struct;
253 struct xml_node_struct;
255 class xml_node_iterator;
256 class xml_attribute_iterator;
257 class xml_named_node_iterator;
259 class xml_tree_walker;
261 struct xml_parse_result;
267 #ifndef PUGIXML_NO_XPATH
269 class xpath_node_set;
271 class xpath_variable_set;
275 template <
typename It>
class xml_object_range
286 It
end()
const {
return _end; }
299 virtual void write(
const void*
data,
size_t size) = 0;
307 xml_writer_file(
void* file);
315 #ifndef PUGIXML_NO_STL
321 xml_writer_stream(std::basic_ostream<
char, std::char_traits<char> >&
stream);
322 xml_writer_stream(std::basic_ostream<
wchar_t, std::char_traits<wchar_t> >&
stream);
327 std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
328 std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream;
335 friend class xml_attribute_iterator;
336 friend class xml_node;
339 xml_attribute_struct* _attr;
341 typedef void (*unspecified_bool_type)(xml_attribute***);
348 explicit xml_attribute(xml_attribute_struct* attr);
351 operator unspecified_bool_type()
const;
375 int as_int(
int def = 0)
const;
376 unsigned int as_uint(
unsigned int def = 0)
const;
377 double as_double(
double def = 0)
const;
378 float as_float(
float def = 0)
const;
380 #ifdef PUGIXML_HAS_LONG_LONG
381 long long as_llong(
long long def = 0)
const;
382 unsigned long long as_ullong(
unsigned long long def = 0)
const;
386 bool as_bool(
bool def =
false)
const;
389 bool set_name(
const char_t* rhs);
390 bool set_value(
const char_t* rhs);
393 bool set_value(
int rhs);
394 bool set_value(
unsigned int rhs);
395 bool set_value(
long rhs);
396 bool set_value(
unsigned long rhs);
397 bool set_value(
double rhs);
398 bool set_value(
float rhs);
399 bool set_value(
bool rhs);
401 #ifdef PUGIXML_HAS_LONG_LONG
402 bool set_value(
long long rhs);
403 bool set_value(
unsigned long long rhs);
409 xml_attribute&
operator=(
unsigned int rhs);
411 xml_attribute&
operator=(
unsigned long rhs);
416 #ifdef PUGIXML_HAS_LONG_LONG
418 xml_attribute&
operator=(
unsigned long long rhs);
422 xml_attribute next_attribute()
const;
423 xml_attribute previous_attribute()
const;
429 xml_attribute_struct* internal_object()
const;
441 friend class xml_attribute_iterator;
442 friend class xml_node_iterator;
443 friend class xml_named_node_iterator;
446 xml_node_struct* _root;
458 operator unspecified_bool_type()
const;
515 const char_t* child_value()
const;
521 bool set_name(
const char_t* rhs);
522 bool set_value(
const char_t* rhs);
606 if (pred(cur))
return cur;
625 #ifndef PUGIXML_NO_STL
636 #ifndef PUGIXML_NO_XPATH
654 #ifndef PUGIXML_NO_STL
678 ptrdiff_t offset_debug()
const;
712 operator unspecified_bool_type()
const;
721 const char_t*
get()
const;
727 int as_int(
int def = 0)
const;
728 unsigned int as_uint(
unsigned int def = 0)
const;
729 double as_double(
double def = 0)
const;
730 float as_float(
float def = 0)
const;
732 #ifdef PUGIXML_HAS_LONG_LONG
733 long long as_llong(
long long def = 0)
const;
734 unsigned long long as_ullong(
unsigned long long def = 0)
const;
738 bool as_bool(
bool def =
false)
const;
741 bool set(
const char_t* rhs);
745 bool set(
unsigned int rhs);
747 bool set(
unsigned long rhs);
748 bool set(
double rhs);
752 #ifdef PUGIXML_HAS_LONG_LONG
753 bool set(
long long rhs);
754 bool set(
unsigned long long rhs);
767 #ifdef PUGIXML_HAS_LONG_LONG
785 friend class xml_node;
788 mutable xml_node _wrap;
791 xml_node_iterator(xml_node_struct*
ref, xml_node_struct* parent);
800 #ifndef PUGIXML_NO_STL
842 #ifndef PUGIXML_NO_STL
878 #ifndef PUGIXML_NO_STL
929 virtual bool for_each(
xml_node& node) = 0;
978 operator bool()
const;
981 const char* description()
const;
993 xml_document(
const xml_document&);
994 xml_document&
operator=(
const xml_document&);
1010 void reset(
const xml_document& proto);
1012 #ifndef PUGIXML_NO_STL
1015 xml_parse_result load(std::basic_istream<
wchar_t, std::char_traits<wchar_t> >&
stream,
unsigned int options =
parse_default);
1022 xml_parse_result load_string(
const char_t* contents,
unsigned int options =
parse_default);
1042 #ifndef PUGIXML_NO_STL
1053 xml_node document_element()
const;
1056 #ifndef PUGIXML_NO_XPATH
1077 xpath_parse_result();
1080 operator bool()
const;
1083 const char* description()
const;
1089 friend class xpath_variable_set;
1093 xpath_variable* _next;
1098 xpath_variable(
const xpath_variable&);
1099 xpath_variable&
operator=(
const xpath_variable&);
1109 bool get_boolean()
const;
1110 double get_number()
const;
1111 const char_t* get_string()
const;
1112 const xpath_node_set& get_node_set()
const;
1115 bool set(
bool value);
1116 bool set(
double value);
1118 bool set(
const xpath_node_set&
value);
1125 xpath_variable* _data[64];
1127 void _assign(
const xpath_variable_set& rhs);
1128 void _swap(xpath_variable_set& rhs);
1130 xpath_variable* _find(
const char_t*
name)
const;
1132 static bool _clone(xpath_variable* var, xpath_variable** out_result);
1133 static void _destroy(xpath_variable* var);
1137 xpath_variable_set();
1138 ~xpath_variable_set();
1141 xpath_variable_set(
const xpath_variable_set& rhs);
1142 xpath_variable_set&
operator=(
const xpath_variable_set& rhs);
1144 #ifdef PUGIXML_HAS_MOVE
1146 xpath_variable_set(xpath_variable_set&& rhs);
1147 xpath_variable_set&
operator=(xpath_variable_set&& rhs);
1161 const xpath_variable*
get(
const char_t*
name)
const;
1169 xpath_parse_result _result;
1171 typedef void (*unspecified_bool_type)(xpath_query***);
1174 xpath_query(
const xpath_query&);
1175 xpath_query&
operator=(
const xpath_query&);
1180 explicit xpath_query(
const char_t*
query, xpath_variable_set* variables = 0);
1188 #ifdef PUGIXML_HAS_MOVE
1190 xpath_query(xpath_query&& rhs);
1191 xpath_query&
operator=(xpath_query&& rhs);
1199 bool evaluate_boolean(
const xpath_node&
n)
const;
1203 double evaluate_number(
const xpath_node&
n)
const;
1205 #ifndef PUGIXML_NO_STL
1208 string_t evaluate_string(
const xpath_node&
n)
const;
1215 size_t evaluate_string(
char_t*
buffer,
size_t capacity,
const xpath_node&
n)
const;
1220 xpath_node_set evaluate_node_set(
const xpath_node&
n)
const;
1226 xpath_node evaluate_node(
const xpath_node&
n)
const;
1229 const xpath_parse_result&
result()
const;
1232 operator unspecified_bool_type()
const;
1238 #ifndef PUGIXML_NO_EXCEPTIONS
1243 xpath_parse_result _result;
1247 explicit xpath_exception(
const xpath_parse_result&
result);
1253 const xpath_parse_result&
result() const;
1262 xml_attribute _attribute;
1264 typedef void (*unspecified_bool_type)(xpath_node***);
1271 xpath_node(
const xml_node& node);
1272 xpath_node(
const xml_attribute&
attribute,
const xml_node& parent);
1275 xml_node node()
const;
1279 xml_node parent()
const;
1282 operator unspecified_bool_type()
const;
1329 #ifdef PUGIXML_HAS_MOVE
1339 size_t size()
const;
1370 #ifndef PUGIXML_NO_STL
1381 typedef void* (*allocation_function)(
size_t size);
1395 #if !defined(PUGIXML_NO_STL) && (defined(_MSC_VER) || defined(__ICC))
1405 #if !defined(PUGIXML_NO_STL) && defined(__SUNPRO_CC)
1419 #if defined(PUGIXML_HEADER_ONLY) && !defined(PUGIXML_SOURCE)
1420 # define PUGIXML_SOURCE "pugixml.cpp"
1421 # include PUGIXML_SOURCE
xml_node_iterator iterator
OCIOEXPORT ConstColorSpaceSetRcPtr operator&&(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)
Perform the intersection of two sets.
std::bidirectional_iterator_tag iterator_category
ptrdiff_t difference_type
xml_attribute find_attribute(Predicate pred) const
xml_object_range(It b, It e)
void append_attribute(xml_attribute_struct *attr, xml_node_struct *node)
void remove_attribute(xml_attribute_struct *attr, xml_node_struct *node)
GLsizei const GLfloat * value
xml_node find_child(Predicate pred) const
GLsizei const GLchar *const * path
std::bidirectional_iterator_tag iterator_category
GLboolean GLboolean GLboolean GLboolean a
xml_node first_child() const
void reverse(I begin, I end)
void insert_attribute_before(xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node)
xml_attribute next_attribute() const
**But if you need a result
OIIO_FORCEINLINE vbool4 operator>=(const vint4 &a, const vint4 &b)
xml_attribute & reference
ptrdiff_t difference_type
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
OIIO_FORCEINLINE vbool4 operator>(const vint4 &a, const vint4 &b)
OIIO_FORCEINLINE vbool4 operator<=(const vint4 &a, const vint4 &b)
OCIOEXPORT ConstColorSpaceSetRcPtr operator||(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)
Perform the union of two sets.
std::bidirectional_iterator_tag iterator_category
const xpath_node * iterator
xml_node next_sibling() const
bool operator<(const GU_TetrahedronFacet &a, const GU_TetrahedronFacet &b)
IMATH_HOSTDEVICE constexpr Color4< T > operator*(S a, const Color4< T > &v) IMATH_NOEXCEPT
Reverse multiplication: S * Color4.
xml_node find_node(Predicate pred) const
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
void insert_attribute_after(xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node)
ptrdiff_t difference_type
GLint GLint GLsizei GLsizei GLsizei depth
Usd_Term operator!(Usd_PrimFlags flag)
xml_attribute_iterator attribute_iterator
LeafData & operator=(const LeafData &)=delete
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
GU_API ComputeHierarchyResult traverse(const GU_Detail *gdp, GA_OffsetArray &roots, GA_OffsetArray &nodes, GA_OffsetArray &parents, UT_Map< GA_Offset, GA_OffsetArray > *children=nullptr)
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
#define OIIO_NAMESPACE_END
void prepend_attribute(xml_attribute_struct *attr, xml_node_struct *node)
const xpath_node * const_iterator
void write(T &out, bool v)
size_t hash_value(const CH_ChannelRef &ref)
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
void sort(I begin, I end, const Pred &pred)
#define OIIO_NAMESPACE_BEGIN
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.