CEBL  2.1
TextUtils.cpp
Go to the documentation of this file.
1 
9 #include "TextUtils.hpp"
10 #include <boost/lexical_cast.hpp>
11 #include <sstream>
12 using namespace boost;
13 using namespace std;
14 
15 
16 namespace TextUtils
17 {
18  string IntToString(int i)
19  {
20  stringstream temp;
21  temp << i;
22  string ret = temp.str();
23  return ret;
24  }
25 
26 
27 
28  int asInt(string str)
29  {
30  return lexical_cast<int>(str);
31  }
32 
33  bool asBool(string str)
34  {
35  return lexical_cast<bool>(str);
36  }
37 
38  double asDouble(string str)
39  {
40  return lexical_cast<double>(str);
41  }
42 
43 
44 }