|
@@ -1,7 +1,7 @@
|
|
/**
|
|
/**
|
|
- * pugixml parser - version 1.13
|
|
|
|
|
|
+ * pugixml parser - version 1.15
|
|
* --------------------------------------------------------
|
|
* --------------------------------------------------------
|
|
- * Copyright (c) 2006-2024, by Arseny Kapoulkine ([email protected])
|
|
|
|
|
|
+ * Copyright (C) 2006-2025, by Arseny Kapoulkine ([email protected])
|
|
* Report bugs and download new versions at https://pugixml.org/
|
|
* Report bugs and download new versions at https://pugixml.org/
|
|
*
|
|
*
|
|
* This library is distributed under the MIT License. See notice at the end
|
|
* This library is distributed under the MIT License. See notice at the end
|
|
@@ -14,7 +14,7 @@
|
|
// Define version macro; evaluates to major * 1000 + minor * 10 + patch so that it's safe to use in less-than comparisons
|
|
// Define version macro; evaluates to major * 1000 + minor * 10 + patch so that it's safe to use in less-than comparisons
|
|
// Note: pugixml used major * 100 + minor * 10 + patch format up until 1.9 (which had version identifier 190); starting from pugixml 1.10, the minor version number is two digits
|
|
// Note: pugixml used major * 100 + minor * 10 + patch format up until 1.9 (which had version identifier 190); starting from pugixml 1.10, the minor version number is two digits
|
|
#ifndef PUGIXML_VERSION
|
|
#ifndef PUGIXML_VERSION
|
|
-# define PUGIXML_VERSION 1130 // 1.13
|
|
|
|
|
|
+# define PUGIXML_VERSION 1150 // 1.15
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// Include user configuration file (this can define various configuration macros)
|
|
// Include user configuration file (this can define various configuration macros)
|
|
@@ -38,6 +38,20 @@
|
|
# include <string>
|
|
# include <string>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+// Check if std::string_view is available
|
|
|
|
+#if !defined(PUGIXML_HAS_STRING_VIEW) && !defined(PUGIXML_NO_STL)
|
|
|
|
+# if __cplusplus >= 201703L
|
|
|
|
+# define PUGIXML_HAS_STRING_VIEW
|
|
|
|
+# elif defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
|
|
|
|
+# define PUGIXML_HAS_STRING_VIEW
|
|
|
|
+# endif
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+// Include string_view if appropriate
|
|
|
|
+#ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+# include <string_view>
|
|
|
|
+#endif
|
|
|
|
+
|
|
// Macro for deprecated features
|
|
// Macro for deprecated features
|
|
#ifndef PUGIXML_DEPRECATED
|
|
#ifndef PUGIXML_DEPRECATED
|
|
# if defined(__GNUC__)
|
|
# if defined(__GNUC__)
|
|
@@ -82,14 +96,14 @@
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-// If C++ is 2011 or higher, add 'noexcept' specifiers
|
|
|
|
|
|
+// If C++ is 2011 or higher, use 'noexcept' specifiers
|
|
#ifndef PUGIXML_NOEXCEPT
|
|
#ifndef PUGIXML_NOEXCEPT
|
|
# if __cplusplus >= 201103
|
|
# if __cplusplus >= 201103
|
|
# define PUGIXML_NOEXCEPT noexcept
|
|
# define PUGIXML_NOEXCEPT noexcept
|
|
# elif defined(_MSC_VER) && _MSC_VER >= 1900
|
|
# elif defined(_MSC_VER) && _MSC_VER >= 1900
|
|
# define PUGIXML_NOEXCEPT noexcept
|
|
# define PUGIXML_NOEXCEPT noexcept
|
|
# else
|
|
# else
|
|
-# define PUGIXML_NOEXCEPT
|
|
|
|
|
|
+# define PUGIXML_NOEXCEPT throw()
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -138,7 +152,12 @@ namespace pugi
|
|
|
|
|
|
#ifndef PUGIXML_NO_STL
|
|
#ifndef PUGIXML_NO_STL
|
|
// String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE
|
|
// String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE
|
|
- typedef std::basic_string<PUGIXML_CHAR, std::char_traits<PUGIXML_CHAR>, std::allocator<PUGIXML_CHAR> > string_t;
|
|
|
|
|
|
+ typedef std::basic_string<PUGIXML_CHAR> string_t;
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ // String view type used for operations that can work with a length delimited string; depends on PUGIXML_WCHAR_MODE
|
|
|
|
+ typedef std::basic_string_view<PUGIXML_CHAR> string_view_t;
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
@@ -213,6 +232,10 @@ namespace pugi
|
|
// This flag is off by default.
|
|
// This flag is off by default.
|
|
const unsigned int parse_embed_pcdata = 0x2000;
|
|
const unsigned int parse_embed_pcdata = 0x2000;
|
|
|
|
|
|
|
|
+ // This flag determines whether determines whether the the two pcdata should be merged or not, if no intermediatory data are parsed in the document.
|
|
|
|
+ // This flag is off by default.
|
|
|
|
+ const unsigned int parse_merge_pcdata = 0x4000;
|
|
|
|
+
|
|
// The default parsing mode.
|
|
// The default parsing mode.
|
|
// Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
|
|
// Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
|
|
// End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
|
|
// End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
|
|
@@ -324,7 +347,7 @@ namespace pugi
|
|
class PUGIXML_CLASS xml_writer
|
|
class PUGIXML_CLASS xml_writer
|
|
{
|
|
{
|
|
public:
|
|
public:
|
|
- virtual ~xml_writer() {}
|
|
|
|
|
|
+ virtual ~xml_writer();
|
|
|
|
|
|
// Write memory chunk into stream/file/whatever
|
|
// Write memory chunk into stream/file/whatever
|
|
virtual void write(const void* data, size_t size) = 0;
|
|
virtual void write(const void* data, size_t size) = 0;
|
|
@@ -349,14 +372,14 @@ namespace pugi
|
|
{
|
|
{
|
|
public:
|
|
public:
|
|
// Construct writer from an output stream object
|
|
// Construct writer from an output stream object
|
|
- xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream);
|
|
|
|
- xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream);
|
|
|
|
|
|
+ xml_writer_stream(std::basic_ostream<char>& stream);
|
|
|
|
+ xml_writer_stream(std::basic_ostream<wchar_t>& stream);
|
|
|
|
|
|
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
|
|
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
|
|
|
|
|
|
private:
|
|
private:
|
|
- std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
|
|
|
|
- std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream;
|
|
|
|
|
|
+ std::basic_ostream<char>* narrow_stream;
|
|
|
|
+ std::basic_ostream<wchar_t>* wide_stream;
|
|
};
|
|
};
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -392,7 +415,7 @@ namespace pugi
|
|
bool operator<=(const xml_attribute& r) const;
|
|
bool operator<=(const xml_attribute& r) const;
|
|
bool operator>=(const xml_attribute& r) const;
|
|
bool operator>=(const xml_attribute& r) const;
|
|
|
|
|
|
- // Check if attribute is empty
|
|
|
|
|
|
+ // Check if attribute is empty (null)
|
|
bool empty() const;
|
|
bool empty() const;
|
|
|
|
|
|
// Get attribute name/value, or "" if attribute is empty
|
|
// Get attribute name/value, or "" if attribute is empty
|
|
@@ -418,8 +441,15 @@ namespace pugi
|
|
|
|
|
|
// Set attribute name/value (returns false if attribute is empty or there is not enough memory)
|
|
// Set attribute name/value (returns false if attribute is empty or there is not enough memory)
|
|
bool set_name(const char_t* rhs);
|
|
bool set_name(const char_t* rhs);
|
|
- bool set_value(const char_t* rhs, size_t sz);
|
|
|
|
|
|
+ bool set_name(const char_t* rhs, size_t size);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ bool set_name(string_view_t rhs);
|
|
|
|
+ #endif
|
|
bool set_value(const char_t* rhs);
|
|
bool set_value(const char_t* rhs);
|
|
|
|
+ bool set_value(const char_t* rhs, size_t size);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ bool set_value(string_view_t rhs);
|
|
|
|
+ #endif
|
|
|
|
|
|
// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
|
|
// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
|
|
bool set_value(int rhs);
|
|
bool set_value(int rhs);
|
|
@@ -447,6 +477,10 @@ namespace pugi
|
|
xml_attribute& operator=(float rhs);
|
|
xml_attribute& operator=(float rhs);
|
|
xml_attribute& operator=(bool rhs);
|
|
xml_attribute& operator=(bool rhs);
|
|
|
|
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ xml_attribute& operator=(string_view_t rhs);
|
|
|
|
+ #endif
|
|
|
|
+
|
|
#ifdef PUGIXML_HAS_LONG_LONG
|
|
#ifdef PUGIXML_HAS_LONG_LONG
|
|
xml_attribute& operator=(long long rhs);
|
|
xml_attribute& operator=(long long rhs);
|
|
xml_attribute& operator=(unsigned long long rhs);
|
|
xml_attribute& operator=(unsigned long long rhs);
|
|
@@ -502,7 +536,7 @@ namespace pugi
|
|
bool operator<=(const xml_node& r) const;
|
|
bool operator<=(const xml_node& r) const;
|
|
bool operator>=(const xml_node& r) const;
|
|
bool operator>=(const xml_node& r) const;
|
|
|
|
|
|
- // Check if node is empty.
|
|
|
|
|
|
+ // Check if node is empty (null)
|
|
bool empty() const;
|
|
bool empty() const;
|
|
|
|
|
|
// Get node type
|
|
// Get node type
|
|
@@ -541,9 +575,18 @@ namespace pugi
|
|
xml_attribute attribute(const char_t* name) const;
|
|
xml_attribute attribute(const char_t* name) const;
|
|
xml_node next_sibling(const char_t* name) const;
|
|
xml_node next_sibling(const char_t* name) const;
|
|
xml_node previous_sibling(const char_t* name) const;
|
|
xml_node previous_sibling(const char_t* name) const;
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ xml_node child(string_view_t name) const;
|
|
|
|
+ xml_attribute attribute(string_view_t name) const;
|
|
|
|
+ xml_node next_sibling(string_view_t name) const;
|
|
|
|
+ xml_node previous_sibling(string_view_t name) const;
|
|
|
|
+ #endif
|
|
|
|
|
|
// Get attribute, starting the search from a hint (and updating hint so that searching for a sequence of attributes is fast)
|
|
// Get attribute, starting the search from a hint (and updating hint so that searching for a sequence of attributes is fast)
|
|
xml_attribute attribute(const char_t* name, xml_attribute& hint) const;
|
|
xml_attribute attribute(const char_t* name, xml_attribute& hint) const;
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ xml_attribute attribute(string_view_t name, xml_attribute& hint) const;
|
|
|
|
+ #endif
|
|
|
|
|
|
// Get child value of current node; that is, value of the first child node of type PCDATA/CDATA
|
|
// Get child value of current node; that is, value of the first child node of type PCDATA/CDATA
|
|
const char_t* child_value() const;
|
|
const char_t* child_value() const;
|
|
@@ -553,14 +596,27 @@ namespace pugi
|
|
|
|
|
|
// Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
|
|
// Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
|
|
bool set_name(const char_t* rhs);
|
|
bool set_name(const char_t* rhs);
|
|
- bool set_value(const char_t* rhs, size_t sz);
|
|
|
|
|
|
+ bool set_name(const char_t* rhs, size_t size);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ bool set_name(string_view_t rhs);
|
|
|
|
+ #endif
|
|
bool set_value(const char_t* rhs);
|
|
bool set_value(const char_t* rhs);
|
|
|
|
+ bool set_value(const char_t* rhs, size_t size);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ bool set_value(string_view_t rhs);
|
|
|
|
+ #endif
|
|
|
|
|
|
// Add attribute with specified name. Returns added attribute, or empty attribute on errors.
|
|
// Add attribute with specified name. Returns added attribute, or empty attribute on errors.
|
|
xml_attribute append_attribute(const char_t* name);
|
|
xml_attribute append_attribute(const char_t* name);
|
|
xml_attribute prepend_attribute(const char_t* name);
|
|
xml_attribute prepend_attribute(const char_t* name);
|
|
xml_attribute insert_attribute_after(const char_t* name, const xml_attribute& attr);
|
|
xml_attribute insert_attribute_after(const char_t* name, const xml_attribute& attr);
|
|
xml_attribute insert_attribute_before(const char_t* name, const xml_attribute& attr);
|
|
xml_attribute insert_attribute_before(const char_t* name, const xml_attribute& attr);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ xml_attribute append_attribute(string_view_t name);
|
|
|
|
+ xml_attribute prepend_attribute(string_view_t name);
|
|
|
|
+ xml_attribute insert_attribute_after(string_view_t name, const xml_attribute& attr);
|
|
|
|
+ xml_attribute insert_attribute_before(string_view_t name, const xml_attribute& attr);
|
|
|
|
+ #endif
|
|
|
|
|
|
// Add a copy of the specified attribute. Returns added attribute, or empty attribute on errors.
|
|
// Add a copy of the specified attribute. Returns added attribute, or empty attribute on errors.
|
|
xml_attribute append_copy(const xml_attribute& proto);
|
|
xml_attribute append_copy(const xml_attribute& proto);
|
|
@@ -579,6 +635,12 @@ namespace pugi
|
|
xml_node prepend_child(const char_t* name);
|
|
xml_node prepend_child(const char_t* name);
|
|
xml_node insert_child_after(const char_t* name, const xml_node& node);
|
|
xml_node insert_child_after(const char_t* name, const xml_node& node);
|
|
xml_node insert_child_before(const char_t* name, const xml_node& node);
|
|
xml_node insert_child_before(const char_t* name, const xml_node& node);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ xml_node append_child(string_view_t name);
|
|
|
|
+ xml_node prepend_child(string_view_t name);
|
|
|
|
+ xml_node insert_child_after(string_view_t, const xml_node& node);
|
|
|
|
+ xml_node insert_child_before(string_view_t name, const xml_node& node);
|
|
|
|
+ #endif
|
|
|
|
|
|
// Add a copy of the specified node as a child. Returns added node, or empty node on errors.
|
|
// Add a copy of the specified node as a child. Returns added node, or empty node on errors.
|
|
xml_node append_copy(const xml_node& proto);
|
|
xml_node append_copy(const xml_node& proto);
|
|
@@ -595,6 +657,9 @@ namespace pugi
|
|
// Remove specified attribute
|
|
// Remove specified attribute
|
|
bool remove_attribute(const xml_attribute& a);
|
|
bool remove_attribute(const xml_attribute& a);
|
|
bool remove_attribute(const char_t* name);
|
|
bool remove_attribute(const char_t* name);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ bool remove_attribute(string_view_t name);
|
|
|
|
+ #endif
|
|
|
|
|
|
// Remove all attributes
|
|
// Remove all attributes
|
|
bool remove_attributes();
|
|
bool remove_attributes();
|
|
@@ -602,6 +667,9 @@ namespace pugi
|
|
// Remove specified child
|
|
// Remove specified child
|
|
bool remove_child(const xml_node& n);
|
|
bool remove_child(const xml_node& n);
|
|
bool remove_child(const char_t* name);
|
|
bool remove_child(const char_t* name);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ bool remove_child(string_view_t name);
|
|
|
|
+ #endif
|
|
|
|
|
|
// Remove all children
|
|
// Remove all children
|
|
bool remove_children();
|
|
bool remove_children();
|
|
@@ -694,8 +762,8 @@ namespace pugi
|
|
|
|
|
|
#ifndef PUGIXML_NO_STL
|
|
#ifndef PUGIXML_NO_STL
|
|
// Print subtree to stream
|
|
// Print subtree to stream
|
|
- 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;
|
|
|
|
- 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;
|
|
|
|
|
|
+ void print(std::basic_ostream<char>& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
|
|
|
|
+ void print(std::basic_ostream<wchar_t>& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// Child nodes iterators
|
|
// Child nodes iterators
|
|
@@ -712,9 +780,12 @@ namespace pugi
|
|
|
|
|
|
// Range-based for support
|
|
// Range-based for support
|
|
xml_object_range<xml_node_iterator> children() const;
|
|
xml_object_range<xml_node_iterator> children() const;
|
|
- xml_object_range<xml_named_node_iterator> children(const char_t* name) const;
|
|
|
|
xml_object_range<xml_attribute_iterator> attributes() const;
|
|
xml_object_range<xml_attribute_iterator> attributes() const;
|
|
|
|
|
|
|
|
+ // Range-based for support for all children with the specified name
|
|
|
|
+ // Note: name pointer must have a longer lifetime than the returned object; be careful with passing temporaries!
|
|
|
|
+ xml_object_range<xml_named_node_iterator> children(const char_t* name) const;
|
|
|
|
+
|
|
// Get node offset in parsed file/string (in char_t units) for debugging purposes
|
|
// Get node offset in parsed file/string (in char_t units) for debugging purposes
|
|
ptrdiff_t offset_debug() const;
|
|
ptrdiff_t offset_debug() const;
|
|
|
|
|
|
@@ -755,7 +826,7 @@ namespace pugi
|
|
// Borland C++ workaround
|
|
// Borland C++ workaround
|
|
bool operator!() const;
|
|
bool operator!() const;
|
|
|
|
|
|
- // Check if text object is empty
|
|
|
|
|
|
+ // Check if text object is empty (null)
|
|
bool empty() const;
|
|
bool empty() const;
|
|
|
|
|
|
// Get text, or "" if object is empty
|
|
// Get text, or "" if object is empty
|
|
@@ -779,8 +850,11 @@ namespace pugi
|
|
bool as_bool(bool def = false) const;
|
|
bool as_bool(bool def = false) const;
|
|
|
|
|
|
// Set text (returns false if object is empty or there is not enough memory)
|
|
// Set text (returns false if object is empty or there is not enough memory)
|
|
- bool set(const char_t* rhs, size_t sz);
|
|
|
|
bool set(const char_t* rhs);
|
|
bool set(const char_t* rhs);
|
|
|
|
+ bool set(const char_t* rhs, size_t size);
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ bool set(string_view_t rhs);
|
|
|
|
+ #endif
|
|
|
|
|
|
// Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
|
|
// Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
|
|
bool set(int rhs);
|
|
bool set(int rhs);
|
|
@@ -808,6 +882,10 @@ namespace pugi
|
|
xml_text& operator=(float rhs);
|
|
xml_text& operator=(float rhs);
|
|
xml_text& operator=(bool rhs);
|
|
xml_text& operator=(bool rhs);
|
|
|
|
|
|
|
|
+ #ifdef PUGIXML_HAS_STRING_VIEW
|
|
|
|
+ xml_text& operator=(string_view_t rhs);
|
|
|
|
+ #endif
|
|
|
|
+
|
|
#ifdef PUGIXML_HAS_LONG_LONG
|
|
#ifdef PUGIXML_HAS_LONG_LONG
|
|
xml_text& operator=(long long rhs);
|
|
xml_text& operator=(long long rhs);
|
|
xml_text& operator=(unsigned long long rhs);
|
|
xml_text& operator=(unsigned long long rhs);
|
|
@@ -927,6 +1005,7 @@ namespace pugi
|
|
xml_named_node_iterator();
|
|
xml_named_node_iterator();
|
|
|
|
|
|
// Construct an iterator which points to the specified node
|
|
// Construct an iterator which points to the specified node
|
|
|
|
+ // Note: name pointer is stored in the iterator and must have a longer lifetime than iterator itself
|
|
xml_named_node_iterator(const xml_node& node, const char_t* name);
|
|
xml_named_node_iterator(const xml_node& node, const char_t* name);
|
|
|
|
|
|
// Iterator operators
|
|
// Iterator operators
|
|
@@ -1062,8 +1141,8 @@ namespace pugi
|
|
|
|
|
|
#ifndef PUGIXML_NO_STL
|
|
#ifndef PUGIXML_NO_STL
|
|
// Load document from stream.
|
|
// Load document from stream.
|
|
- xml_parse_result load(std::basic_istream<char, std::char_traits<char> >& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
|
|
|
|
- xml_parse_result load(std::basic_istream<wchar_t, std::char_traits<wchar_t> >& stream, unsigned int options = parse_default);
|
|
|
|
|
|
+ xml_parse_result load(std::basic_istream<char>& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
|
|
|
|
+ xml_parse_result load(std::basic_istream<wchar_t>& stream, unsigned int options = parse_default);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied.
|
|
// (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied.
|
|
@@ -1092,8 +1171,8 @@ namespace pugi
|
|
|
|
|
|
#ifndef PUGIXML_NO_STL
|
|
#ifndef PUGIXML_NO_STL
|
|
// Save XML document to stream (semantics is slightly different from xml_node::print, see documentation for details).
|
|
// Save XML document to stream (semantics is slightly different from xml_node::print, see documentation for details).
|
|
- 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;
|
|
|
|
- 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;
|
|
|
|
|
|
+ void save(std::basic_ostream<char>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
|
|
|
|
+ void save(std::basic_ostream<wchar_t>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// Save XML to file
|
|
// Save XML to file
|
|
@@ -1304,7 +1383,7 @@ namespace pugi
|
|
explicit xpath_exception(const xpath_parse_result& result);
|
|
explicit xpath_exception(const xpath_parse_result& result);
|
|
|
|
|
|
// Get error message
|
|
// Get error message
|
|
- virtual const char* what() const throw() PUGIXML_OVERRIDE;
|
|
|
|
|
|
+ virtual const char* what() const PUGIXML_NOEXCEPT PUGIXML_OVERRIDE;
|
|
|
|
|
|
// Get parse result
|
|
// Get parse result
|
|
const xpath_parse_result& result() const;
|
|
const xpath_parse_result& result() const;
|
|
@@ -1429,12 +1508,12 @@ namespace pugi
|
|
|
|
|
|
#ifndef PUGIXML_NO_STL
|
|
#ifndef PUGIXML_NO_STL
|
|
// Convert wide string to UTF8
|
|
// Convert wide string to UTF8
|
|
- std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str);
|
|
|
|
- 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);
|
|
|
|
|
|
+ std::basic_string<char> PUGIXML_FUNCTION as_utf8(const wchar_t* str);
|
|
|
|
+ std::basic_string<char> PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t>& str);
|
|
|
|
|
|
// Convert UTF8 to wide string
|
|
// Convert UTF8 to wide string
|
|
- std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
|
|
|
|
- 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);
|
|
|
|
|
|
+ std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const char* str);
|
|
|
|
+ std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const std::basic_string<char>& str);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// Memory allocation function interface; returns pointer to allocated memory or NULL on failure
|
|
// Memory allocation function interface; returns pointer to allocated memory or NULL on failure
|
|
@@ -1481,7 +1560,7 @@ namespace std
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Copyright (c) 2006-2024 Arseny Kapoulkine
|
|
|
|
|
|
+ * Copyright (c) 2006-2025 Arseny Kapoulkine
|
|
*
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person
|
|
* Permission is hereby granted, free of charge, to any person
|
|
* obtaining a copy of this software and associated documentation
|
|
* obtaining a copy of this software and associated documentation
|