Revision 59be6a47 src/stringutil.cpp

View differences:

src/stringutil.cpp
32 32
    return l;
33 33
}
34 34

  
35
string toString(bool b)
36
{
37
  if (b) return "true";
38
  else return "false";
39
}
40

  
35 41
string toString(int n)
36 42
{
37 43
    char text[64];
......
64 70
	return 0.0;
65 71
}
66 72

  
73
bool toBool(const std::string &s)
74
{
75
  if (s == "true")
76
    return true;
77
  else
78
    return false;
79
}
80

  
67 81
unsigned long toUnsignedLong(const std::string &s)
68 82
{
69 83
    istringstream input(s);

Also available in: Unified diff