From: spixx Date: Sun, 26 Nov 2006 14:33:51 +0000 (+0000) Subject: Removed glibmm dependency. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=49d6b9552ae4871e934140db8089889936bee85b;p=lsystem3d.git Removed glibmm dependency. Minor cleanup. --- diff --git a/src/xmlstructure.cpp b/src/xmlstructure.cpp index 278f270..415f703 100644 --- a/src/xmlstructure.cpp +++ b/src/xmlstructure.cpp @@ -19,6 +19,9 @@ +#include + +#include #include #include @@ -27,8 +30,6 @@ #include #include -#include - #include "xmlstructure.h" using namespace std; @@ -100,10 +101,7 @@ void XMLStructure::addString(string text) */ void XMLStructure::addNumber(double value) { - // convert double -> string - string numberAsString = Glib::Ascii::dtostr(value); - - addString(numberAsString); + addString(doubleToString(value)); } @@ -207,8 +205,7 @@ string XMLStructure::getString() */ double XMLStructure::getNumber() { - // convert string -> double - double number = Glib::Ascii::strtod(getString()); + double number = strtod(getString().c_str(), NULL); return number; } @@ -236,3 +233,18 @@ string XMLStructure::getAttribute(string name) 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(); +}