diff options
author | Alex Zolotarev <alex@maps.me> | 2016-01-05 20:33:48 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:04:16 +0300 |
commit | 03c2b9c98019aadacc2d8a514a4167dcd0c711f1 (patch) | |
tree | cb0466e566436427bead4b79529b9160acbdb9b0 /3party | |
parent | 96f0b92a4fb30c89d7ce2f34bd7477356b99a8a3 (diff) |
[3party] Fixed pugixml compile error on Linux.
Diffstat (limited to '3party')
-rwxr-xr-x | 3party/pugixml/src/pugixml.cpp | 72 | ||||
-rwxr-xr-x | 3party/pugixml/src/pugixml.hpp | 8 |
2 files changed, 80 insertions, 0 deletions
diff --git a/3party/pugixml/src/pugixml.cpp b/3party/pugixml/src/pugixml.cpp index a53ff4d592..3d0166d07f 100755 --- a/3party/pugixml/src/pugixml.cpp +++ b/3party/pugixml/src/pugixml.cpp @@ -4526,6 +4526,26 @@ PUGI__NS_BEGIN } template <typename String, typename Header> + PUGI__FN bool set_value_convert(String& dest, Header& header, uintptr_t header_mask, long value) + { + char_t buf[64]; + char_t* end = buf + sizeof(buf) / sizeof(buf[0]); + char_t* begin = integer_to_string<unsigned long>(buf, end, value, value < 0); + + return strcpy_insitu(dest, header, header_mask, begin, end - begin); + } + + template <typename String, typename Header> + PUGI__FN bool set_value_convert(String& dest, Header& header, uintptr_t header_mask, unsigned long value) + { + char_t buf[64]; + char_t* end = buf + sizeof(buf) / sizeof(buf[0]); + char_t* begin = integer_to_string<unsigned long>(buf, end, value, false); + + return strcpy_insitu(dest, header, header_mask, begin, end - begin); + } + + template <typename String, typename Header> PUGI__FN bool set_value_convert(String& dest, Header& header, uintptr_t header_mask, float value) { char buf[128]; @@ -5129,6 +5149,18 @@ namespace pugi return *this; } + PUGI__FN xml_attribute& xml_attribute::operator=(long rhs) + { + set_value(rhs); + return *this; + } + + PUGI__FN xml_attribute& xml_attribute::operator=(unsigned long rhs) + { + set_value(rhs); + return *this; + } + PUGI__FN xml_attribute& xml_attribute::operator=(double rhs) { set_value(rhs); @@ -5189,6 +5221,20 @@ 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(long 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(unsigned long 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(double rhs) { if (!_attr) return false; @@ -6322,6 +6368,20 @@ 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(long 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(unsigned long 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(float rhs) { xml_node_struct* dn = _data_new(); @@ -6377,6 +6437,18 @@ namespace pugi return *this; } + PUGI__FN xml_text& xml_text::operator=(long rhs) + { + set(rhs); + return *this; + } + + PUGI__FN xml_text& xml_text::operator=(unsigned long rhs) + { + set(rhs); + return *this; + } + PUGI__FN xml_text& xml_text::operator=(double rhs) { set(rhs); diff --git a/3party/pugixml/src/pugixml.hpp b/3party/pugixml/src/pugixml.hpp index 9f7c3fbcf3..2974bf0f0f 100755 --- a/3party/pugixml/src/pugixml.hpp +++ b/3party/pugixml/src/pugixml.hpp @@ -354,6 +354,8 @@ namespace pugi // Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false") 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); @@ -367,6 +369,8 @@ namespace pugi 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); @@ -701,6 +705,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(long rhs); + bool set(unsigned long rhs); bool set(double rhs); bool set(float rhs); bool set(bool rhs); @@ -714,6 +720,8 @@ namespace pugi 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); |