ECF 1.5
ECF_macro.h
1#ifndef ECF_macro_h
2#define ECF_macro_h
3
4#include <sstream>
5
6inline std::string uint2str(uint nNumber)
7{
8 std::ostringstream oss;
9 oss << nNumber;
10 return oss.str();
11}
12
13
14inline std::string dbl2str(double dNumber)
15{
16 std::ostringstream oss;
17 oss << dNumber;
18 return oss.str();
19}
20
21
22inline int str2int(const std::string& str)
23{
24 std::istringstream iss(str);
25 int integer;
26 iss >> integer;
27 return integer;
28}
29
30
31inline uint str2uint(const std::string& str)
32{
33 std::istringstream iss(str);
34 uint integer;
35 iss >> integer;
36 return integer;
37}
38
39
40inline double str2dbl(const std::string& str)
41{
42 std::istringstream iss(str);
43 double d;
44 iss >> d;
45 return d;
46}
47
48
49inline float str2flt(const std::string& str)
50{
51 std::istringstream iss(str);
52 float f;
53 iss >> f;
54 return f;
55}
56
57
58#endif // ECF_macro_h