From 76dcd894271bc26a4cb9dad15a68e5abf9fc0f14 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 20 Oct 2022 20:08:52 -0700 Subject: [PATCH 1/4] Update version number in preparation for 1.13 --- CMakeLists.txt | 2 +- readme.txt | 2 +- scripts/nuget/pugixml.nuspec | 2 +- scripts/pugixml.podspec | 2 +- scripts/pugixml_dll.rc | 4 ++-- src/pugiconfig.hpp | 2 +- src/pugixml.cpp | 2 +- src/pugixml.hpp | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77a5e7e..9860f38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.4) -project(pugixml VERSION 1.12 LANGUAGES CXX) +project(pugixml VERSION 1.13 LANGUAGES CXX) include(CMakePackageConfigHelpers) include(CMakeDependentOption) diff --git a/readme.txt b/readme.txt index 747fc0b..9dffb72 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -pugixml 1.12 - an XML processing library +pugixml 1.13 - an XML processing library Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) Report bugs and download new versions at https://pugixml.org/ diff --git a/scripts/nuget/pugixml.nuspec b/scripts/nuget/pugixml.nuspec index 36d833f..ce88718 100644 --- a/scripts/nuget/pugixml.nuspec +++ b/scripts/nuget/pugixml.nuspec @@ -2,7 +2,7 @@ pugixml - 1.12.0-appveyor + 1.13.0-appveyor pugixml Arseny Kapoulkine Arseny Kapoulkine diff --git a/scripts/pugixml.podspec b/scripts/pugixml.podspec index 520dc9e..52e9064 100644 --- a/scripts/pugixml.podspec +++ b/scripts/pugixml.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "pugixml" - s.version = "1.12" + s.version = "1.13" s.summary = "C++ XML parser library." s.homepage = "https://pugixml.org" s.license = "MIT" diff --git a/scripts/pugixml_dll.rc b/scripts/pugixml_dll.rc index 72c68d0..0ffa019 100644 --- a/scripts/pugixml_dll.rc +++ b/scripts/pugixml_dll.rc @@ -1,9 +1,9 @@ #include #define PUGIXML_VERSION_MAJOR 1 -#define PUGIXML_VERSION_MINOR 12 +#define PUGIXML_VERSION_MINOR 13 #define PUGIXML_VERSION_PATCH 0 -#define PUGIXML_VERSION_NUMBER "1.12.0\0" +#define PUGIXML_VERSION_NUMBER "1.13.0\0" #if defined(GCC_WINDRES) || defined(__MINGW32__) || defined(__CYGWIN__) VS_VERSION_INFO VERSIONINFO diff --git a/src/pugiconfig.hpp b/src/pugiconfig.hpp index 0713b0e..88b2f2a 100644 --- a/src/pugiconfig.hpp +++ b/src/pugiconfig.hpp @@ -1,5 +1,5 @@ /** - * pugixml parser - version 1.12 + * pugixml parser - version 1.13 * -------------------------------------------------------- * Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Report bugs and download new versions at https://pugixml.org/ diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 7c84038..c63645b 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -1,5 +1,5 @@ /** - * pugixml parser - version 1.12 + * pugixml parser - version 1.13 * -------------------------------------------------------- * Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Report bugs and download new versions at https://pugixml.org/ diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 398eec8..050df15 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -1,5 +1,5 @@ /** - * pugixml parser - version 1.12 + * pugixml parser - version 1.13 * -------------------------------------------------------- * Copyright (C) 2006-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Report bugs and download new versions at https://pugixml.org/ @@ -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 // 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 PUGIXML_VERSION 1120 // 1.12 +# define PUGIXML_VERSION 1130 // 1.13 #endif // Include user configuration file (this can define various configuration macros) From 0ef3da1e6e18df24cdf36849c3e0c08e8ef541e5 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 20 Oct 2022 20:18:08 -0700 Subject: [PATCH 2/4] Update release notes and manual for 1.13 This includes a previously unnoticed link fix for xml_text::set --- docs/manual.adoc | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/docs/manual.adoc b/docs/manual.adoc index ac51535..0bff1da 100644 --- a/docs/manual.adoc +++ b/docs/manual.adoc @@ -1254,6 +1254,7 @@ As discussed before, nodes can have name and value, both of which are strings. D ---- bool xml_node::set_name(const char_t* rhs); bool xml_node::set_value(const char_t* rhs); +bool xml_node::set_value(const char_t* rhs, size_t size); ---- Both functions try to set the name/value to the specified string, and return the operation result. The operation fails if the node can not have name or value (for instance, when trying to call `set_name` on a <> node), if the node handle is null, or if there is insufficient memory to handle the request. The provided string is copied into document managed memory and can be destroyed after the function returns (for example, you can safely pass stack-allocated buffers to these functions). The name/value content is not verified, so take care to use only valid XML names, or the document may become malformed. @@ -1275,6 +1276,7 @@ All attributes have name and value, both of which are strings (value may be empt ---- bool xml_attribute::set_name(const char_t* rhs); bool xml_attribute::set_value(const char_t* rhs); +bool xml_attribute::set_value(const char_t* rhs, size_t size); ---- Both functions try to set the name/value to the specified string, and return the operation result. The operation fails if the attribute handle is null, or if there is insufficient memory to handle the request. The provided string is copied into document managed memory and can be destroyed after the function returns (for example, you can safely pass stack-allocated buffers to these functions). The name/value content is not verified, so take care to use only valid XML names, or the document may become malformed. @@ -1428,6 +1430,7 @@ Once you have an `xml_text` object, you can set the text contents using the foll [source] ---- bool xml_text::set(const char_t* rhs); +bool xml_text::set(const char_t* rhs, size_t size); ---- This function tries to set the contents to the specified string, and returns the operation result. The operation fails if the text object was retrieved from a node that can not have a value and is not an element node (i.e. it is a <> node), if the text object is empty, or if there is insufficient memory to handle the request. The provided string is copied into document managed memory and can be destroyed after the function returns (for example, you can safely pass stack-allocated buffers to this function). Note that if the text object was retrieved from an element node, this function creates the PCDATA child node if necessary (i.e. if the element node does not have a PCDATA/CDATA child already). @@ -2138,6 +2141,23 @@ Because of the differences in document object models, performance considerations :!numbered: +[[v1.13]] +=== v1.13 ^2022-11-01^ + +Maintenance release. Changes: + +* Improvements: + . `xml_attribute::set_value`, `xml_node::set_value` and `xml_text::set` now have overloads that accept pointer to non-null-terminated string and size + . Improve performance of tree traversal when using compact mode (`PUGIXML_COMPACT`) + +* Bug fixes: + . Fix error handling in `xml_document::save_file` that could result in the function succeeding while running out of disk space + . Fix memory leak during error handling of some out-of-memory conditions during `xml_document::load` + +* Compatibility improvements: + . Fix exported symbols in CMake DLL builds when using CMake + . Fix exported symbols in CMake shared object builds when using -fvisibility=hidden + [[v1.12]] === v1.12 ^2022-02-09^ @@ -2798,6 +2818,7 @@ const unsigned int +++parse_wnorm_attribute bool +++set_name+++(const char_t* rhs); bool +++set_value+++(const char_t* rhs); + bool +++set_value+++(const char_t* rhs, size_t size); bool +++set_value+++(int rhs); bool +++set_value+++(unsigned int rhs); bool +++set_value+++(long rhs); @@ -2884,6 +2905,7 @@ const unsigned int +++parse_wnorm_attribute bool +++set_name+++(const char_t* rhs); bool +++set_value+++(const char_t* rhs); + bool +++set_value+++(const char_t* rhs, size_t size); xml_attribute +++append_attribute+++(const char_t* name); xml_attribute +++prepend_attribute+++(const char_t* name); @@ -2996,16 +3018,17 @@ const unsigned int +++parse_wnorm_attribute unsigned long long +++as_ullong+++(unsigned long long def = 0) const; bool +++set+++(const char_t* rhs); + bool +++set+++(const char_t* rhs, size_t size); - 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); From c5b288d91a33bd8347f39e3a90dc15b3a9d2b203 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 20 Oct 2022 20:20:45 -0700 Subject: [PATCH 3/4] Update HTML documentation --- docs/manual.html | 216 ++++++++++++++++++++++++++++--------------- docs/quickstart.html | 76 ++++++++------- 2 files changed, 180 insertions(+), 112 deletions(-) diff --git a/docs/manual.html b/docs/manual.html index 6457a9a..01f233c 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -4,9 +4,9 @@ - + -pugixml 1.12 manual +pugixml 1.13 manual