Parse a FIX time string_view into a Time.

Synopsis

Declared in <bdlt_fixutil.h>

static
int
parse(
    Time* result,
    std::string_view const& string);

Description

Parse the specified FIX string as a Time value, and load the value into the specified result. Return 0 on success, and a non‐zero value (with no effect) otherwise. string is assumed to be of the form: ` hh:mm{:ss{.s+}}{(+|‐)hh{:mm}|Z} ` Exactly string.length() characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire string.length() characters do not. If an optional fractional second having more than six digits is present in string, it is rounded to the nearest value in microseconds. If the optional timezone offset is present in string, the resulting Time value is converted to the equivalent UTC time; if the timezone offset is absent, UTC is assumed. If a leap second is detected (i.e., the parsed value of the second attribute is 60; see {Leap Seconds}), the second attribute is taken to be 59, then an additional second is added to result at the end. The behavior is undefined unless string.data() is non‐null.

Return Value

0 on success, non‐zero on failure

Parameters

Name

Description

result

destination for the parsed value

string

FIX input string

Created with MrDocs