summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-09-17 18:02:21 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-09-17 18:02:21 +0000
commit01d8a2405191b931cc44e18ec5379e9846b45849 (patch)
tree946688782631ec9c57b9fcc7989ef7a48bd875e0 /src/pugixml.cpp
parent3a9e08becd09470d7e605795d76bf7a54fc45280 (diff)
Added xml_attribute::set_value overloads
git-svn-id: http://pugixml.googlecode.com/svn/trunk@127 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp40
1 files changed, 30 insertions, 10 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 2bb0b7b..c1797c5 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -1875,31 +1875,25 @@ namespace pugi
xml_attribute& xml_attribute::operator=(int rhs)
{
- char buf[128];
- sprintf(buf, "%d", rhs);
- set_value(buf);
+ set_value(rhs);
return *this;
}
xml_attribute& xml_attribute::operator=(unsigned int rhs)
{
- char buf[128];
- sprintf(buf, "%u", rhs);
- set_value(buf);
+ set_value(rhs);
return *this;
}
xml_attribute& xml_attribute::operator=(double rhs)
{
- char buf[128];
- sprintf(buf, "%g", rhs);
- set_value(buf);
+ set_value(rhs);
return *this;
}
xml_attribute& xml_attribute::operator=(bool rhs)
{
- set_value(rhs ? "true" : "false");
+ set_value(rhs);
return *this;
}
@@ -1925,6 +1919,32 @@ namespace pugi
return res;
}
+ bool xml_attribute::set_value(int rhs)
+ {
+ char buf[128];
+ sprintf(buf, "%d", rhs);
+ return set_value(buf);
+ }
+
+ bool xml_attribute::set_value(unsigned int rhs)
+ {
+ char buf[128];
+ sprintf(buf, "%u", rhs);
+ return set_value(buf);
+ }
+
+ bool xml_attribute::set_value(double rhs)
+ {
+ char buf[128];
+ sprintf(buf, "%g", rhs);
+ return set_value(buf);
+ }
+
+ bool xml_attribute::set_value(bool rhs)
+ {
+ return set_value(rhs ? "true" : "false");
+ }
+
#ifdef __BORLANDC__
bool operator&&(const xml_attribute& lhs, bool rhs)
{