This class returns a number in the requested type. More...
This class returns a number in the requested type.
In case of string output this is a right adjusted string of selected length and (if possible) precision. The string is filled with leading blanks to match width.
string util::StringFactory::floatToString | ( | const T | xd, | |
const int | width, | |||
const int | precision, | |||
const char | format | |||
) | [inline, static, protected] |
Convert float/double to string
format,: | char to select the _floatfield_ format flag
|
References error_text, and factory_text.
string util::StringFactory::intToString | ( | const T | xd, | |
const int | width | |||
) | [inline, static, protected] |
References error_text, and factory_text.
static void util::StringFactory::changeFormat | ( | ostringstream & | s, | |
const char | format | |||
) | [static, protected] |
set the _floatfield_ format flag
s,: | `ostringstream` where to write | |
format,: | char to select the _floatfield_ format flag
|
static string util::StringFactory::toString | ( | const double | xd, | |
const int | width = DBL_DIG+7 , |
|||
const int | precision = DBL_DIG , |
|||
const char | format = 'd' | |||
) | [static] |
Convert number to string
format,: | (for double and float only) char to select the _floatfield_ format flag
|
static string util::StringFactory::toString | ( | const float | xd, | |
const int | width = FLT_DIG+7 , |
|||
const int | precision = FLT_DIG , |
|||
const char | format = 'd' | |||
) | [static] |
static string util::StringFactory::toString | ( | const long | xd, | |
const int | width = ((sizeof(long)*8)/3)+1 | |||
) | [static] |
static string util::StringFactory::toString | ( | const int | xd, | |
const int | width = ((sizeof(int)*8)/3)+1 | |||
) | [static] |
static string util::StringFactory::toMinSecString | ( | const double | xd, | |
const int | precision = 0 | |||
) | [static] |
Return xd in dd:mm:ss[.sss] format.
Precision gives No second decimals.
static int util::StringFactory::toInt | ( | const string & | xs | ) | [inline, static] |
Convert xs to integer number.
static long util::StringFactory::toLong | ( | const string & | xs | ) | [inline, static] |
Convert xs to long integer number.
static float util::StringFactory::toFloat | ( | const string & | xs | ) | [inline, static] |
Convert xs to float number.
dd:mm:ss[.sss] strings are automatically recognized.
References toDouble().
static double util::StringFactory::toDouble | ( | string | xs | ) | [static] |
Convert xs to double number.
dd:mm:ss[.sss] strings are automatically recognized.
Referenced by toFloat().
const string util::StringFactory::factory_text [static, protected] |
Referenced by floatToString(), and intToString().
const string util::StringFactory::error_text [static, protected] |
Referenced by floatToString(), and intToString().