Parse seconds from text, and format seconds into text.
More...
#include <epicsTimeHelper.h>
|
static bool | parse (const stdString &t, double &n, double default_factor=1.0) |
| Parse text into number. More...
|
|
static stdString | format (double seconds) |
|
Parse seconds from text, and format seconds into text.
Text may contain just the seconds, or "... seconds" or "... minutes", "... hours", "... days". Times may be abbreviated.
static stdString SecondParser::format |
( |
double |
seconds | ) |
|
|
static |
- Returns
- Seconds formatted as string, using "... min" etc. when possible.
static bool SecondParser::parse |
( |
const stdString & |
t, |
|
|
double & |
n, |
|
|
double |
default_factor = 1.0 |
|
) |
| |
|
static |
Parse text into number.
- Parameters
-
t | t |
n | n |
default_factor | Usually, we assume that a plain number without suffix represents seconds. A factor of 60*60, however, changes that default interpretation to hours. |
- Returns
- true if OK.
The documentation for this class was generated from the following file:
- /home/malitsky/projects/epics-archiver/sourceforge/trunk/ea4-cpp/include/common/tools/epicsTimeHelper.h