+#include <cstdlib>
+
+#include <sstream>
#include <string>
#include <libxml++/attribute.h>
#include <libxml++/nodes/node.h>
#include <libxml++/parsers/domparser.h>
-#include <glibmm/stringutils.h>
-
#include "xmlstructure.h"
using namespace std;
*/
void XMLStructure::addNumber(double value)
{
- // convert double -> string
- string numberAsString = Glib::Ascii::dtostr(value);
-
- addString(numberAsString);
+ addString(doubleToString(value));
}
*/
double XMLStructure::getNumber()
{
- // convert string -> double
- double number = Glib::Ascii::strtod(getString());
+ double number = strtod(getString().c_str(), NULL);
return number;
}
return attributeValue;
}
+
+
+
+/**
+ * Convert double to string
+ * @param doubleValue the double value
+ * @return the corresponding string
+ */
+string XMLStructure::doubleToString(double doubleValue)
+{
+ ostringstream doubleAsString;
+ doubleAsString << doubleValue;
+
+ return doubleAsString.str();
+}