LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Functions
LogCabin::Client::Util Namespace Reference

Functions

int64_t parseSignedDuration (const std::string &description)
 Convert a human-readable description of a time duration into a number of nanoseconds.
uint64_t parseNonNegativeDuration (const std::string &description)
 Convert a human-readable description of a time duration into a number of nanoseconds.

Function Documentation

int64_t LogCabin::Client::Util::parseSignedDuration ( const std::string &  description)

Convert a human-readable description of a time duration into a number of nanoseconds.

Parameters:
descriptionSomething like 10, 10s, -200ms, 3us, or -999ns. With no units, defaults to seconds. May be negative. Allowed units: ns, nanosecond(s), ms, millisecond(s), s, second(s), min, minute(s), h, hr, hour(s), d, day(s), w, wk, week(s), mo, month(s), y, yr, year(s).
Returns:
Number of nanoseconds (may be negative, capped to the range of a signed 64-bit integer).
Exceptions:
Client::InvalidArgumentExceptionIf description could not be parsed successfully.
Warning:
This function is subject to change. It is not subject to the versioning requirements of LogCabin's public API.

Definition at line 25 of file Util.cc.

uint64_t LogCabin::Client::Util::parseNonNegativeDuration ( const std::string &  description)

Convert a human-readable description of a time duration into a number of nanoseconds.

Parameters:
descriptionSomething like 10, 10s, 200ms, 3us, or 999ns. With no units, defaults to seconds. May not be negative. Allowed units: ns, nanosecond(s), ms, millisecond(s), s, second(s), min, minute(s), h, hr, hour(s), d, day(s), w, wk, week(s), mo, month(s), y, yr, year(s).
Returns:
Number of nanoseconds (will not be negative, capped to the range of a signed 64-bit integer on the high end).
Exceptions:
Client::InvalidArgumentExceptionIf description could not be parsed successfully.
Warning:
This function is subject to change. It is not subject to the versioning requirements of LogCabin's public API.

Definition at line 35 of file Util.cc.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines