From ff16dbdd4c63fa46cc1f38eda4cfb66f38047657 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 13 Dec 2014 20:34:10 -0800 Subject: [PATCH 01/10] Don't use off64_t/_wfopen on MinGW32 in C++11 mode Unfortunately, standard headers on MinGW32 insist on undefining off64_t and _wfopen extensions if __STRICT_ANSI__ is true (e.g. C++11 mode). This leads to compilation errors since b7a1fec started to use _wfopen in strict mode. That change erroneously checked GCC version - however, the version itself is irrelevant; the actual criteria is whether mingw64 runtime is used. off64_t is not useful on MinGW32 since we only need it to open large files on 64-bit platforms; unfortunately, the lack of _wfopen means we won't be able to support wide-char paths on Windows for MinGW32. Fixes #24. --- src/pugixml.cpp | 4 ++-- tests/test_document.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index b8847a4..dd3f427 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -3995,7 +3995,7 @@ PUGI__NS_BEGIN _fseeki64(file, 0, SEEK_END); length_type length = _ftelli64(file); _fseeki64(file, 0, SEEK_SET); - #elif defined(__MINGW32__) && !defined(__NO_MINGW_LFS) && !(defined(__STRICT_ANSI__) && __GNUC__ * 100 + __GNUC_MINOR__ <= 405) + #elif defined(__MINGW32__) && !defined(__NO_MINGW_LFS) && (!defined(__STRICT_ANSI__) || defined(__MINGW64_VERSION_MAJOR)) // there are 64-bit versions of fseek/ftell, let's use them typedef off64_t length_type; @@ -4240,7 +4240,7 @@ PUGI__NS_BEGIN } #endif -#if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) || (defined(__MINGW32__) && !(defined(__STRICT_ANSI__) && __GNUC__ * 100 + __GNUC_MINOR__ <= 405)) +#if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) || (defined(__MINGW32__) && (!defined(__STRICT_ANSI__) || defined(__MINGW64_VERSION_MAJOR))) PUGI__FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) { return _wfopen(path, mode); diff --git a/tests/test_document.cpp b/tests/test_document.cpp index f57465f..ebcdcd1 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -323,7 +323,7 @@ TEST(document_load_file_wide_ascii) CHECK_NODE(doc, STR("")); } -#if !defined(__DMC__) && !defined(__MWERKS__) && !(defined(__MINGW32__) && defined(__STRICT_ANSI__) && __GNUC__ * 100 + __GNUC_MINOR__ <= 405) +#if !defined(__DMC__) && !defined(__MWERKS__) && !(defined(__MINGW32__) && defined(__STRICT_ANSI__) && !defined(__MINGW64_VERSION_MAJOR)) TEST(document_load_file_wide_unicode) { pugi::xml_document doc; From 32f0a8bd3a5c9f3c454164f4d23289851b0de3e7 Mon Sep 17 00:00:00 2001 From: Steve Doiel Date: Tue, 6 Jan 2015 15:33:56 -0800 Subject: [PATCH 02/10] Add xml_text::set for float Make float/double round-trip --- src/pugixml.cpp | 17 ++++++++++++++++- src/pugixml.hpp | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index dd3f427..6608d8d 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -3954,10 +3954,18 @@ PUGI__NS_BEGIN return set_value_buffer(dest, header, header_mask, buf); } + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, float value) + { + char buf[128]; + sprintf(buf, "%.9g", value); + + return set_value_buffer(dest, header, header_mask, buf); + } + PUGI__FN bool set_value_convert(char_t*& dest, uintptr_t& header, uintptr_t header_mask, double value) { char buf[128]; - sprintf(buf, "%g", value); + sprintf(buf, "%.17g", value); return set_value_buffer(dest, header, header_mask, buf); } @@ -5603,6 +5611,13 @@ namespace pugi return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; } + PUGI__FN bool xml_text::set(float rhs) + { + xml_node_struct* dn = _data_new(); + + return dn ? impl::set_value_convert(dn->value, dn->header, impl::xml_memory_page_value_allocated_mask, rhs) : false; + } + PUGI__FN bool xml_text::set(double rhs) { xml_node_struct* dn = _data_new(); diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 917ef4a..8a332e1 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -693,6 +693,7 @@ namespace pugi // Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false") bool set(int rhs); bool set(unsigned int rhs); + bool set(float rhs); bool set(double rhs); bool set(bool rhs); From f3e42969a5118247de548c059e9bed69cdf208bb Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 9 Jan 2015 19:29:23 -0800 Subject: [PATCH 03/10] Simplify header-only mode usage It's sufficient to define PUGIXML_HEADER_ONLY anywhere now, source is included automatically. This is a second attempt; this time it includes a workaround for QMake bug that caused it to generate incorrect Makefile. --- src/pugiconfig.hpp | 1 - src/pugixml.hpp | 7 +++++++ tests/test_header_only.cpp | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/test_header_only.cpp diff --git a/src/pugiconfig.hpp b/src/pugiconfig.hpp index 1c216e3..6219dbe 100644 --- a/src/pugiconfig.hpp +++ b/src/pugiconfig.hpp @@ -39,7 +39,6 @@ // Uncomment this to switch to header-only version // #define PUGIXML_HEADER_ONLY -// #include "pugixml.cpp" // Uncomment this to enable long long support // #define PUGIXML_HAS_LONG_LONG diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 917ef4a..2432a3f 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -1329,6 +1329,13 @@ namespace std #endif +// Make sure implementation is included in header-only mode +// Use macro expansion in #include to work around QMake (QTBUG-11923) +#if defined(PUGIXML_HEADER_ONLY) && !defined(PUGIXML_SOURCE) +# define PUGIXML_SOURCE "pugixml.cpp" +# include PUGIXML_SOURCE +#endif + /** * Copyright (c) 2006-2014 Arseny Kapoulkine * diff --git a/tests/test_header_only.cpp b/tests/test_header_only.cpp new file mode 100644 index 0000000..f1990dd --- /dev/null +++ b/tests/test_header_only.cpp @@ -0,0 +1,16 @@ +#define PUGIXML_HEADER_ONLY +#define pugi pugih + +#include "common.hpp" + +// Check header guards +#include "../src/pugixml.hpp" +#include "../src/pugixml.hpp" + +TEST(header_only) +{ + xml_document doc; + CHECK(doc.load_string(STR(""))); + CHECK_STRING(doc.first_child().name(), STR("node")); + CHECK(doc.first_child() == doc.select_node(STR("//*")).node()); +} From 4ae1940065c415223445efb23d3200d1b0b1d4a1 Mon Sep 17 00:00:00 2001 From: Steve Doiel Date: Fri, 16 Jan 2015 14:55:10 -0800 Subject: [PATCH 04/10] Fix attribute round trip for float as well --- src/pugixml.cpp | 7 +++++++ src/pugixml.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 6608d8d..2ed94f3 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -4608,6 +4608,13 @@ namespace pugi return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); } + PUGI__FN bool xml_attribute::set_value(float rhs) + { + if (!_attr) return false; + + return impl::set_value_convert(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs); + } + PUGI__FN bool xml_attribute::set_value(bool rhs) { if (!_attr) return false; diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 8a332e1..2076426 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -352,6 +352,7 @@ namespace pugi bool set_value(int rhs); bool set_value(unsigned int rhs); bool set_value(double rhs); + bool set_value(float rhs); bool set_value(bool rhs); #ifdef PUGIXML_HAS_LONG_LONG From 53525a037b45ecf4dc29bf6700ad384647541da2 Mon Sep 17 00:00:00 2001 From: Steve Doiel Date: Fri, 16 Jan 2015 15:20:28 -0800 Subject: [PATCH 05/10] Add a couple of more overloads for floats --- src/pugixml.cpp | 12 ++++++++++++ src/pugixml.hpp | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 2ed94f3..9760e9f 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -4553,6 +4553,12 @@ namespace pugi return *this; } + PUGI__FN xml_attribute& xml_attribute::operator=(float rhs) + { + set_value(rhs); + return *this; + } + PUGI__FN xml_attribute& xml_attribute::operator=(bool rhs) { set_value(rhs); @@ -5679,6 +5685,12 @@ namespace pugi return *this; } + PUGI__FN xml_text& xml_text::operator=(float rhs) + { + set(rhs); + return *this; + } + PUGI__FN xml_text& xml_text::operator=(bool rhs) { set(rhs); diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 2076426..163059d 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -365,6 +365,7 @@ namespace pugi xml_attribute& operator=(int rhs); xml_attribute& operator=(unsigned int rhs); xml_attribute& operator=(double rhs); + xml_attribute& operator=(float rhs); xml_attribute& operator=(bool rhs); #ifdef PUGIXML_HAS_LONG_LONG @@ -708,6 +709,7 @@ namespace pugi xml_text& operator=(int rhs); xml_text& operator=(unsigned int rhs); xml_text& operator=(double rhs); + xml_text& operator=(float rhs); xml_text& operator=(bool rhs); #ifdef PUGIXML_HAS_LONG_LONG From cf72c20ca173bbad227e8f70bd68a2dbfb5b2890 Mon Sep 17 00:00:00 2001 From: Steve Doiel Date: Fri, 16 Jan 2015 16:14:59 -0800 Subject: [PATCH 06/10] Increase precision on large number test --- tests/test_dom_modify.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index 7863718..85c381e 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -753,8 +753,8 @@ TEST_XML(dom_attr_assign_large_number, "") node.attribute(STR("attr1")) = std::numeric_limits::max(); node.attribute(STR("attr2")) = std::numeric_limits::max(); - CHECK(test_node(node, STR(""), STR(""), pugi::format_raw) || - test_node(node, STR(""), STR(""), pugi::format_raw)); + CHECK(test_node(node, STR(""), STR(""), pugi::format_raw) || + test_node(node, STR(""), STR(""), pugi::format_raw)); } TEST(dom_node_declaration_name) From f07018f7e70d39bcfdd71882c2b8b6c510ba1955 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 16 Jan 2015 21:00:09 -0800 Subject: [PATCH 07/10] Convert spaces to tabs --- src/pugixml.cpp | 4 ++-- src/pugixml.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 9760e9f..265337a 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -8681,7 +8681,7 @@ PUGI__NS_BEGIN bool step_push(xpath_node_set_raw& ns, xml_attribute_struct* a, xml_node_struct* parent, xpath_allocator* alloc) { - assert(a); + assert(a); const char_t* name = a->name ? a->name : PUGIXML_TEXT(""); @@ -8721,7 +8721,7 @@ PUGI__NS_BEGIN bool step_push(xpath_node_set_raw& ns, xml_node_struct* n, xpath_allocator* alloc) { - assert(n); + assert(n); xml_node_type type = PUGI__NODETYPE(n); diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 240b5aa..91e1f2e 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -352,7 +352,7 @@ namespace pugi bool set_value(int rhs); bool set_value(unsigned int rhs); bool set_value(double rhs); - bool set_value(float rhs); + bool set_value(float rhs); bool set_value(bool rhs); #ifdef PUGIXML_HAS_LONG_LONG @@ -433,7 +433,7 @@ namespace pugi const char_t* name() const; // Get node value, or "" if node is empty or it has no value - // Note: For text node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes. + // Note: For text node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes. const char_t* value() const; // Get attribute list @@ -695,7 +695,7 @@ namespace pugi // Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false") bool set(int rhs); bool set(unsigned int rhs); - bool set(float rhs); + bool set(float rhs); bool set(double rhs); bool set(bool rhs); From f9ee391233ed8526597abb3ffa96c4eb8b1c92ad Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 16 Jan 2015 21:42:35 -0800 Subject: [PATCH 08/10] tests: Add coverage tests for new float setters These only do basic testing to make sure the paths are covered and trivial values work. --- tests/test_dom_modify.cpp | 16 +++++++++++----- tests/test_dom_text.cpp | 14 ++++++++++---- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index 85c381e..70cba53 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -21,10 +21,13 @@ TEST_XML(dom_attr_assign, "") node.append_attribute(STR("attr6")) = 0.5; xml_attribute() = 0.5; - node.append_attribute(STR("attr7")) = true; + node.append_attribute(STR("attr7")) = 0.25f; + xml_attribute() = 0.25f; + + node.append_attribute(STR("attr8")) = true; xml_attribute() = true; - CHECK_NODE(node, STR("")); + CHECK_NODE(node, STR("")); } TEST_XML(dom_attr_set_name, "") @@ -55,10 +58,13 @@ TEST_XML(dom_attr_set_value, "") CHECK(node.append_attribute(STR("attr6")).set_value(0.5)); CHECK(!xml_attribute().set_value(0.5)); - CHECK(node.append_attribute(STR("attr7")).set_value(true)); + CHECK(node.append_attribute(STR("attr7")).set_value(0.25f)); + CHECK(!xml_attribute().set_value(0.25f)); + + CHECK(node.append_attribute(STR("attr8")).set_value(true)); CHECK(!xml_attribute().set_value(true)); - CHECK_NODE(node, STR("")); + CHECK_NODE(node, STR("")); } #ifdef PUGIXML_HAS_LONG_LONG @@ -753,7 +759,7 @@ TEST_XML(dom_attr_assign_large_number, "") node.attribute(STR("attr1")) = std::numeric_limits::max(); node.attribute(STR("attr2")) = std::numeric_limits::max(); - CHECK(test_node(node, STR(""), STR(""), pugi::format_raw) || + CHECK(test_node(node, STR(""), STR(""), pugi::format_raw) || test_node(node, STR(""), STR(""), pugi::format_raw)); } diff --git a/tests/test_dom_text.cpp b/tests/test_dom_text.cpp index fb65b03..007334a 100644 --- a/tests/test_dom_text.cpp +++ b/tests/test_dom_text.cpp @@ -263,10 +263,13 @@ TEST_XML(dom_text_assign, "") node.append_child(STR("text6")).text() = 0.5; xml_text() = 0.5; - node.append_child(STR("text7")).text() = true; + node.append_child(STR("text7")).text() = 0.25f; + xml_text() = 0.25f; + + node.append_child(STR("text8")).text() = true; xml_text() = true; - CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.5true")); + CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.50.25true")); } TEST_XML(dom_text_set_value, "") @@ -287,10 +290,13 @@ TEST_XML(dom_text_set_value, "") CHECK(node.append_child(STR("text6")).text().set(0.5)); CHECK(!xml_text().set(0.5)); - CHECK(node.append_child(STR("text7")).text().set(true)); + CHECK(node.append_child(STR("text7")).text().set(0.25f)); + CHECK(!xml_text().set(0.25f)); + + CHECK(node.append_child(STR("text8")).text().set(true)); CHECK(!xml_text().set(true)); - CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.5true")); + CHECK_NODE(node, STR("v1-2147483647-2147483648429496729542949672940.50.25true")); } #ifdef PUGIXML_HAS_LONG_LONG From d454013cffe1be5819bfb6329b1aa218b8de618f Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 16 Jan 2015 21:43:28 -0800 Subject: [PATCH 09/10] tests: Add tests for fp roundtrip We test min/max and several different mantissas for the entire exponent range for both float and double. It's not clear whether all supported compilers provide an implementation of sprintf/strtod that supports roundtripping so we may need to disable some of these tests in the future. --- tests/test_dom_modify.cpp | 84 ++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 11 deletions(-) diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index 70cba53..1fb9dd3 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -2,6 +2,7 @@ #include #include +#include TEST_XML(dom_attr_assign, "") { @@ -99,6 +100,17 @@ TEST_XML(dom_attr_set_value_llong, "") } #endif +TEST_XML(dom_attr_assign_large_number, "") +{ + xml_node node = doc.child(STR("node")); + + node.attribute(STR("attr1")) = std::numeric_limits::max(); + node.attribute(STR("attr2")) = std::numeric_limits::max(); + + CHECK(test_node(node, STR(""), STR(""), pugi::format_raw) || + test_node(node, STR(""), STR(""), pugi::format_raw)); +} + TEST_XML(dom_node_set_name, "text") { CHECK(doc.child(STR("node")).set_name(STR("n"))); @@ -752,17 +764,6 @@ TEST_XML_FLAGS(dom_node_copy_types, "pcdatapcdata")); } -TEST_XML(dom_attr_assign_large_number, "") -{ - xml_node node = doc.child(STR("node")); - - node.attribute(STR("attr1")) = std::numeric_limits::max(); - node.attribute(STR("attr2")) = std::numeric_limits::max(); - - CHECK(test_node(node, STR(""), STR(""), pugi::format_raw) || - test_node(node, STR(""), STR(""), pugi::format_raw)); -} - TEST(dom_node_declaration_name) { xml_document doc; @@ -1444,3 +1445,64 @@ TEST(dom_node_copy_declaration_empty_name) CHECK_STRING(decl2.name(), STR("")); } + +TEST(dom_fp_roundtrip_min_max) +{ + xml_document doc; + xml_node node = doc.append_child(STR("node")); + xml_attribute attr = node.append_attribute(STR("attr")); + + node.text().set(std::numeric_limits::min()); + CHECK(node.text().as_float() == std::numeric_limits::min()); + + attr.set_value(std::numeric_limits::max()); + CHECK(attr.as_float() == std::numeric_limits::max()); + + attr.set_value(std::numeric_limits::min()); + CHECK(attr.as_double() == std::numeric_limits::min()); + + node.text().set(std::numeric_limits::max()); + CHECK(node.text().as_double() == std::numeric_limits::max()); +} + +const double fp_roundtrip_base[] = +{ + 0.31830988618379067154, + 0.43429448190325182765, + 0.57721566490153286061, + 0.69314718055994530942, + 0.70710678118654752440, + 0.78539816339744830962, +}; + +TEST(dom_fp_roundtrip_float) +{ + xml_document doc; + + for (int e = -125; e <= 128; ++e) + { + for (size_t i = 0; i < sizeof(fp_roundtrip_base) / sizeof(fp_roundtrip_base[0]); ++i) + { + float value = ldexpf(fp_roundtrip_base[i], e); + + doc.text().set(value); + CHECK(doc.text().as_float() == value); + } + } +} + +TEST(dom_fp_roundtrip_double) +{ + xml_document doc; + + for (int e = -1021; e <= 1024; ++e) + { + for (size_t i = 0; i < sizeof(fp_roundtrip_base) / sizeof(fp_roundtrip_base[0]); ++i) + { + double value = ldexp(fp_roundtrip_base[i], e); + + doc.text().set(value); + CHECK(doc.text().as_double() == value); + } + } +} From 8e95f0d88947631162f5ed1fc5427b414425604b Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 16 Jan 2015 21:43:57 -0800 Subject: [PATCH 10/10] docs: Add missing float setters to reference Also fix the float/double member order in the header file. --- docs/manual.qbk | 8 ++++++++ src/pugixml.hpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/manual.qbk b/docs/manual.qbk index 20305cf..f0ee852 100644 --- a/docs/manual.qbk +++ b/docs/manual.qbk @@ -1190,6 +1190,7 @@ In addition to string functions, several functions are provided for handling att bool xml_attribute::set_value(int rhs); bool xml_attribute::set_value(unsigned int rhs); bool xml_attribute::set_value(double rhs); + bool xml_attribute::set_value(float rhs); bool xml_attribute::set_value(bool rhs); bool xml_attribute::set_value(long long rhs); bool xml_attribute::set_value(unsigned long long rhs); @@ -1208,6 +1209,7 @@ For convenience, all `set_value` functions have the corresponding assignment ope xml_attribute& xml_attribute::operator=(int rhs); xml_attribute& xml_attribute::operator=(unsigned int 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); @@ -1312,6 +1314,7 @@ In addition to a string function, several functions are provided for handling te bool xml_text::set(int rhs); bool xml_text::set(unsigned int rhs); bool xml_text::set(double rhs); + bool xml_text::set(float rhs); bool xml_text::set(bool rhs); bool xml_text::set(long long rhs); bool xml_text::set(unsigned long long rhs); @@ -1326,6 +1329,7 @@ For convenience, all `set` functions have the corresponding assignment operators xml_text& xml_text::operator=(int rhs); xml_text& xml_text::operator=(unsigned int rhs); xml_text& xml_text::operator=(double rhs); + xml_text& xml_text::operator=(float rhs); xml_text& xml_text::operator=(bool rhs); xml_text& xml_text::operator=(long long rhs); xml_text& xml_text::operator=(unsigned long long rhs); @@ -2369,6 +2373,7 @@ Classes: * `bool `[link xml_attribute::set_value set_value]`(int rhs);` * `bool `[link xml_attribute::set_value set_value]`(unsigned int rhs);` * `bool `[link xml_attribute::set_value set_value]`(double rhs);` + * `bool `[link xml_attribute::set_value set_value]`(float rhs);` * `bool `[link xml_attribute::set_value set_value]`(bool rhs);` * `bool `[link xml_attribute::set_value set_value]`(long long rhs);` * `bool `[link xml_attribute::set_value set_value]`(unsigned long long rhs);` @@ -2378,6 +2383,7 @@ Classes: * `xml_attribute& `[link xml_attribute::assign operator=]`(int rhs);` * `xml_attribute& `[link xml_attribute::assign operator=]`(unsigned int rhs);` * `xml_attribute& `[link xml_attribute::assign operator=]`(double rhs);` + * `xml_attribute& `[link xml_attribute::assign operator=]`(float rhs);` * `xml_attribute& `[link xml_attribute::assign operator=]`(bool rhs);` * `xml_attribute& `[link xml_attribute::assign operator=]`(long long rhs);` * `xml_attribute& `[link xml_attribute::assign operator=]`(unsnigned long long rhs);` @@ -2608,6 +2614,7 @@ Classes: * `bool `[link xml_text::set set]`(int rhs);` * `bool `[link xml_text::set set]`(unsigned int rhs);` * `bool `[link xml_text::set set]`(double rhs);` + * `bool `[link xml_text::set set]`(float rhs);` * `bool `[link xml_text::set set]`(bool rhs);` * `bool `[link xml_text::set set]`(long long rhs);` * `bool `[link xml_text::set set]`(unsigned long long rhs);` @@ -2617,6 +2624,7 @@ Classes: * `xml_text& `[link xml_text::assign operator=]`(int rhs);` * `xml_text& `[link xml_text::assign operator=]`(unsigned int rhs);` * `xml_text& `[link xml_text::assign operator=]`(double rhs);` + * `xml_text& `[link xml_text::assign operator=]`(float rhs);` * `xml_text& `[link xml_text::assign operator=]`(bool rhs);` * `xml_text& `[link xml_text::assign operator=]`(long long rhs);` * `xml_text& `[link xml_text::assign operator=]`(unsigned long long rhs);` diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 91e1f2e..9798b46 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -695,8 +695,8 @@ namespace pugi // Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false") bool set(int rhs); bool set(unsigned int rhs); - bool set(float rhs); bool set(double rhs); + bool set(float rhs); bool set(bool rhs); #ifdef PUGIXML_HAS_LONG_LONG