repositories
/
lsystem3d.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a4205fb
)
Removed glibmm dependency.
author
spixx
<spixx>
Sun, 26 Nov 2006 14:33:51 +0000
(14:33 +0000)
committer
spixx
<spixx>
Sun, 26 Nov 2006 14:33:51 +0000
(14:33 +0000)
Minor cleanup.
src/xmlstructure.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/xmlstructure.cpp
b/src/xmlstructure.cpp
index 278f270cf2513e0bbaeb6c3cd33a5dfd0125fbb3..415f7036c96b185cba2f29b51f63d8ff97eba77f 100644
(file)
--- a/
src/xmlstructure.cpp
+++ b/
src/xmlstructure.cpp
@@
-19,6
+19,9
@@
+#include <cstdlib>
+
+#include <sstream>
#include <string>
#include <libxml++/attribute.h>
#include <string>
#include <libxml++/attribute.h>
@@
-27,8
+30,6
@@
#include <libxml++/nodes/node.h>
#include <libxml++/parsers/domparser.h>
#include <libxml++/nodes/node.h>
#include <libxml++/parsers/domparser.h>
-#include <glibmm/stringutils.h>
-
#include "xmlstructure.h"
using namespace std;
#include "xmlstructure.h"
using namespace std;
@@
-100,10
+101,7
@@
void XMLStructure::addString(string text)
*/
void XMLStructure::addNumber(double value)
{
*/
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()
{
*/
double XMLStructure::getNumber()
{
- // convert string -> double
- double number = Glib::Ascii::strtod(getString());
+ double number = strtod(getString().c_str(), NULL);
return number;
}
return number;
}
@@
-236,3
+233,18
@@
string XMLStructure::getAttribute(string name)
return attributeValue;
}
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();
+}