From 314baf6605143f1e837209008f490e8559529e1c Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 8 Feb 2022 20:09:10 -0800 Subject: [PATCH] docs: Regenerate HTML documentation --- docs/manual.html | 2284 ++++++++++++++++++++++-------------------- docs/quickstart.html | 545 +++++----- 2 files changed, 1441 insertions(+), 1388 deletions(-) diff --git a/docs/manual.html b/docs/manual.html index 0cec8773..6457a9a6 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -4,26 +4,24 @@ - + -pugixml 1.11 manual +pugixml 1.12 manual +
-

pugixml-1.11.zip (Windows line endings) +

pugixml-1.12.zip (Windows line endings) / -pugixml-1.11.tar.gz (Unix line endings)

+pugixml-1.12.tar.gz (Unix line endings)

The distribution contains library source, documentation (the manual you’re reading now and the quick start guide) and some code examples. After downloading the distribution, install pugixml by extracting all files from the compressed archive.

@@ -709,7 +781,7 @@

<
git clone https://github.com/zeux/pugixml
 cd pugixml
-git checkout v1.11
+git checkout v1.12

@@ -726,7 +798,7 @@

-
svn checkout https://github.com/zeux/pugixml/tags/v1.11 pugixml
+
svn checkout https://github.com/zeux/pugixml/tags/v1.12 pugixml

@@ -774,7 +846,7 @@

-
pugixml.cpp(3477) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
+
pugixml.cpp(3477) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
@@ -908,7 +980,7 @@

#ifndef _DEBUG
-    #define PUGIXML_HEADER_ONLY
+    #define PUGIXML_HEADER_ONLY
 #endif
@@ -999,7 +1071,7 @@

node_element) - this is the most common type of node, which represents XML elements. Element nodes have a name, a collection of attributes and a collection of child nodes (both of which may be empty). The attribute is a simple name/value pair. The example XML representation of element nodes is as follows:

-
<node attr="value"><child/></node>
+
<node attr="value"><child/></node>
@@ -1010,7 +1082,7 @@

node_pcdata) represent plain text in XML. PCDATA nodes have a value, but do not have a name or children/attributes. Note that plain character data is not a part of the element node but instead has its own node; an element node can have several child PCDATA nodes. The example XML representation of text nodes is as follows:

-
<node> text1 <child/> text2 </node>
+
<node> text1 <child/> text2 </node>
@@ -1021,7 +1093,7 @@

node_cdata) represent text in XML that is quoted in a special way. CDATA nodes do not differ from PCDATA nodes except in XML representation - the above text example looks like this with CDATA:

-
<node> <![CDATA[text1]]> <child/> <![CDATA[text2]]> </node>
+
<node> <![CDATA[text1]]> <child/> <![CDATA[text2]]> </node>
@@ -1032,7 +1104,7 @@

node_comment) represent comments in XML. Comment nodes have a value, but do not have a name or children/attributes. The example XML representation of a comment node is as follows:

-
<!-- comment text -->
+
<!-- comment text -->
@@ -1043,7 +1115,7 @@

node_pi) represent processing instructions (PI) in XML. PI nodes have a name and an optional value, but do not have children/attributes. The example XML representation of a PI node is as follows:

-
<?name value?>
+
<?name value?>
@@ -1054,7 +1126,7 @@

node_declaration) represents document declarations in XML. Declaration nodes have a name ("xml") and an optional collection of attributes, but do not have value or children. There can be only one declaration node in a document; moreover, it should be the topmost node (its parent should be the document). The example XML representation of a declaration node is as follows:

-
<?xml version="1.0"?>
+
<?xml version="1.0"?>
@@ -1065,7 +1137,7 @@

node_doctype) represents document type declarations in XML. Document type declaration nodes have a value, which corresponds to the entire document type contents; no additional nodes are created for inner elements like <!ENTITY>. There can be only one document type declaration node in a document; moreover, it should be the topmost node (its parent should be the document). The example XML representation of a document type declaration node is as follows:

-
<!DOCTYPE greeting [ <!ELEMENT greeting (#PCDATA)> ]>
+
<!DOCTYPE greeting [ <!ELEMENT greeting (#PCDATA)> ]>
@@ -1204,8 +1276,8 @@

-
const char* xml_node::name() const;
-bool xml_node::set_name(const char* value);
+
const char* xml_node::name() const;
+bool xml_node::set_name(const char* value);
@@ -1213,8 +1285,8 @@

-
const wchar_t* xml_node::name() const;
-bool xml_node::set_name(const wchar_t* value);
+
const wchar_t* xml_node::name() const;
+bool xml_node::set_name(const wchar_t* value);
@@ -1230,8 +1302,8 @@

-
std::string as_utf8(const wchar_t* str);
-std::wstring as_wide(const char* str);
+
std::string as_utf8(const wchar_t* str);
+std::wstring as_wide(const char* str);
@@ -1239,8 +1311,8 @@

-
std::string as_utf8(const std::wstring& str);
-std::wstring as_wide(const std::string& str);
+
std::string as_utf8(const std::wstring& str);
+std::wstring as_wide(const std::string& str);
@@ -1317,8 +1389,8 @@

-
typedef void* (*allocation_function)(size_t size);
-typedef void (*deallocation_function)(void* ptr);
+
typedef void* (*allocation_function)(size_t size);
+typedef void (*deallocation_function)(void* ptr);
@@ -1327,9 +1399,9 @@

-
void set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
-allocation_function get_memory_allocation_function();
-deallocation_function get_memory_deallocation_function();
+
void set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
+allocation_function get_memory_allocation_function();
+deallocation_function get_memory_deallocation_function();
@@ -1343,20 +1415,20 @@

-
void* custom_allocate(size_t size)
-{
-    return new (std::nothrow) char[size];
-}
+
void* custom_allocate(size_t size)
+{
+    return new (std::nothrow) char[size];
+}
 
-void custom_deallocate(void* ptr)
-{
-    delete[] static_cast<char*>(ptr);
-}
+void custom_deallocate(void* ptr) +{ + delete[] static_cast<char*>(ptr); +}
-
pugi::set_memory_management_functions(custom_allocate, custom_deallocate);
+
pugi::set_memory_management_functions(custom_allocate, custom_deallocate);
@@ -1432,8 +1504,8 @@

-
xml_parse_result xml_document::load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-xml_parse_result xml_document::load_file(const wchar_t* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+
xml_parse_result xml_document::load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+xml_parse_result xml_document::load_file(const wchar_t* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
@@ -1466,9 +1538,9 @@

-
xml_parse_result xml_document::load_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-xml_parse_result xml_document::load_buffer_inplace(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-xml_parse_result xml_document::load_buffer_inplace_own(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+
xml_parse_result xml_document::load_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+xml_parse_result xml_document::load_buffer_inplace(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+xml_parse_result xml_document::load_buffer_inplace_own(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);

// You can use load_buffer to load document from immutable memory block:
-pugi::xml_parse_result result = doc.load_buffer(source, size);
+pugi::xml_parse_result result = doc.load_buffer(source, size);
// You can use load_buffer_inplace to load document from mutable memory block; the block's lifetime must exceed that of document
-char* buffer = new char[size];
-memcpy(buffer, source, size);
+char* buffer = new char[size];
+memcpy(buffer, source, size);
 
 // The block can be allocated by any method; the block is modified during parsing
-pugi::xml_parse_result result = doc.load_buffer_inplace(buffer, size);
+pugi::xml_parse_result result = doc.load_buffer_inplace(buffer, size);
 
 // You have to destroy the block yourself after the document is no longer used
-delete[] buffer;
+delete[] buffer;
// You can use load_buffer_inplace_own to load document from mutable memory block and to pass the ownership of this block
 // The block has to be allocated via pugixml allocation function - using i.e. operator new here is incorrect
-char* buffer = static_cast<char*>(pugi::get_memory_allocation_function()(size));
-memcpy(buffer, source, size);
+char* buffer = static_cast<char*>(pugi::get_memory_allocation_function()(size));
+memcpy(buffer, source, size);
 
 // The block will be deleted by the document
-pugi::xml_parse_result result = doc.load_buffer_inplace_own(buffer, size);
+pugi::xml_parse_result result = doc.load_buffer_inplace_own(buffer, size);
// You can use load to load document from null-terminated strings, for example literals:
-pugi::xml_parse_result result = doc.load_string("<mesh name='sphere'><bounds>0 0 1 1</bounds></mesh>");
+pugi::xml_parse_result result = doc.load_string("<mesh name='sphere'><bounds>0 0 1 1</bounds></mesh>");

@@ -1544,8 +1616,8 @@

-
xml_parse_result xml_document::load(std::istream& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-xml_parse_result xml_document::load(std::wistream& stream, unsigned int options = parse_default);
+
xml_parse_result xml_document::load(std::istream& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+xml_parse_result xml_document::load(std::wistream& stream, unsigned int options = parse_default);

@@ -1571,15 +1643,15 @@

-
struct xml_parse_result
-{
-    xml_parse_status status;
-    ptrdiff_t offset;
-    xml_encoding encoding;
+
struct xml_parse_result
+{
+    xml_parse_status status;
+    ptrdiff_t offset;
+    xml_encoding encoding;
 
-    operator bool() const;
-    const char* description() const;
-};
+ operator bool() const; + const char* description() const; +};

@@ -1796,23 +1868,23 @@

-
const char* source = "<!--comment--><node>&lt;</node>";
+
const char* source = "<!--comment--><node>&lt;</node>";
 
 // Parsing with default options; note that comment node is not added to the tree, and entity reference &lt; is expanded
-doc.load_string(source);
-std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";
+doc.load_string(source);
+std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";
 
 // Parsing with additional parse_comments option; comment node is now added to the tree
-doc.load_string(source, pugi::parse_default | pugi::parse_comments);
-std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";
+doc.load_string(source, pugi::parse_default | pugi::parse_comments);
+std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";
 
 // Parsing with additional parse_comments option and without the (default) parse_escapes option; &lt; is not expanded
-doc.load_string(source, (pugi::parse_default | pugi::parse_comments) & ~pugi::parse_escapes);
-std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";
+doc.load_string(source, (pugi::parse_default | pugi::parse_comments) & ~pugi::parse_escapes);
+std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";
 
 // Parsing with minimal option mask; comment node is not added to the tree, and &lt; is not expanded
-doc.load_string(source, pugi::parse_minimal);
-std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";
+doc.load_string(source, pugi::parse_minimal); +std::cout << "First node value: [" << doc.first_child().value() << "], node child value: [" << doc.child_value("node") << "]\n";

@@ -1930,16 +2002,16 @@

-
xml_node xml_node::parent() const;
-xml_node xml_node::first_child() const;
-xml_node xml_node::last_child() const;
-xml_node xml_node::next_sibling() const;
-xml_node xml_node::previous_sibling() const;
+
xml_node xml_node::parent() const;
+xml_node xml_node::first_child() const;
+xml_node xml_node::last_child() const;
+xml_node xml_node::next_sibling() const;
+xml_node xml_node::previous_sibling() const;
 
-xml_attribute xml_node::first_attribute() const;
-xml_attribute xml_node::last_attribute() const;
-xml_attribute xml_attribute::next_attribute() const;
-xml_attribute xml_attribute::previous_attribute() const;
+xml_attribute xml_node::first_attribute() const; +xml_attribute xml_node::last_attribute() const; +xml_attribute xml_attribute::next_attribute() const; +xml_attribute xml_attribute::previous_attribute() const;
@@ -1987,8 +2059,8 @@

-
const char_t* xml_node::name() const;
-const char_t* xml_node::value() const;
+
const char_t* xml_node::name() const;
+const char_t* xml_node::value() const;
@@ -1999,9 +2071,9 @@

-
const char_t* xml_node::child_value() const;
-const char_t* xml_node::child_value(const char_t* name) const;
-xml_text xml_node::text() const;
+
const char_t* xml_node::child_value() const;
+const char_t* xml_node::child_value(const char_t* name) const;
+xml_text xml_node::text() const;
@@ -2022,8 +2094,8 @@

-
const char_t* xml_attribute::name() const;
-const char_t* xml_attribute::value() const;
+
const char_t* xml_attribute::name() const;
+const char_t* xml_attribute::value() const;
@@ -2034,7 +2106,7 @@

-
const char_t* xml_attribute::as_string(const char_t* def = "") const;
+
const char_t* xml_attribute::as_string(const char_t* def = "") const;
@@ -2046,13 +2118,13 @@

-
int xml_attribute::as_int(int def = 0) const;
-unsigned int xml_attribute::as_uint(unsigned int def = 0) const;
-double xml_attribute::as_double(double def = 0) const;
-float xml_attribute::as_float(float def = 0) const;
-bool xml_attribute::as_bool(bool def = false) const;
-long long xml_attribute::as_llong(long long def = 0) const;
-unsigned long long xml_attribute::as_ullong(unsigned long long def = 0) const;
+
int xml_attribute::as_int(int def = 0) const;
+unsigned int xml_attribute::as_uint(unsigned int def = 0) const;
+double xml_attribute::as_double(double def = 0) const;
+float xml_attribute::as_float(float def = 0) const;
+bool xml_attribute::as_bool(bool def = false) const;
+long long xml_attribute::as_llong(long long def = 0) const;
+unsigned long long xml_attribute::as_ullong(unsigned long long def = 0) const;
@@ -2111,10 +2183,10 @@

-
xml_node xml_node::child(const char_t* name) const;
-xml_attribute xml_node::attribute(const char_t* name) const;
-xml_node xml_node::next_sibling(const char_t* name) const;
-xml_node xml_node::previous_sibling(const char_t* name) const;
+
xml_node xml_node::child(const char_t* name) const;
+xml_attribute xml_node::attribute(const char_t* name) const;
+xml_node xml_node::next_sibling(const char_t* name) const;
+xml_node xml_node::previous_sibling(const char_t* name) const;
@@ -2125,7 +2197,7 @@

-
for (pugi::xml_node tool = tools.child("Tool"); tool; tool = tool.next_sibling("Tool"))
+
for (pugi::xml_node tool = tools.child("Tool"); tool; tool = tool.next_sibling("Tool"))
@@ -2133,8 +2205,8 @@

-
xml_node xml_node::find_child_by_attribute(const char_t* name, const char_t* attr_name, const char_t* attr_value) const;
-xml_node xml_node::find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const;
+
xml_node xml_node::find_child_by_attribute(const char_t* name, const char_t* attr_name, const char_t* attr_value) const;
+xml_node xml_node::find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const;
@@ -2165,9 +2237,9 @@

-
implementation-defined-type xml_node::children() const;
-implementation-defined-type xml_node::children(const char_t* name) const;
-implementation-defined-type xml_node::attributes() const;
+
implementation-defined-type xml_node::children() const;
+implementation-defined-type xml_node::children(const char_t* name) const;
+implementation-defined-type xml_node::attributes() const;
@@ -2178,22 +2250,22 @@

-
for (pugi::xml_node tool: tools.children("Tool"))
-{
-    std::cout << "Tool:";
+
for (pugi::xml_node tool: tools.children("Tool"))
+{
+    std::cout << "Tool:";
 
-    for (pugi::xml_attribute attr: tool.attributes())
-    {
-        std::cout << " " << attr.name() << "=" << attr.value();
-    }
+    for (pugi::xml_attribute attr: tool.attributes())
+    {
+        std::cout << " " << attr.name() << "=" << attr.value();
+    }
 
-    for (pugi::xml_node child: tool.children())
-    {
-        std::cout << ", child " << child.name();
-    }
+    for (pugi::xml_node child: tool.children())
+    {
+        std::cout << ", child " << child.name();
+    }
 
-    std::cout << std::endl;
-}
+ std::cout << std::endl; +}
@@ -2213,16 +2285,16 @@

-
class xml_node_iterator;
-class xml_attribute_iterator;
+
class xml_node_iterator;
+class xml_attribute_iterator;
 
-typedef xml_node_iterator xml_node::iterator;
-iterator xml_node::begin() const;
-iterator xml_node::end() const;
+typedef xml_node_iterator xml_node::iterator;
+iterator xml_node::begin() const;
+iterator xml_node::end() const;
 
-typedef xml_attribute_iterator xml_node::attribute_iterator;
-attribute_iterator xml_node::attributes_begin() const;
-attribute_iterator xml_node::attributes_end() const;
+typedef xml_attribute_iterator xml_node::attribute_iterator; +attribute_iterator xml_node::attributes_begin() const; +attribute_iterator xml_node::attributes_end() const;
@@ -2239,17 +2311,17 @@

-
for (pugi::xml_node_iterator it = tools.begin(); it != tools.end(); ++it)
-{
-    std::cout << "Tool:";
+
for (pugi::xml_node_iterator it = tools.begin(); it != tools.end(); ++it)
+{
+    std::cout << "Tool:";
 
-    for (pugi::xml_attribute_iterator ait = it->attributes_begin(); ait != it->attributes_end(); ++ait)
-    {
-        std::cout << " " << ait->name() << "=" << ait->value();
-    }
+    for (pugi::xml_attribute_iterator ait = it->attributes_begin(); ait != it->attributes_end(); ++ait)
+    {
+        std::cout << " " << ait->name() << "=" << ait->value();
+    }
 
-    std::cout << std::endl;
-}
+ std::cout << std::endl; +}
-
simple_walker walker;
-doc.traverse(walker);
+
simple_walker walker;
+doc.traverse(walker);

@@ -2341,9 +2413,9 @@

-
template <typename Predicate> xml_attribute xml_node::find_attribute(Predicate pred) const;
-template <typename Predicate> xml_node xml_node::find_child(Predicate pred) const;
-template <typename Predicate> xml_node xml_node::find_node(Predicate pred) const;
+
template <typename Predicate> xml_attribute xml_node::find_attribute(Predicate pred) const;
+template <typename Predicate> xml_node xml_node::find_child(Predicate pred) const;
+template <typename Predicate> xml_node xml_node::find_node(Predicate pred) const;
@@ -2363,38 +2435,38 @@

-
bool small_timeout(pugi::xml_node node)
-{
-    return node.attribute("Timeout").as_int() < 20;
-}
+
bool small_timeout(pugi::xml_node node)
+{
+    return node.attribute("Timeout").as_int() < 20;
+}
 
-struct allow_remote_predicate
-{
-    bool operator()(pugi::xml_attribute attr) const
-    {
-        return strcmp(attr.name(), "AllowRemote") == 0;
-    }
+struct allow_remote_predicate
+{
+    bool operator()(pugi::xml_attribute attr) const
+    {
+        return strcmp(attr.name(), "AllowRemote") == 0;
+    }
 
-    bool operator()(pugi::xml_node node) const
-    {
-        return node.attribute("AllowRemote").as_bool();
-    }
-};
+ bool operator()(pugi::xml_node node) const + { + return node.attribute("AllowRemote").as_bool(); + } +};
// Find child via predicate (looks for direct children only)
-std::cout << tools.find_child(allow_remote_predicate()).attribute("Filename").value() << std::endl;
+std::cout << tools.find_child(allow_remote_predicate()).attribute("Filename").value() << std::endl;
 
 // Find node via predicate (looks for all descendants in depth-first order)
-std::cout << doc.find_node(allow_remote_predicate()).attribute("Filename").value() << std::endl;
+std::cout << doc.find_node(allow_remote_predicate()).attribute("Filename").value() << std::endl;
 
 // Find attribute via predicate
-std::cout << tools.last_child().find_attribute(allow_remote_predicate()).value() << std::endl;
+std::cout << tools.last_child().find_attribute(allow_remote_predicate()).value() << std::endl;
 
 // We can use simple functions instead of function objects
-std::cout << tools.find_child(small_timeout).attribute("Filename").value() << std::endl;
+std::cout << tools.find_child(small_timeout).attribute("Filename").value() << std::endl;

@@ -2408,7 +2480,7 @@

-
xml_text xml_node::text() const;
+
xml_text xml_node::text() const;
@@ -2420,7 +2492,7 @@

-
bool xml_text::empty() const;
+
bool xml_text::empty() const;
@@ -2428,7 +2500,7 @@

-
const char_t* xml_text::get() const;
+
const char_t* xml_text::get() const;
@@ -2440,14 +2512,14 @@

-
const char_t* xml_text::as_string(const char_t* def = "") const;
-int xml_text::as_int(int def = 0) const;
-unsigned int xml_text::as_uint(unsigned int def = 0) const;
-double xml_text::as_double(double def = 0) const;
-float xml_text::as_float(float def = 0) const;
-bool xml_text::as_bool(bool def = false) const;
-long long xml_text::as_llong(long long def = 0) const;
-unsigned long long xml_text::as_ullong(unsigned long long def = 0) const;
+
const char_t* xml_text::as_string(const char_t* def = "") const;
+int xml_text::as_int(int def = 0) const;
+unsigned int xml_text::as_uint(unsigned int def = 0) const;
+double xml_text::as_double(double def = 0) const;
+float xml_text::as_float(float def = 0) const;
+bool xml_text::as_bool(bool def = false) const;
+long long xml_text::as_llong(long long def = 0) const;
+unsigned long long xml_text::as_ullong(unsigned long long def = 0) const;
@@ -2458,7 +2530,7 @@

-
xml_node xml_text::data() const;
+
xml_node xml_text::data() const;
@@ -2483,7 +2555,7 @@

-
xml_node xml_node::root() const;
+
xml_node xml_node::root() const;
@@ -2495,8 +2567,8 @@

-
string_t xml_node::path(char_t delimiter = '/') const;
-xml_node xml_node::first_element_by_path(const char_t* path, char_t delimiter = '/') const;
+
string_t xml_node::path(char_t delimiter = '/') const;
+xml_node xml_node::first_element_by_path(const char_t* path, char_t delimiter = '/') const;
@@ -2522,7 +2594,7 @@

-
ptrdiff_t xml_node::offset_debug() const;
+
ptrdiff_t xml_node::offset_debug() const;
@@ -2548,8 +2620,8 @@

-
bool xml_node::set_name(const char_t* rhs);
-bool xml_node::set_value(const char_t* rhs);
+
bool xml_node::set_name(const char_t* rhs);
+bool xml_node::set_value(const char_t* rhs);
@@ -2583,8 +2655,8 @@

-
bool xml_attribute::set_name(const char_t* rhs);
-bool xml_attribute::set_value(const char_t* rhs);
+
bool xml_attribute::set_name(const char_t* rhs);
+bool xml_attribute::set_value(const char_t* rhs);
@@ -2595,17 +2667,17 @@

-
bool xml_attribute::set_value(int rhs);
-bool xml_attribute::set_value(unsigned int rhs);
-bool xml_attribute::set_value(long rhs);
-bool xml_attribute::set_value(unsigned long rhs);
-bool xml_attribute::set_value(double rhs);
-bool xml_attribute::set_value(double rhs, int precision);
-bool xml_attribute::set_value(float rhs);
-bool xml_attribute::set_value(float rhs, int precision);
-bool xml_attribute::set_value(bool rhs);
-bool xml_attribute::set_value(long long rhs);
-bool xml_attribute::set_value(unsigned long long rhs);
+
bool xml_attribute::set_value(int rhs);
+bool xml_attribute::set_value(unsigned int rhs);
+bool xml_attribute::set_value(long rhs);
+bool xml_attribute::set_value(unsigned long rhs);
+bool xml_attribute::set_value(double rhs);
+bool xml_attribute::set_value(double rhs, int precision);
+bool xml_attribute::set_value(float rhs);
+bool xml_attribute::set_value(float rhs, int precision);
+bool xml_attribute::set_value(bool rhs);
+bool xml_attribute::set_value(long long rhs);
+bool xml_attribute::set_value(unsigned long long rhs);
@@ -2640,16 +2712,16 @@

-
xml_attribute& xml_attribute::operator=(const char_t* rhs);
-xml_attribute& xml_attribute::operator=(int rhs);
-xml_attribute& xml_attribute::operator=(unsigned int rhs);
-xml_attribute& xml_attribute::operator=(long rhs);
-xml_attribute& xml_attribute::operator=(unsigned long rhs);
-xml_attribute& xml_attribute::operator=(double rhs);
-xml_attribute& xml_attribute::operator=(float rhs);
-xml_attribute& xml_attribute::operator=(bool rhs);
-xml_attribute& xml_attribute::operator=(long long rhs);
-xml_attribute& xml_attribute::operator=(unsigned long long rhs);
+
xml_attribute& xml_attribute::operator=(const char_t* rhs);
+xml_attribute& xml_attribute::operator=(int rhs);
+xml_attribute& xml_attribute::operator=(unsigned int rhs);
+xml_attribute& xml_attribute::operator=(long rhs);
+xml_attribute& xml_attribute::operator=(unsigned long rhs);
+xml_attribute& xml_attribute::operator=(double rhs);
+xml_attribute& xml_attribute::operator=(float rhs);
+xml_attribute& xml_attribute::operator=(bool rhs);
+xml_attribute& xml_attribute::operator=(long long rhs);
+xml_attribute& xml_attribute::operator=(unsigned long long rhs);
@@ -2684,20 +2756,20 @@

-
xml_attribute xml_node::append_attribute(const char_t* name);
-xml_attribute xml_node::prepend_attribute(const char_t* name);
-xml_attribute xml_node::insert_attribute_after(const char_t* name, const xml_attribute& attr);
-xml_attribute xml_node::insert_attribute_before(const char_t* name, const xml_attribute& attr);
+
xml_attribute xml_node::append_attribute(const char_t* name);
+xml_attribute xml_node::prepend_attribute(const char_t* name);
+xml_attribute xml_node::insert_attribute_after(const char_t* name, const xml_attribute& attr);
+xml_attribute xml_node::insert_attribute_before(const char_t* name, const xml_attribute& attr);
 
-xml_node xml_node::append_child(xml_node_type type = node_element);
-xml_node xml_node::prepend_child(xml_node_type type = node_element);
-xml_node xml_node::insert_child_after(xml_node_type type, const xml_node& node);
-xml_node xml_node::insert_child_before(xml_node_type type, const xml_node& node);
+xml_node xml_node::append_child(xml_node_type type = node_element);
+xml_node xml_node::prepend_child(xml_node_type type = node_element);
+xml_node xml_node::insert_child_after(xml_node_type type, const xml_node& node);
+xml_node xml_node::insert_child_before(xml_node_type type, const xml_node& node);
 
-xml_node xml_node::append_child(const char_t* name);
-xml_node xml_node::prepend_child(const char_t* name);
-xml_node xml_node::insert_child_after(const char_t* name, const xml_node& node);
-xml_node xml_node::insert_child_before(const char_t* name, const xml_node& node);
+xml_node xml_node::append_child(const char_t* name); +xml_node xml_node::prepend_child(const char_t* name); +xml_node xml_node::insert_child_after(const char_t* name, const xml_node& node); +xml_node xml_node::insert_child_before(const char_t* name, const xml_node& node);

@@ -2779,10 +2851,10 @@

-
bool xml_node::remove_attribute(const xml_attribute& a);
-bool xml_node::remove_attributes();
-bool xml_node::remove_child(const xml_node& n);
-bool xml_node::remove_children();
+
bool xml_node::remove_attribute(const xml_attribute& a);
+bool xml_node::remove_attributes();
+bool xml_node::remove_child(const xml_node& n);
+bool xml_node::remove_children();

@@ -2845,7 +2917,7 @@

-
bool xml_text::set(const char_t* rhs);
+
bool xml_text::set(const char_t* rhs);
@@ -2856,17 +2928,17 @@

-
bool xml_text::set(int rhs);
-bool xml_text::set(unsigned int rhs);
-bool xml_text::set(long rhs);
-bool xml_text::set(unsigned long rhs);
-bool xml_text::set(double rhs);
-bool xml_text::set(double rhs, int precision);
-bool xml_text::set(float rhs);
-bool xml_text::set(float rhs, int precision);
-bool xml_text::set(bool rhs);
-bool xml_text::set(long long rhs);
-bool xml_text::set(unsigned long long rhs);
+
bool xml_text::set(int rhs);
+bool xml_text::set(unsigned int rhs);
+bool xml_text::set(long rhs);
+bool xml_text::set(unsigned long rhs);
+bool xml_text::set(double rhs);
+bool xml_text::set(double rhs, int precision);
+bool xml_text::set(float rhs);
+bool xml_text::set(float rhs, int precision);
+bool xml_text::set(bool rhs);
+bool xml_text::set(long long rhs);
+bool xml_text::set(unsigned long long rhs);
@@ -2914,15 +2986,15 @@

-
xml_attribute xml_node::append_copy(const xml_attribute& proto);
-xml_attribute xml_node::prepend_copy(const xml_attribute& proto);
-xml_attribute xml_node::insert_copy_after(const xml_attribute& proto, const xml_attribute& attr);
-xml_attribute xml_node::insert_copy_before(const xml_attribute& proto, const xml_attribute& attr);
+
xml_attribute xml_node::append_copy(const xml_attribute& proto);
+xml_attribute xml_node::prepend_copy(const xml_attribute& proto);
+xml_attribute xml_node::insert_copy_after(const xml_attribute& proto, const xml_attribute& attr);
+xml_attribute xml_node::insert_copy_before(const xml_attribute& proto, const xml_attribute& attr);
 
-xml_node xml_node::append_copy(const xml_node& proto);
-xml_node xml_node::prepend_copy(const xml_node& proto);
-xml_node xml_node::insert_copy_after(const xml_node& proto, const xml_node& node);
-xml_node xml_node::insert_copy_before(const xml_node& proto, const xml_node& node);
+xml_node xml_node::append_copy(const xml_node& proto); +xml_node xml_node::prepend_copy(const xml_node& proto); +xml_node xml_node::insert_copy_after(const xml_node& proto, const xml_node& node); +xml_node xml_node::insert_copy_before(const xml_node& proto, const xml_node& node);
@@ -2952,53 +3024,53 @@

-
bool load_preprocess(pugi::xml_document& doc, const char* path);
+
bool load_preprocess(pugi::xml_document& doc, const char* path);
 
-bool preprocess(pugi::xml_node node)
-{
-    for (pugi::xml_node child = node.first_child(); child; )
-    {
-        if (child.type() == pugi::node_pi && strcmp(child.name(), "include") == 0)
-        {
-            pugi::xml_node include = child;
+bool preprocess(pugi::xml_node node)
+{
+    for (pugi::xml_node child = node.first_child(); child; )
+    {
+        if (child.type() == pugi::node_pi && strcmp(child.name(), "include") == 0)
+        {
+            pugi::xml_node include = child;
 
-            // load new preprocessed document (note: ideally this should handle relative paths)
-            const char* path = include.value();
+            // load new preprocessed document (note: ideally this should handle relative paths)
+            const char* path = include.value();
 
-            pugi::xml_document doc;
-            if (!load_preprocess(doc, path)) return false;
+            pugi::xml_document doc;
+            if (!load_preprocess(doc, path)) return false;
 
-            // insert the comment marker above include directive
-            node.insert_child_before(pugi::node_comment, include).set_value(path);
+            // insert the comment marker above include directive
+            node.insert_child_before(pugi::node_comment, include).set_value(path);
 
-            // copy the document above the include directive (this retains the original order!)
-            for (pugi::xml_node ic = doc.first_child(); ic; ic = ic.next_sibling())
-            {
-                node.insert_copy_before(ic, include);
-            }
+            // copy the document above the include directive (this retains the original order!)
+            for (pugi::xml_node ic = doc.first_child(); ic; ic = ic.next_sibling())
+            {
+                node.insert_copy_before(ic, include);
+            }
 
-            // remove the include node and move to the next child
-            child = child.next_sibling();
+            // remove the include node and move to the next child
+            child = child.next_sibling();
 
-            node.remove_child(include);
-        }
-        else
-        {
-            if (!preprocess(child)) return false;
+            node.remove_child(include);
+        }
+        else
+        {
+            if (!preprocess(child)) return false;
 
-            child = child.next_sibling();
-        }
-    }
+            child = child.next_sibling();
+        }
+    }
 
-    return true;
-}
+    return true;
+}
 
-bool load_preprocess(pugi::xml_document& doc, const char* path)
-{
-    pugi::xml_parse_result result = doc.load_file(path, pugi::parse_default | pugi::parse_pi); // for <?include?>
+bool load_preprocess(pugi::xml_document& doc, const char* path)
+{
+    pugi::xml_parse_result result = doc.load_file(path, pugi::parse_default | pugi::parse_pi); // for <?include?>
 
-    return result ? preprocess(doc) : false;
-}
+ return result ? preprocess(doc) : false; +}

@@ -3010,10 +3082,10 @@

-
xml_node xml_node::append_move(const xml_node& moved);
-xml_node xml_node::prepend_move(const xml_node& moved);
-xml_node xml_node::insert_move_after(const xml_node& moved, const xml_node& node);
-xml_node xml_node::insert_move_before(const xml_node& moved, const xml_node& node);
+
xml_node xml_node::append_move(const xml_node& moved);
+xml_node xml_node::prepend_move(const xml_node& moved);
+xml_node xml_node::insert_move_after(const xml_node& moved, const xml_node& node);
+xml_node xml_node::insert_move_before(const xml_node& moved, const xml_node& node);
@@ -3050,14 +3122,14 @@

Use a temporary document to parse the data from a string, then clone the nodes to a destination node. For example:

-
bool append_fragment(pugi::xml_node target, const char* buffer, size_t size)
-{
-    pugi::xml_document doc;
-    if (!doc.load_buffer(buffer, size)) return false;
+
bool append_fragment(pugi::xml_node target, const char* buffer, size_t size)
+{
+    pugi::xml_document doc;
+    if (!doc.load_buffer(buffer, size)) return false;
 
-    for (pugi::xml_node child = doc.first_child(); child; child = child.next_sibling())
-        target.append_copy(child);
-}
+ for (pugi::xml_node child = doc.first_child(); child; child = child.next_sibling()) + target.append_copy(child); +}
@@ -3065,11 +3137,11 @@

Cache the parsing step - instead of keeping in-memory buffers, keep document objects that already contain the parsed fragment:

-
bool append_fragment(pugi::xml_node target, const pugi::xml_document& cached_fragment)
-{
-    for (pugi::xml_node child = cached_fragment.first_child(); child; child = child.next_sibling())
-        target.append_copy(child);
-}
+
bool append_fragment(pugi::xml_node target, const pugi::xml_document& cached_fragment)
+{
+    for (pugi::xml_node child = cached_fragment.first_child(); child; child = child.next_sibling())
+        target.append_copy(child);
+}
@@ -3077,7 +3149,7 @@

Use xml_node::append_buffer directly:

-
xml_parse_result xml_node::append_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+
xml_parse_result xml_node::append_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
@@ -3115,8 +3187,8 @@

-
bool xml_document::save_file(const char* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
-bool xml_document::save_file(const wchar_t* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+
bool xml_document::save_file(const char* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+bool xml_document::save_file(const wchar_t* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;

@@ -3145,8 +3217,8 @@

-
void xml_document::save(std::ostream& stream, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
-void xml_document::save(std::wostream& stream, const char_t* indent = "\t", unsigned int flags = format_default) const;
+
void xml_document::save(std::ostream& stream, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+void xml_document::save(std::wostream& stream, const char_t* indent = "\t", unsigned int flags = format_default) const;

@@ -3174,13 +3246,13 @@

-
class xml_writer
-{
-public:
-    virtual void write(const void* data, size_t size) = 0;
-};
+
class xml_writer
+{
+public:
+    virtual void write(const void* data, size_t size) = 0;
+};
 
-void xml_document::save(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+void xml_document::save(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;

@@ -3214,9 +3286,9 @@

-
void xml_node::print(std::ostream& os, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
-void xml_node::print(std::wostream& os, const char_t* indent = "\t", unsigned int flags = format_default, unsigned int depth = 0) const;
-void xml_node::print(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
+
void xml_node::print(std::ostream& os, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
+void xml_node::print(std::wostream& os, const char_t* indent = "\t", unsigned int flags = format_default, unsigned int depth = 0) const;
+void xml_node::print(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;

@@ -3323,42 +3395,42 @@

// get a test document
-pugi::xml_document doc;
-doc.load_string("<foo bar='baz'><call>hey</call></foo>");
+pugi::xml_document doc;
+doc.load_string("<foo bar='baz'><call>hey</call></foo>");
 
 // default options; prints
 // <?xml version="1.0"?>
 // <foo bar="baz">
 //         <call>hey</call>
 // </foo>
-doc.save(std::cout);
-std::cout << std::endl;
+doc.save(std::cout);
+std::cout << std::endl;
 
 // default options with custom indentation string; prints
 // <?xml version="1.0"?>
 // <foo bar="baz">
 // --<call>hey</call>
 // </foo>
-doc.save(std::cout, "--");
-std::cout << std::endl;
+doc.save(std::cout, "--");
+std::cout << std::endl;
 
 // default options without indentation; prints
 // <?xml version="1.0"?>
 // <foo bar="baz">
 // <call>hey</call>
 // </foo>
-doc.save(std::cout, "\t", pugi::format_default & ~pugi::format_indent); // can also pass "" instead of indentation string for the same effect
-std::cout << std::endl;
+doc.save(std::cout, "\t", pugi::format_default & ~pugi::format_indent); // can also pass "" instead of indentation string for the same effect
+std::cout << std::endl;
 
 // raw output; prints
 // <?xml version="1.0"?><foo bar="baz"><call>hey</call></foo>
-doc.save(std::cout, "\t", pugi::format_raw);
-std::cout << std::endl << std::endl;
+doc.save(std::cout, "\t", pugi::format_raw);
+std::cout << std::endl << std::endl;
 
 // raw output without declaration; prints
 // <foo bar="baz"><call>hey</call></foo>
-doc.save(std::cout, "\t", pugi::format_raw | pugi::format_no_declaration);
-std::cout << std::endl;
+doc.save(std::cout, "\t", pugi::format_raw | pugi::format_no_declaration); +std::cout << std::endl;

@@ -3412,21 +3484,21 @@

// get a test document
-pugi::xml_document doc;
-doc.load_string("<foo bar='baz'><call>hey</call></foo>");
+pugi::xml_document doc;
+doc.load_string("<foo bar='baz'><call>hey</call></foo>");
 
 // add a custom declaration node
-pugi::xml_node decl = doc.prepend_child(pugi::node_declaration);
-decl.append_attribute("version") = "1.0";
-decl.append_attribute("encoding") = "UTF-8";
-decl.append_attribute("standalone") = "no";
+pugi::xml_node decl = doc.prepend_child(pugi::node_declaration);
+decl.append_attribute("version") = "1.0";
+decl.append_attribute("encoding") = "UTF-8";
+decl.append_attribute("standalone") = "no";
 
 // <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 // <foo bar="baz">
 //         <call>hey</call>
 // </foo>
-doc.save(std::cout);
-std::cout << std::endl;
+doc.save(std::cout); +std::cout << std::endl;

@@ -3450,8 +3522,8 @@

-
xml_node xpath_node::node() const;
-xml_attribute xpath_node::attribute() const;
+
xml_node xpath_node::node() const;
+xml_attribute xpath_node::attribute() const;
@@ -3462,7 +3534,7 @@

-
xml_node xpath_node::parent() const;
+
xml_node xpath_node::parent() const;
@@ -3484,9 +3556,9 @@

-
typedef const xpath_node* xpath_node_set::const_iterator;
-const_iterator xpath_node_set::begin() const;
-const_iterator xpath_node_set::end() const;
+
typedef const xpath_node* xpath_node_set::const_iterator;
+const_iterator xpath_node_set::begin() const;
+const_iterator xpath_node_set::end() const;
@@ -3495,9 +3567,9 @@

-
const xpath_node& xpath_node_set::operator[](size_t index) const;
-size_t xpath_node_set::size() const;
-bool xpath_node_set::empty() const;
+
const xpath_node& xpath_node_set::operator[](size_t index) const;
+size_t xpath_node_set::size() const;
+bool xpath_node_set::empty() const;
@@ -3509,8 +3581,8 @@

-
enum xpath_node_set::type_t {type_unsorted, type_sorted, type_sorted_reverse};
-type_t xpath_node_set::type() const;
+
enum xpath_node_set::type_t {type_unsorted, type_sorted, type_sorted_reverse};
+type_t xpath_node_set::type() const;
@@ -3518,7 +3590,7 @@

-
void xpath_node_set::sort(bool reverse = false);
+
void xpath_node_set::sort(bool reverse = false);
@@ -3529,7 +3601,7 @@

-
xpath_node xpath_node_set::first() const;
+
xpath_node xpath_node_set::first() const;
@@ -3540,7 +3612,7 @@

-
xpath_node_set::xpath_node_set(const_iterator begin, const_iterator end, type_t type = type_unsorted);
+
xpath_node_set::xpath_node_set(const_iterator begin, const_iterator end, type_t type = type_unsorted);
@@ -3555,8 +3627,8 @@

-
xpath_node xml_node::select_node(const char_t* query, xpath_variable_set* variables = 0) const;
-xpath_node_set xml_node::select_nodes(const char_t* query, xpath_variable_set* variables = 0) const;
+
xpath_node xml_node::select_node(const char_t* query, xpath_variable_set* variables = 0) const;
+xpath_node_set xml_node::select_nodes(const char_t* query, xpath_variable_set* variables = 0) const;
@@ -3571,8 +3643,8 @@

-
xpath_node xml_node::select_node(const xpath_query& query) const;
-xpath_node_set xml_node::select_nodes(const xpath_query& query) const;
+
xpath_node xml_node::select_node(const xpath_query& query) const;
+xpath_node_set xml_node::select_nodes(const xpath_query& query) const;
@@ -3626,7 +3698,7 @@

-
explicit xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables = 0);
+
explicit xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables = 0);
@@ -3634,7 +3706,7 @@

-
xpath_value_type xpath_query::return_type() const;
+
xpath_value_type xpath_query::return_type() const;
@@ -3643,11 +3715,11 @@

-
bool xpath_query::evaluate_boolean(const xpath_node& n) const;
-double xpath_query::evaluate_number(const xpath_node& n) const;
-string_t xpath_query::evaluate_string(const xpath_node& n) const;
-xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const;
-xpath_node xpath_query::evaluate_node(const xpath_node& n) const;
+
bool xpath_query::evaluate_boolean(const xpath_node& n) const;
+double xpath_query::evaluate_number(const xpath_node& n) const;
+string_t xpath_query::evaluate_string(const xpath_node& n) const;
+xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const;
+xpath_node xpath_query::evaluate_node(const xpath_node& n) const;
@@ -3670,7 +3742,7 @@

-
size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const;
+
size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const;
@@ -3692,26 +3764,26 @@

// Select nodes via compiled query
-pugi::xpath_query query_remote_tools("/Profile/Tools/Tool[@AllowRemote='true']");
+pugi::xpath_query query_remote_tools("/Profile/Tools/Tool[@AllowRemote='true']");
 
-pugi::xpath_node_set tools = query_remote_tools.evaluate_node_set(doc);
-std::cout << "Remote tool: ";
-tools[2].node().print(std::cout);
+pugi::xpath_node_set tools = query_remote_tools.evaluate_node_set(doc);
+std::cout << "Remote tool: ";
+tools[2].node().print(std::cout);
 
 // Evaluate numbers via compiled query
-pugi::xpath_query query_timeouts("sum(//Tool/@Timeout)");
-std::cout << query_timeouts.evaluate_number(doc) << std::endl;
+pugi::xpath_query query_timeouts("sum(//Tool/@Timeout)");
+std::cout << query_timeouts.evaluate_number(doc) << std::endl;
 
 // Evaluate strings via compiled query for different context nodes
-pugi::xpath_query query_name_valid("string-length(substring-before(@Filename, '_')) > 0 and @OutputFileMasks");
-pugi::xpath_query query_name("concat(substring-before(@Filename, '_'), ' produces ', @OutputFileMasks)");
+pugi::xpath_query query_name_valid("string-length(substring-before(@Filename, '_')) > 0 and @OutputFileMasks");
+pugi::xpath_query query_name("concat(substring-before(@Filename, '_'), ' produces ', @OutputFileMasks)");
 
-for (pugi::xml_node tool = doc.first_element_by_path("Profile/Tools/Tool"); tool; tool = tool.next_sibling())
-{
-    std::string s = query_name.evaluate_string(tool);
+for (pugi::xml_node tool = doc.first_element_by_path("Profile/Tools/Tool"); tool; tool = tool.next_sibling())
+{
+    std::string s = query_name.evaluate_string(tool);
 
-    if (query_name_valid.evaluate_boolean(tool)) std::cout << s << std::endl;
-}
+ if (query_name_valid.evaluate_boolean(tool)) std::cout << s << std::endl; +}

@@ -3725,9 +3797,9 @@

-
explicit xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables = 0);
-xpath_node xml_node::select_node(const char_t* query, xpath_variable_set* variables = 0) const;
-xpath_node_set xml_node::select_nodes(const char_t* query, xpath_variable_set* variables = 0) const;
+
explicit xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables = 0);
+xpath_node xml_node::select_node(const char_t* query, xpath_variable_set* variables = 0) const;
+xpath_node_set xml_node::select_nodes(const char_t* query, xpath_variable_set* variables = 0) const;
@@ -3753,7 +3825,7 @@

-
xpath_variable* xpath_variable_set::add(const char_t* name, xpath_value_type type);
+
xpath_variable* xpath_variable_set::add(const char_t* name, xpath_value_type type);
@@ -3767,8 +3839,8 @@

-
xpath_variable* xpath_variable_set::get(const char_t* name);
-const xpath_variable* xpath_variable_set::get(const char_t* name) const;
+
xpath_variable* xpath_variable_set::get(const char_t* name);
+const xpath_variable* xpath_variable_set::get(const char_t* name) const;
@@ -3779,10 +3851,10 @@

-
bool xpath_variable_set::set(const char_t* name, bool value);
-bool xpath_variable_set::set(const char_t* name, double value);
-bool xpath_variable_set::set(const char_t* name, const char_t* value);
-bool xpath_variable_set::set(const char_t* name, const xpath_node_set& value);
+
bool xpath_variable_set::set(const char_t* name, bool value);
+bool xpath_variable_set::set(const char_t* name, double value);
+bool xpath_variable_set::set(const char_t* name, const char_t* value);
+bool xpath_variable_set::set(const char_t* name, const xpath_node_set& value);
@@ -3797,8 +3869,8 @@

-
const char_t* xpath_variable::name() const;
-xpath_value_type xpath_variable::type() const;
+
const char_t* xpath_variable::name() const;
+xpath_value_type xpath_variable::type() const;
@@ -3810,10 +3882,10 @@

-
bool xpath_variable::get_boolean() const;
-double xpath_variable::get_number() const;
-const char_t* xpath_variable::get_string() const;
-const xpath_node_set& xpath_variable::get_node_set() const;
+
bool xpath_variable::get_boolean() const;
+double xpath_variable::get_number() const;
+const char_t* xpath_variable::get_string() const;
+const xpath_node_set& xpath_variable::get_node_set() const;
@@ -3824,10 +3896,10 @@

-
bool xpath_variable::set(bool value);
-bool xpath_variable::set(double value);
-bool xpath_variable::set(const char_t* value);
-bool xpath_variable::set(const xpath_node_set& value);
+
bool xpath_variable::set(bool value);
+bool xpath_variable::set(double value);
+bool xpath_variable::set(const char_t* value);
+bool xpath_variable::set(const xpath_node_set& value);
@@ -3839,28 +3911,28 @@

// Select nodes via compiled query
-pugi::xpath_variable_set vars;
-vars.add("remote", pugi::xpath_type_boolean);
+pugi::xpath_variable_set vars;
+vars.add("remote", pugi::xpath_type_boolean);
 
-pugi::xpath_query query_remote_tools("/Profile/Tools/Tool[@AllowRemote = string($remote)]", &vars);
+pugi::xpath_query query_remote_tools("/Profile/Tools/Tool[@AllowRemote = string($remote)]", &vars);
 
-vars.set("remote", true);
-pugi::xpath_node_set tools_remote = query_remote_tools.evaluate_node_set(doc);
+vars.set("remote", true);
+pugi::xpath_node_set tools_remote = query_remote_tools.evaluate_node_set(doc);
 
-vars.set("remote", false);
-pugi::xpath_node_set tools_local = query_remote_tools.evaluate_node_set(doc);
+vars.set("remote", false);
+pugi::xpath_node_set tools_local = query_remote_tools.evaluate_node_set(doc);
 
-std::cout << "Remote tool: ";
-tools_remote[2].node().print(std::cout);
+std::cout << "Remote tool: ";
+tools_remote[2].node().print(std::cout);
 
-std::cout << "Local tool: ";
-tools_local[0].node().print(std::cout);
+std::cout << "Local tool: ";
+tools_local[0].node().print(std::cout);
 
 // You can pass the context directly to select_nodes/select_node
-pugi::xpath_node_set tools_local_imm = doc.select_nodes("/Profile/Tools/Tool[@AllowRemote = string($remote)]", &vars);
+pugi::xpath_node_set tools_local_imm = doc.select_nodes("/Profile/Tools/Tool[@AllowRemote = string($remote)]", &vars);
 
-std::cout << "Local tool imm: ";
-tools_local_imm[0].node().print(std::cout);
+std::cout << "Local tool imm: "; +tools_local_imm[0].node().print(std::cout);

@@ -3875,8 +3947,8 @@

-
virtual const char* xpath_exception::what() const throw();
-const xpath_parse_result& xpath_exception::result() const;
+
virtual const char* xpath_exception::what() const throw();
+const xpath_parse_result& xpath_exception::result() const;
@@ -3885,7 +3957,7 @@

-
const xpath_parse_result& xpath_query::result() const;
+
const xpath_parse_result& xpath_query::result() const;
@@ -3986,6 +4058,68 @@

9. Changelog

+

v1.12 2022-02-09

+
+

Maintenance release. Changes:

+
+
+
    +
  • +

    Bug fixes:

    +
    +
      +
    1. +

      Fix a bug in xml_document move construction when the source of the move is empty

      +
    2. +
    3. +

      Fix const-correctness issues with iterator objects to support C++20 ranges

      +
    4. +
    +
    +
  • +
  • +

    XPath improvements:

    +
    +
      +
    1. +

      Improved detection of overly complex queries that may result in stack overflow during parsing

      +
    2. +
    +
    +
  • +
  • +

    Compatibility improvements:

    +
    +
      +
    1. +

      Fix Cygwin support for DLL builds

      +
    2. +
    3. +

      Fix Windows CE support

      +
    4. +
    5. +

      Add NuGet builds and project files for VS2022

      +
    6. +
    +
    +
  • +
  • +

    Build system changes

    +
    +
      +
    1. +

      All CMake options now have the prefix PUGIXML_. This may require changing dependent build configurations.

      +
    2. +
    3. +

      Many build settings are now exposed via CMake settings, most notably PUGIXML_COMPACT and PUGIXML_WCHAR_MODE can be set without changing pugiconfig.hpp

      +
    4. +
    +
    +
  • +
+
+
+

v1.11 2020-11-26

Maintenance release. Changes:

@@ -5393,10 +5527,10 @@

10.2. Types

-
typedef configuration-defined-type char_t;
-typedef configuration-defined-type string_t;
-typedef void* (*allocation_function)(size_t size);
-typedef void (*deallocation_function)(void* ptr);
+
typedef configuration-defined-type char_t;
+typedef configuration-defined-type string_t;
+typedef void* (*allocation_function)(size_t size);
+typedef void (*deallocation_function)(void* ptr);
@@ -5404,54 +5538,54 @@

10.3. Enumerations

-
enum xml_node_type
-    node_null
-    node_document
-    node_element
-    node_pcdata
-    node_cdata
-    node_comment
-    node_pi
-    node_declaration
-    node_doctype
-
-enum xml_parse_status
-    status_ok
-    status_file_not_found
-    status_io_error
-    status_out_of_memory
-    status_internal_error
-    status_unrecognized_tag
-    status_bad_pi
-    status_bad_comment
-    status_bad_cdata
-    status_bad_doctype
-    status_bad_pcdata
-    status_bad_start_element
-    status_bad_attribute
-    status_bad_end_element
-    status_end_element_mismatch
-    status_append_invalid_root
-    status_no_document_element
-
-enum xml_encoding
-    encoding_auto
-    encoding_utf8
-    encoding_utf16_le
-    encoding_utf16_be
-    encoding_utf16
-    encoding_utf32_le
-    encoding_utf32_be
-    encoding_utf32
-    encoding_wchar
-    encoding_latin1
-
-enum xpath_value_type
-    xpath_type_none
-    xpath_type_node_set
-    xpath_type_number
-    xpath_type_string
-    xpath_type_boolean
+
enum xml_node_type
+    node_null
+    node_document
+    node_element
+    node_pcdata
+    node_cdata
+    node_comment
+    node_pi
+    node_declaration
+    node_doctype
+
+enum xml_parse_status
+    status_ok
+    status_file_not_found
+    status_io_error
+    status_out_of_memory
+    status_internal_error
+    status_unrecognized_tag
+    status_bad_pi
+    status_bad_comment
+    status_bad_cdata
+    status_bad_doctype
+    status_bad_pcdata
+    status_bad_start_element
+    status_bad_attribute
+    status_bad_end_element
+    status_end_element_mismatch
+    status_append_invalid_root
+    status_no_document_element
+
+enum xml_encoding
+    encoding_auto
+    encoding_utf8
+    encoding_utf16_le
+    encoding_utf16_be
+    encoding_utf16
+    encoding_utf32_le
+    encoding_utf32_be
+    encoding_utf32
+    encoding_wchar
+    encoding_latin1
+
+enum xpath_value_type
+    xpath_type_none
+    xpath_type_node_set
+    xpath_type_number
+    xpath_type_string
+    xpath_type_boolean
@@ -5460,36 +5594,36 @@

// Formatting options bit flags:
-const unsigned int format_attribute_single_quote
-const unsigned int format_default
-const unsigned int format_indent
-const unsigned int format_indent_attributes
-const unsigned int format_no_declaration
-const unsigned int format_no_empty_element_tags
-const unsigned int format_no_escapes
-const unsigned int format_raw
-const unsigned int format_save_file_text
-const unsigned int format_skip_control_chars
-const unsigned int format_write_bom
+const unsigned int format_attribute_single_quote
+const unsigned int format_default
+const unsigned int format_indent
+const unsigned int format_indent_attributes
+const unsigned int format_no_declaration
+const unsigned int format_no_empty_element_tags
+const unsigned int format_no_escapes
+const unsigned int format_raw
+const unsigned int format_save_file_text
+const unsigned int format_skip_control_chars
+const unsigned int format_write_bom
 
 // Parsing options bit flags:
-const unsigned int parse_cdata
-const unsigned int parse_comments
-const unsigned int parse_declaration
-const unsigned int parse_default
-const unsigned int parse_doctype
-const unsigned int parse_eol
-const unsigned int parse_escapes
-const unsigned int parse_fragment
-const unsigned int parse_full
-const unsigned int parse_minimal
-const unsigned int parse_pi
-const unsigned int parse_trim_pcdata
-const unsigned int parse_ws_pcdata
-const unsigned int parse_ws_pcdata_single
-const unsigned int parse_embed_pcdata
-const unsigned int parse_wconv_attribute
-const unsigned int parse_wnorm_attribute
+const unsigned int parse_cdata +const unsigned int parse_comments +const unsigned int parse_declaration +const unsigned int parse_default +const unsigned int parse_doctype +const unsigned int parse_eol +const unsigned int parse_escapes +const unsigned int parse_fragment +const unsigned int parse_full +const unsigned int parse_minimal +const unsigned int parse_pi +const unsigned int parse_trim_pcdata +const unsigned int parse_ws_pcdata +const unsigned int parse_ws_pcdata_single +const unsigned int parse_embed_pcdata +const unsigned int parse_wconv_attribute +const unsigned int parse_wnorm_attribute

@@ -5497,352 +5631,352 @@

10.5. Classes

-
class xml_attribute
-    xml_attribute();
-
-    bool empty() const;
-    operator unspecified_bool_type() const;
-
-    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;
-    bool operator<=(const xml_attribute& r) const;
-    bool operator>=(const xml_attribute& r) const;
-
-    size_t hash_value() const;
-
-    xml_attribute next_attribute() const;
-    xml_attribute previous_attribute() const;
-
-    const char_t* name() const;
-    const char_t* value() const;
-
-    const char_t* as_string(const char_t* def = "") const;
-    int as_int(int def = 0) const;
-    unsigned int as_uint(unsigned int def = 0) const;
-    double as_double(double def = 0) const;
-    float as_float(float def = 0) const;
-    bool as_bool(bool def = false) const;
-    long long as_llong(long long def = 0) const;
-    unsigned long long as_ullong(unsigned long long def = 0) const;
-
-    bool set_name(const char_t* rhs);
-    bool set_value(const char_t* rhs);
-    bool set_value(int rhs);
-    bool set_value(unsigned int rhs);
-    bool set_value(long rhs);
-    bool set_value(unsigned long rhs);
-    bool set_value(double rhs);
-    bool set_value(float rhs);
-    bool set_value(bool rhs);
-    bool set_value(long long rhs);
-    bool set_value(unsigned long long rhs);
-
-    xml_attribute& operator=(const char_t* rhs);
-    xml_attribute& operator=(int rhs);
-    xml_attribute& operator=(unsigned int rhs);
-    xml_attribute& operator=(long rhs);
-    xml_attribute& operator=(unsigned long rhs);
-    xml_attribute& operator=(double rhs);
-    xml_attribute& operator=(float rhs);
-    xml_attribute& operator=(bool rhs);
-    xml_attribute& operator=(long long rhs);
-    xml_attribute& operator=(unsnigned long long rhs);
-
-class xml_node
-    xml_node();
-
-    bool empty() const;
-    operator unspecified_bool_type() const;
-
-    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;
-    bool operator<=(const xml_node& r) const;
-    bool operator>=(const xml_node& r) const;
-
-    size_t hash_value() const;
-
-    xml_node_type type() const;
-
-    const char_t* name() const;
-    const char_t* value() const;
-
-    xml_node parent() const;
-    xml_node first_child() const;
-    xml_node last_child() const;
-    xml_node next_sibling() const;
-    xml_node previous_sibling() const;
-
-    xml_attribute first_attribute() const;
-    xml_attribute last_attribute() const;
-
-    implementation-defined-type children() const;
-    implementation-defined-type children(const char_t* name) const;
-    implementation-defined-type attributes() const;
-
-    xml_node child(const char_t* name) const;
-    xml_attribute attribute(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 find_child_by_attribute(const char_t* name, const char_t* attr_name, const char_t* attr_value) const;
-    xml_node find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const;
-
-    const char_t* child_value() const;
-    const char_t* child_value(const char_t* name) const;
-    xml_text text() const;
-
-    typedef xml_node_iterator iterator;
-    iterator begin() const;
-    iterator end() const;
-
-    typedef xml_attribute_iterator attribute_iterator;
-    attribute_iterator attributes_begin() const;
-    attribute_iterator attributes_end() const;
-
-    bool traverse(xml_tree_walker& walker);
-
-    template <typename Predicate> xml_attribute find_attribute(Predicate pred) const;
-    template <typename Predicate> xml_node find_child(Predicate pred) const;
-    template <typename Predicate> xml_node find_node(Predicate pred) const;
-
-    string_t path(char_t delimiter = '/') const;
-    xml_node xml_node::first_element_by_path(const char_t* path, char_t delimiter = '/') const;
-    xml_node root() const;
-    ptrdiff_t offset_debug() const;
-
-    bool set_name(const char_t* rhs);
-    bool set_value(const char_t* rhs);
-
-    xml_attribute append_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_before(const char_t* name, const xml_attribute& attr);
-
-    xml_node append_child(xml_node_type type = node_element);
-    xml_node prepend_child(xml_node_type type = node_element);
-    xml_node insert_child_after(xml_node_type type, const xml_node& node);
-    xml_node insert_child_before(xml_node_type type, const xml_node& node);
-
-    xml_node append_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_before(const char_t* name, const xml_node& node);
-
-    xml_attribute append_copy(const xml_attribute& proto);
-    xml_attribute prepend_copy(const xml_attribute& proto);
-    xml_attribute insert_copy_after(const xml_attribute& proto, const xml_attribute& attr);
-    xml_attribute insert_copy_before(const xml_attribute& proto, const xml_attribute& attr);
-
-    xml_node append_copy(const xml_node& proto);
-    xml_node prepend_copy(const xml_node& proto);
-    xml_node insert_copy_after(const xml_node& proto, const xml_node& node);
-    xml_node insert_copy_before(const xml_node& proto, const xml_node& node);
-
-    xml_node append_move(const xml_node& moved);
-    xml_node prepend_move(const xml_node& moved);
-    xml_node insert_move_after(const xml_node& moved, const xml_node& node);
-    xml_node insert_move_before(const xml_node& moved, const xml_node& node);
-
-    bool remove_attribute(const xml_attribute& a);
-    bool remove_attribute(const char_t* name);
-    bool remove_attributes();
-    bool remove_child(const xml_node& n);
-    bool remove_child(const char_t* name);
-    bool remove_children();
-
-    xml_parse_result append_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-
-    void print(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
-    void print(std::ostream& os, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
-    void print(std::wostream& os, const char_t* indent = "\t", unsigned int flags = format_default, unsigned int depth = 0) const;
-
-    xpath_node select_node(const char_t* query, xpath_variable_set* variables = 0) const;
-    xpath_node select_node(const xpath_query& query) const;
-    xpath_node_set select_nodes(const char_t* query, xpath_variable_set* variables = 0) const;
-    xpath_node_set select_nodes(const xpath_query& query) const;
-
-class xml_document
-    xml_document();
-    ~xml_document();
-
-    void reset();
-    void reset(const xml_document& proto);
-
-    xml_parse_result load(std::istream& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-    xml_parse_result load(std::wistream& stream, unsigned int options = parse_default);
-
-    xml_parse_result load_string(const char_t* contents, unsigned int options = parse_default);
-
-    xml_parse_result load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-    xml_parse_result load_file(const wchar_t* 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_buffer_inplace(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
-    xml_parse_result load_buffer_inplace_own(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+
class xml_attribute
+    xml_attribute();
+
+    bool empty() const;
+    operator unspecified_bool_type() const;
+
+    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;
+    bool operator<=(const xml_attribute& r) const;
+    bool operator>=(const xml_attribute& r) const;
+
+    size_t hash_value() const;
+
+    xml_attribute next_attribute() const;
+    xml_attribute previous_attribute() const;
+
+    const char_t* name() const;
+    const char_t* value() const;
+
+    const char_t* as_string(const char_t* def = "") const;
+    int as_int(int def = 0) const;
+    unsigned int as_uint(unsigned int def = 0) const;
+    double as_double(double def = 0) const;
+    float as_float(float def = 0) const;
+    bool as_bool(bool def = false) const;
+    long long as_llong(long long def = 0) const;
+    unsigned long long as_ullong(unsigned long long def = 0) const;
+
+    bool set_name(const char_t* rhs);
+    bool set_value(const char_t* rhs);
+    bool set_value(int rhs);
+    bool set_value(unsigned int rhs);
+    bool set_value(long rhs);
+    bool set_value(unsigned long rhs);
+    bool set_value(double rhs);
+    bool set_value(float rhs);
+    bool set_value(bool rhs);
+    bool set_value(long long rhs);
+    bool set_value(unsigned long long rhs);
+
+    xml_attribute& operator=(const char_t* rhs);
+    xml_attribute& operator=(int rhs);
+    xml_attribute& operator=(unsigned int rhs);
+    xml_attribute& operator=(long rhs);
+    xml_attribute& operator=(unsigned long rhs);
+    xml_attribute& operator=(double rhs);
+    xml_attribute& operator=(float rhs);
+    xml_attribute& operator=(bool rhs);
+    xml_attribute& operator=(long long rhs);
+    xml_attribute& operator=(unsnigned long long rhs);
+
+class xml_node
+    xml_node();
+
+    bool empty() const;
+    operator unspecified_bool_type() const;
+
+    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;
+    bool operator<=(const xml_node& r) const;
+    bool operator>=(const xml_node& r) const;
+
+    size_t hash_value() const;
+
+    xml_node_type type() const;
+
+    const char_t* name() const;
+    const char_t* value() const;
+
+    xml_node parent() const;
+    xml_node first_child() const;
+    xml_node last_child() const;
+    xml_node next_sibling() const;
+    xml_node previous_sibling() const;
+
+    xml_attribute first_attribute() const;
+    xml_attribute last_attribute() const;
+
+    implementation-defined-type children() const;
+    implementation-defined-type children(const char_t* name) const;
+    implementation-defined-type attributes() const;
+
+    xml_node child(const char_t* name) const;
+    xml_attribute attribute(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 find_child_by_attribute(const char_t* name, const char_t* attr_name, const char_t* attr_value) const;
+    xml_node find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const;
+
+    const char_t* child_value() const;
+    const char_t* child_value(const char_t* name) const;
+    xml_text text() const;
+
+    typedef xml_node_iterator iterator;
+    iterator begin() const;
+    iterator end() const;
+
+    typedef xml_attribute_iterator attribute_iterator;
+    attribute_iterator attributes_begin() const;
+    attribute_iterator attributes_end() const;
+
+    bool traverse(xml_tree_walker& walker);
+
+    template <typename Predicate> xml_attribute find_attribute(Predicate pred) const;
+    template <typename Predicate> xml_node find_child(Predicate pred) const;
+    template <typename Predicate> xml_node find_node(Predicate pred) const;
+
+    string_t path(char_t delimiter = '/') const;
+    xml_node xml_node::first_element_by_path(const char_t* path, char_t delimiter = '/') const;
+    xml_node root() const;
+    ptrdiff_t offset_debug() const;
+
+    bool set_name(const char_t* rhs);
+    bool set_value(const char_t* rhs);
+
+    xml_attribute append_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_before(const char_t* name, const xml_attribute& attr);
+
+    xml_node append_child(xml_node_type type = node_element);
+    xml_node prepend_child(xml_node_type type = node_element);
+    xml_node insert_child_after(xml_node_type type, const xml_node& node);
+    xml_node insert_child_before(xml_node_type type, const xml_node& node);
+
+    xml_node append_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_before(const char_t* name, const xml_node& node);
+
+    xml_attribute append_copy(const xml_attribute& proto);
+    xml_attribute prepend_copy(const xml_attribute& proto);
+    xml_attribute insert_copy_after(const xml_attribute& proto, const xml_attribute& attr);
+    xml_attribute insert_copy_before(const xml_attribute& proto, const xml_attribute& attr);
+
+    xml_node append_copy(const xml_node& proto);
+    xml_node prepend_copy(const xml_node& proto);
+    xml_node insert_copy_after(const xml_node& proto, const xml_node& node);
+    xml_node insert_copy_before(const xml_node& proto, const xml_node& node);
+
+    xml_node append_move(const xml_node& moved);
+    xml_node prepend_move(const xml_node& moved);
+    xml_node insert_move_after(const xml_node& moved, const xml_node& node);
+    xml_node insert_move_before(const xml_node& moved, const xml_node& node);
+
+    bool remove_attribute(const xml_attribute& a);
+    bool remove_attribute(const char_t* name);
+    bool remove_attributes();
+    bool remove_child(const xml_node& n);
+    bool remove_child(const char_t* name);
+    bool remove_children();
+
+    xml_parse_result append_buffer(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+
+    void print(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
+    void print(std::ostream& os, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
+    void print(std::wostream& os, const char_t* indent = "\t", unsigned int flags = format_default, unsigned int depth = 0) const;
+
+    xpath_node select_node(const char_t* query, xpath_variable_set* variables = 0) const;
+    xpath_node select_node(const xpath_query& query) const;
+    xpath_node_set select_nodes(const char_t* query, xpath_variable_set* variables = 0) const;
+    xpath_node_set select_nodes(const xpath_query& query) const;
+
+class xml_document
+    xml_document();
+    ~xml_document();
+
+    void reset();
+    void reset(const xml_document& proto);
+
+    xml_parse_result load(std::istream& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+    xml_parse_result load(std::wistream& stream, unsigned int options = parse_default);
+
+    xml_parse_result load_string(const char_t* contents, unsigned int options = parse_default);
+
+    xml_parse_result load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+    xml_parse_result load_file(const wchar_t* 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_buffer_inplace(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+    xml_parse_result load_buffer_inplace_own(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
 
-    bool save_file(const char* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
-    bool save_file(const wchar_t* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+    bool save_file(const char* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+    bool save_file(const wchar_t* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
 
-    void save(std::ostream& stream, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
-    void save(std::wostream& stream, const char_t* indent = "\t", unsigned int flags = format_default) const;
+    void save(std::ostream& stream, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+    void save(std::wostream& stream, const char_t* indent = "\t", unsigned int flags = format_default) const;
 
-    void save(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
+    void save(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
 
-    xml_node document_element() const;
+    xml_node document_element() const;
 
-struct xml_parse_result
-    xml_parse_status status;
-    ptrdiff_t offset;
-    xml_encoding encoding;
+struct xml_parse_result
+    xml_parse_status status;
+    ptrdiff_t offset;
+    xml_encoding encoding;
 
-    operator bool() const;
-    const char* description() const;
+    operator bool() const;
+    const char* description() const;
 
-class xml_node_iterator
-class xml_attribute_iterator
+class xml_node_iterator
+class xml_attribute_iterator
 
-class xml_tree_walker
-    virtual bool begin(xml_node& node);
-    virtual bool for_each(xml_node& node) = 0;
-    virtual bool end(xml_node& node);
+class xml_tree_walker
+    virtual bool begin(xml_node& node);
+    virtual bool for_each(xml_node& node) = 0;
+    virtual bool end(xml_node& node);
 
-    int depth() const;
+    int depth() const;
 
-class xml_text
-    bool empty() const;
-    operator xml_text::unspecified_bool_type() const;
+class xml_text
+    bool empty() const;
+    operator xml_text::unspecified_bool_type() const;
 
-    const char_t* xml_text::get() const;
+    const char_t* xml_text::get() const;
 
-    const char_t* as_string(const char_t* def = "") const;
-    int as_int(int def = 0) const;
-    unsigned int as_uint(unsigned int def = 0) const;
-    double as_double(double def = 0) const;
-    float as_float(float def = 0) const;
-    bool as_bool(bool def = false) const;
-    long long as_llong(long long def = 0) const;
-    unsigned long long as_ullong(unsigned long long def = 0) const;
+    const char_t* as_string(const char_t* def = "") const;
+    int as_int(int def = 0) const;
+    unsigned int as_uint(unsigned int def = 0) const;
+    double as_double(double def = 0) const;
+    float as_float(float def = 0) const;
+    bool as_bool(bool def = false) const;
+    long long as_llong(long long def = 0) const;
+    unsigned long long as_ullong(unsigned long long def = 0) const;
 
-    bool set(const char_t* rhs);
+    bool set(const char_t* rhs);
 
-    bool set(int rhs);
-    bool set(unsigned int rhs);
-    bool set(long rhs);
-    bool set(unsigned long rhs);
-    bool set(double rhs);
-    bool set(float rhs);
-    bool set(bool rhs);
-    bool set(long long rhs);
-    bool set(unsigned long long rhs);
+    bool set(int rhs);
+    bool set(unsigned int rhs);
+    bool set(long rhs);
+    bool set(unsigned long rhs);
+    bool set(double rhs);
+    bool set(float rhs);
+    bool set(bool rhs);
+    bool set(long long rhs);
+    bool set(unsigned long long rhs);
 
-    xml_text& operator=(const char_t* rhs);
-    xml_text& operator=(int rhs);
-    xml_text& operator=(unsigned int rhs);
-    xml_text& operator=(long rhs);
-    xml_text& operator=(unsigned long rhs);
-    xml_text& operator=(double rhs);
-    xml_text& operator=(float rhs);
-    xml_text& operator=(bool rhs);
-    xml_text& operator=(long long rhs);
-    xml_text& operator=(unsigned long long rhs);
+    xml_text& operator=(const char_t* rhs);
+    xml_text& operator=(int rhs);
+    xml_text& operator=(unsigned int rhs);
+    xml_text& operator=(long rhs);
+    xml_text& operator=(unsigned long rhs);
+    xml_text& operator=(double rhs);
+    xml_text& operator=(float rhs);
+    xml_text& operator=(bool rhs);
+    xml_text& operator=(long long rhs);
+    xml_text& operator=(unsigned long long rhs);
 
-    xml_node data() const;
+    xml_node data() const;
 
-class xml_writer
-    virtual void write(const void* data, size_t size) = 0;
+class xml_writer
+    virtual void write(const void* data, size_t size) = 0;
 
-class xml_writer_file: public xml_writer
-    xml_writer_file(void* file);
+class xml_writer_file: public xml_writer
+    xml_writer_file(void* file);
 
-class xml_writer_stream: public xml_writer
-    xml_writer_stream(std::ostream& stream);
-    xml_writer_stream(std::wostream& stream);
+class xml_writer_stream: public xml_writer
+    xml_writer_stream(std::ostream& stream);
+    xml_writer_stream(std::wostream& stream);
 
-struct xpath_parse_result
-    const char* error;
-    ptrdiff_t offset;
+struct xpath_parse_result
+    const char* error;
+    ptrdiff_t offset;
 
-    operator bool() const;
-    const char* description() const;
+    operator bool() const;
+    const char* description() const;
 
-class xpath_query
-    explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0);
+class xpath_query
+    explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0);
 
-    bool evaluate_boolean(const xpath_node& n) const;
-    double evaluate_number(const xpath_node& n) const;
-    string_t evaluate_string(const xpath_node& n) const;
-    size_t evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const;
-    xpath_node_set evaluate_node_set(const xpath_node& n) const;
-    xpath_node evaluate_node(const xpath_node& n) const;
+    bool evaluate_boolean(const xpath_node& n) const;
+    double evaluate_number(const xpath_node& n) const;
+    string_t evaluate_string(const xpath_node& n) const;
+    size_t evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const;
+    xpath_node_set evaluate_node_set(const xpath_node& n) const;
+    xpath_node evaluate_node(const xpath_node& n) const;
 
-    xpath_value_type return_type() const;
+    xpath_value_type return_type() const;
 
-    const xpath_parse_result& result() const;
-    operator unspecified_bool_type() const;
+    const xpath_parse_result& result() const;
+    operator unspecified_bool_type() const;
 
-class xpath_exception: public std::exception
-    virtual const char* what() const throw();
+class xpath_exception: public std::exception
+    virtual const char* what() const throw();
 
-    const xpath_parse_result& result() const;
+    const xpath_parse_result& result() const;
 
-class xpath_node
-    xpath_node();
-    xpath_node(const xml_node& node);
-    xpath_node(const xml_attribute& attribute, const xml_node& parent);
+class xpath_node
+    xpath_node();
+    xpath_node(const xml_node& node);
+    xpath_node(const xml_attribute& attribute, const xml_node& parent);
 
-    xml_node node() const;
-    xml_attribute attribute() const;
-    xml_node parent() const;
+    xml_node node() const;
+    xml_attribute attribute() const;
+    xml_node parent() const;
 
-    operator unspecified_bool_type() const;
-    bool operator==(const xpath_node& n) const;
-    bool operator!=(const xpath_node& n) const;
+    operator unspecified_bool_type() const;
+    bool operator==(const xpath_node& n) const;
+    bool operator!=(const xpath_node& n) const;
 
-class xpath_node_set
-    xpath_node_set();
-    xpath_node_set(const_iterator begin, const_iterator end, type_t type = type_unsorted);
+class xpath_node_set
+    xpath_node_set();
+    xpath_node_set(const_iterator begin, const_iterator end, type_t type = type_unsorted);
 
-    typedef const xpath_node* const_iterator;
-    const_iterator begin() const;
-    const_iterator end() const;
+    typedef const xpath_node* const_iterator;
+    const_iterator begin() const;
+    const_iterator end() const;
 
-    const xpath_node& operator[](size_t index) const;
-    size_t size() const;
-    bool empty() const;
+    const xpath_node& operator[](size_t index) const;
+    size_t size() const;
+    bool empty() const;
 
-    xpath_node first() const;
+    xpath_node first() const;
 
-    enum type_t {type_unsorted, type_sorted, type_sorted_reverse};
-    type_t type() const;
-    void sort(bool reverse = false);
+    enum type_t {type_unsorted, type_sorted, type_sorted_reverse};
+    type_t type() const;
+    void sort(bool reverse = false);
 
-class xpath_variable
-    const char_t* name() const;
-    xpath_value_type type() const;
+class xpath_variable
+    const char_t* name() const;
+    xpath_value_type type() const;
 
-    bool get_boolean() const;
-    double get_number() const;
-    const char_t* get_string() const;
-    const xpath_node_set& get_node_set() const;
+    bool get_boolean() const;
+    double get_number() const;
+    const char_t* get_string() const;
+    const xpath_node_set& get_node_set() const;
 
-    bool set(bool value);
-    bool set(double value);
-    bool set(const char_t* value);
-    bool set(const xpath_node_set& value);
+    bool set(bool value);
+    bool set(double value);
+    bool set(const char_t* value);
+    bool set(const xpath_node_set& value);
 
-class xpath_variable_set
-    xpath_variable* add(const char_t* name, xpath_value_type type);
+class xpath_variable_set
+    xpath_variable* add(const char_t* name, xpath_value_type type);
 
-    bool set(const char_t* name, bool value);
-    bool set(const char_t* name, double value);
-    bool set(const char_t* name, const char_t* value);
-    bool set(const char_t* name, const xpath_node_set& value);
+    bool set(const char_t* name, bool value);
+    bool set(const char_t* name, double value);
+    bool set(const char_t* name, const char_t* value);
+    bool set(const char_t* name, const xpath_node_set& value);
 
-    xpath_variable* get(const char_t* name);
-    const xpath_variable* get(const char_t* name) const;
+ xpath_variable* get(const char_t* name); + const xpath_variable* get(const char_t* name) const;

@@ -5850,13 +5984,13 @@

10.6. Functions

-
std::string as_utf8(const wchar_t* str);
-std::string as_utf8(const std::wstring& str);
-std::wstring as_wide(const char* str);
-std::wstring as_wide(const std::string& str);
-void set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
-allocation_function get_memory_allocation_function();
-deallocation_function get_memory_deallocation_function();
+
std::string as_utf8(const wchar_t* str);
+std::string as_utf8(const std::wstring& str);
+std::wstring as_wide(const char* str);
+std::wstring as_wide(const std::string& str);
+void set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
+allocation_function get_memory_allocation_function();
+deallocation_function get_memory_deallocation_function();
@@ -5871,84 +6005,8 @@

- \ No newline at end of file diff --git a/docs/quickstart.html b/docs/quickstart.html index 6eac2c7f..2c8a1aba 100644 --- a/docs/quickstart.html +++ b/docs/quickstart.html @@ -4,26 +4,24 @@ - + -pugixml 1.11 quick start guide +pugixml 1.12 quick start guide + @@ -677,13 +748,13 @@

-
for (pugi::xml_node tool = tools.child("Tool"); tool; tool = tool.next_sibling("Tool"))
-{
-    std::cout << "Tool " << tool.attribute("Filename").value();
-    std::cout << ": AllowRemote " << tool.attribute("AllowRemote").as_bool();
-    std::cout << ", Timeout " << tool.attribute("Timeout").as_int();
-    std::cout << ", Description '" << tool.child_value("Description") << "'\n";
-}
+
for (pugi::xml_node tool = tools.child("Tool"); tool; tool = tool.next_sibling("Tool"))
+{
+    std::cout << "Tool " << tool.attribute("Filename").value();
+    std::cout << ": AllowRemote " << tool.attribute("AllowRemote").as_bool();
+    std::cout << ", Timeout " << tool.attribute("Timeout").as_int();
+    std::cout << ", Description '" << tool.child_value("Description") << "'\n";
+}

-
simple_walker walker;
-doc.traverse(walker);
+
simple_walker walker;
+doc.traverse(walker);
-
pugi::xml_attribute attr = node.attribute("id");
+
pugi::xml_attribute attr = node.attribute("id");
 
 // change attribute name/value
-std::cout << attr.set_name("key") << ", " << attr.set_value("345");
-std::cout << ", new attribute: " << attr.name() << "=" << attr.value() << std::endl;
+std::cout << attr.set_name("key") << ", " << attr.set_value("345");
+std::cout << ", new attribute: " << attr.name() << "=" << attr.value() << std::endl;
 
 // we can use numbers or booleans
-attr.set_value(1.234);
-std::cout << "new attribute value: " << attr.value() << std::endl;
+attr.set_value(1.234);
+std::cout << "new attribute value: " << attr.value() << std::endl;
 
 // we can also use assignment operators for more concise code
-attr = true;
-std::cout << "final attribute value: " << attr.value() << std::endl;
+attr = true; +std::cout << "final attribute value: " << attr.value() << std::endl;

@@ -927,7 +998,7 @@

// save document to file
-std::cout << "Saving result: " << doc.save_file("save_file_output.xml") << std::endl;
+std::cout << "Saving result: " << doc.save_file("save_file_output.xml") << std::endl;

@@ -1030,84 +1101,8 @@

- \ No newline at end of file