- Die tortoise-svn die
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@368 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
0de370f4d3
commit
ef659927c4
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "string_utils.hh"
|
||||
|
||||
using namespace std;
|
||||
using Glib::ustring;
|
||||
|
||||
/**
|
||||
|
@ -94,4 +95,20 @@ int_to_string(const int& num, ustring& str)
|
|||
str = '-' + str;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
float_to_string(const float& f, Glib::ustring& str)
|
||||
{
|
||||
stringstream ss;
|
||||
ss << f;
|
||||
char p[20];
|
||||
ss.getline(p,20);
|
||||
str = p;
|
||||
}
|
||||
|
||||
void
|
||||
string_to_float(const Glib::ustring& str, float& f)
|
||||
{
|
||||
stringstream ss;
|
||||
ss << str;
|
||||
ss >> f;
|
||||
}
|
||||
|
|
|
@ -22,13 +22,18 @@
|
|||
#define STRING_UTILS_HH 1
|
||||
|
||||
#include "config.h"
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include "glibmm/ustring.h"
|
||||
|
||||
|
||||
bool SG_DLLEXPORT string_to_int(const Glib::ustring&, int&);
|
||||
|
||||
void SG_DLLEXPORT int_to_string(const int&, Glib::ustring&);
|
||||
|
||||
void SG_DLLEXPORT float_to_string(const float&, Glib::ustring&);
|
||||
|
||||
void SG_DLLEXPORT string_to_float(const Glib::ustring&, float&);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue