From 32f0a8bd3a5c9f3c454164f4d23289851b0de3e7 Mon Sep 17 00:00:00 2001 From: Steve Doiel Date: Tue, 6 Jan 2015 15:33:56 -0800 Subject: Add xml_text::set for float Make float/double round-trip --- src/pugixml.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pugixml.hpp') 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); -- cgit v1.2.3 From f3e42969a5118247de548c059e9bed69cdf208bb Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 9 Jan 2015 19:29:23 -0800 Subject: 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/pugixml.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/pugixml.hpp') 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 * -- cgit v1.2.3 From 4ae1940065c415223445efb23d3200d1b0b1d4a1 Mon Sep 17 00:00:00 2001 From: Steve Doiel Date: Fri, 16 Jan 2015 14:55:10 -0800 Subject: Fix attribute round trip for float as well --- src/pugixml.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pugixml.hpp') 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 -- cgit v1.2.3 From 53525a037b45ecf4dc29bf6700ad384647541da2 Mon Sep 17 00:00:00 2001 From: Steve Doiel Date: Fri, 16 Jan 2015 15:20:28 -0800 Subject: Add a couple of more overloads for floats --- src/pugixml.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pugixml.hpp') 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 -- cgit v1.2.3 From f07018f7e70d39bcfdd71882c2b8b6c510ba1955 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 16 Jan 2015 21:00:09 -0800 Subject: Convert spaces to tabs --- src/pugixml.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pugixml.hpp') 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); -- cgit v1.2.3 From 8e95f0d88947631162f5ed1fc5427b414425604b Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 16 Jan 2015 21:43:57 -0800 Subject: docs: Add missing float setters to reference Also fix the float/double member order in the header file. --- src/pugixml.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pugixml.hpp') 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 -- cgit v1.2.3