From 2f8c895f510229baacf07ee55074267dc6b7d30a Mon Sep 17 00:00:00 2001 From: rylek Date: Thu, 7 Oct 2010 08:39:26 +0000 Subject: [PATCH] .TCore: DoubleXml / XmlDouble utility functions git-svn-id: svn://ultimatepp.org/upp/trunk@2753 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/TCore/util.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/uppsrc/TCore/util.cpp b/uppsrc/TCore/util.cpp index 894ed6454..568923037 100644 --- a/uppsrc/TCore/util.cpp +++ b/uppsrc/TCore/util.cpp @@ -1357,6 +1357,11 @@ void IntXml(StringBuffer& xml, const char *tag, int value) xml << '<' << tag << '>' << value << "\n"; } +void DoubleXml(StringBuffer& xml, const char *tag, double value) +{ + xml << '<' << tag << '>' << FormatDoubleExp(value, 16) << "\n"; +} + void BoolXml(StringBuffer& xml, const char *tag, bool b) { xml << '<' << tag << '>' << (b ? "1" : "0") << "\n"; @@ -1372,4 +1377,9 @@ int XmlInt(XmlParser& xml) return ScanInt(xml.ReadTextE()); } +double XmlDouble(XmlParser& xml) +{ + return ScanDouble(xml.ReadTextE()); +} + END_UPP_NAMESPACE