This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Copyright (C) 2006-2017, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at http://pugixml.org/
* Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
* of this file.
Expand All
@@ -11,9 +11,10 @@
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
*/
// 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
#ifndef PUGIXML_VERSION
// Define version macro; evaluates to major * 100 + minor so that it's safe to use in less-than comparisons
# definePUGIXML_VERSION180
# definePUGIXML_VERSION1120// 1.12
#endif
// Include user configuration file (this can define various configuration macros)
Expand DownExpand Up
@@ -81,15 +82,44 @@
# endif
#endif
// If C++ is 2011 or higher, add 'noexcept' specifiers
#ifndef PUGIXML_NOEXCEPT
# if __cplusplus >= 201103
# definePUGIXML_NOEXCEPTnoexcept
# elif defined(_MSC_VER) && _MSC_VER >= 1900
# definePUGIXML_NOEXCEPTnoexcept
# else
# definePUGIXML_NOEXCEPT
# endif
#endif
// Some functions can not be noexcept in compact mode
// Nodes are indented depending on their depth in DOM tree, a default declaration is output if document has none.
constunsignedint format_default = format_indent;
constint default_double_precision = 17;
constint default_float_precision = 9;
// Forward declarations
structxml_attribute_struct;
structxml_node_struct;
Expand DownExpand Up
@@ -273,6 +312,8 @@ namespace pugi
It begin() const { return _begin; }
It end() const { return _end; }
boolempty() const { return _begin == _end; }
private:
It _begin, _end;
};
Expand DownExpand Up
@@ -383,7 +424,9 @@ namespace pugi
boolset_value(long rhs);
boolset_value(unsignedlong rhs);
boolset_value(double rhs);
boolset_value(double rhs, int precision);
boolset_value(float rhs);
boolset_value(float rhs, int precision);
boolset_value(bool rhs);
#ifdef PUGIXML_HAS_LONG_LONG
Expand DownExpand Up
@@ -549,10 +592,16 @@ namespace pugi
boolremove_attribute(const xml_attribute& a);
boolremove_attribute(constchar_t* name);
// Remove all attributes
boolremove_attributes();
// Remove specified child
boolremove_child(const xml_node& n);
boolremove_child(constchar_t* name);
// Remove all children
boolremove_children();
// Parses buffer as an XML document fragment and appends all nodes as children of the current node.
// Copies/converts the buffer, so it may be deleted or changed after the function returns.
// Note: append_buffer allocates memory that has the lifetime of the owning document; removing the appended nodes does not immediately reclaim that memory.
Expand DownExpand Up
@@ -623,16 +672,16 @@ namespace pugi
#ifndef PUGIXML_NO_XPATH
// Select single node by evaluating XPath query. Returns first node from the resulting node set.