|
static bool | tryParseUnit (const std::string &input, Poco::Timespan::TimeDiff &multiplier) |
|
static bool | tryParse (const std::string &input, Poco::Timespan ×pan) |
|
static Poco::Timespan | parse (const std::string &input) |
|
Timespan TimespanParser::parse |
( |
const std::string & |
input | ) |
|
|
static |
Parse the given value expecting it to be a timespan specification. In case of an invalid input, it throws a SyntaxException.
- Exceptions
-
bool TimespanParser::tryParse |
( |
const std::string & |
input, |
|
|
Poco::Timespan & |
timespan |
|
) |
| |
|
static |
Parse the given value expecting it to be a timespan specification. Example inputs:
- 10 s (10 seconds)
- 5 h (5 hours)
- 128 us (128 microseconds)
- See Also
- TimespanParser::tryParseUnit()
- Returns
- true if the parsing has been successful
bool TimespanParser::tryParseUnit |
( |
const std::string & |
input, |
|
|
Poco::Timespan::TimeDiff & |
multiplier |
|
) |
| |
|
static |
Parse the time unit: h (hour), d (day), m (minute), s (second), ms (millisecond), us (microsecond). The result is the multiplier to obtain microseconds. E.g. tryParseUnit("s", m)
leads to m == 1000000
(the number of microseconds in a second).
When no explicit unit is given, the assumed unit is microseconds.
- Returns
- true if the parsing has been successful
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/beeeon-gateway-master/base/src/util/TimespanParser.h
- /var/lib/jenkins/workspace/beeeon-gateway-master/base/src/util/TimespanParser.cpp