BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Static Public Member Functions
BeeeOn::TimespanParser Class Reference

Static Public Member Functions

static bool tryParseUnit (const std::string &input, Poco::Timespan::TimeDiff &multiplier)
 
static bool tryParse (const std::string &input, Poco::Timespan &timespan)
 
static Poco::Timespan parse (const std::string &input)
 

Member Function Documentation

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
Poco::SyntaxException
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: