#include "opp_utils.h"
Namespaces | |
| namespace | OPP_Global |
Functions | |
| std::string | ltostr (long i) |
| std::string | dtostr (double d) |
| double | atod (const char *s) |
| unsigned long | atoul (const char *s) |
|
|
Converts string to double 00040 {
00041 char *e;
00042 double d = ::strtod(s,&e);
00043 if (*e)
00044 throw new cException("invalid cast: '%s' cannot be interpreted as a double", s);
00045 return d;
00046 }
|
|
|
Converts string to unsigned long 00049 {
00050 char *e;
00051 unsigned long d = ::strtoul(s,&e,10);
00052 if (*e)
00053 throw new cException("invalid cast: '%s' cannot be interpreted as an unsigned long", s);
00054 return d;
00055 }
|
|
|
Converts a double to string 00033 {
00034 std::ostringstream os;
00035 os << d;
00036 return os.str();
00037 }
|
|
|
Converts an integer to string. 00026 {
00027 std::ostringstream os;
00028 os << i;
00029 return os.str();
00030 }
|
1.4.1