BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlt::FixUtil Struct Reference

#include <bdlt_fixutil.h>

Public Types

enum  {
  k_DATE_STRLEN = 8 , k_DATETZ_STRLEN = 14 , k_TIME_STRLEN = 15 , k_TIMETZ_STRLEN = 14 ,
  k_DATETIME_STRLEN = 24 , k_DATETIMETZ_STRLEN = 30 , k_MAX_STRLEN = k_DATETIMETZ_STRLEN
}
 

Static Public Member Functions

static int generate (char *buffer, int bufferLength, const Date &object)
 
static int generate (char *buffer, int bufferLength, const Date &object, const FixUtilConfiguration &configuration)
 
static int generate (char *buffer, int bufferLength, const Time &object)
 
static int generate (char *buffer, int bufferLength, const Time &object, const FixUtilConfiguration &configuration)
 
static int generate (char *buffer, int bufferLength, const Datetime &object)
 
static int generate (char *buffer, int bufferLength, const Datetime &object, const FixUtilConfiguration &configuration)
 
static int generate (char *buffer, int bufferLength, const DateTz &object)
 
static int generate (char *buffer, int bufferLength, const DateTz &object, const FixUtilConfiguration &configuration)
 
static int generate (char *buffer, int bufferLength, const TimeTz &object)
 
static int generate (char *buffer, int bufferLength, const TimeTz &object, const FixUtilConfiguration &configuration)
 
static int generate (char *buffer, int bufferLength, const DatetimeTz &object)
 
static int generate (char *buffer, int bufferLength, const DatetimeTz &object, const FixUtilConfiguration &configuration)
 
static int generate (bsl::string *string, const Date &object)
 
static int generate (bsl::string *string, const Date &object, const FixUtilConfiguration &configuration)
 
static int generate (bsl::string *string, const Time &object)
 
static int generate (bsl::string *string, const Time &object, const FixUtilConfiguration &configuration)
 
static int generate (bsl::string *string, const Datetime &object)
 
static int generate (bsl::string *string, const Datetime &object, const FixUtilConfiguration &configuration)
 
static int generate (bsl::string *string, const DateTz &object)
 
static int generate (bsl::string *string, const DateTz &object, const FixUtilConfiguration &configuration)
 
static int generate (bsl::string *string, const TimeTz &object)
 
static int generate (bsl::string *string, const TimeTz &object, const FixUtilConfiguration &configuration)
 
static int generate (bsl::string *string, const DatetimeTz &object)
 
static int generate (bsl::string *string, const DatetimeTz &object, const FixUtilConfiguration &configuration)
 
static int generate (std::string *string, const Date &object)
 
static int generate (std::string *string, const Date &object, const FixUtilConfiguration &configuration)
 
static int generate (std::string *string, const Time &object)
 
static int generate (std::string *string, const Time &object, const FixUtilConfiguration &configuration)
 
static int generate (std::string *string, const Datetime &object)
 
static int generate (std::string *string, const Datetime &object, const FixUtilConfiguration &configuration)
 
static int generate (std::string *string, const DateTz &object)
 
static int generate (std::string *string, const DateTz &object, const FixUtilConfiguration &configuration)
 
static int generate (std::string *string, const TimeTz &object)
 
static int generate (std::string *string, const TimeTz &object, const FixUtilConfiguration &configuration)
 
static int generate (std::string *string, const DatetimeTz &object)
 
static int generate (std::string *string, const DatetimeTz &object, const FixUtilConfiguration &configuration)
 
static bsl::ostream & generate (bsl::ostream &stream, const Date &object)
 
static bsl::ostream & generate (bsl::ostream &stream, const Date &object, const FixUtilConfiguration &configuration)
 
static bsl::ostream & generate (bsl::ostream &stream, const Time &object)
 
static bsl::ostream & generate (bsl::ostream &stream, const Time &object, const FixUtilConfiguration &configuration)
 
static bsl::ostream & generate (bsl::ostream &stream, const Datetime &object)
 
static bsl::ostream & generate (bsl::ostream &stream, const Datetime &object, const FixUtilConfiguration &configuration)
 
static bsl::ostream & generate (bsl::ostream &stream, const DateTz &object)
 
static bsl::ostream & generate (bsl::ostream &stream, const DateTz &object, const FixUtilConfiguration &configuration)
 
static bsl::ostream & generate (bsl::ostream &stream, const TimeTz &object)
 
static bsl::ostream & generate (bsl::ostream &stream, const TimeTz &object, const FixUtilConfiguration &configuration)
 
static bsl::ostream & generate (bsl::ostream &stream, const DatetimeTz &object)
 
static bsl::ostream & generate (bsl::ostream &stream, const DatetimeTz &object, const FixUtilConfiguration &configuration)
 
static int generateRaw (char *buffer, const Date &object)
 
static int generateRaw (char *buffer, const Date &object, const FixUtilConfiguration &configuration)
 
static int generateRaw (char *buffer, const Time &object)
 
static int generateRaw (char *buffer, const Time &object, const FixUtilConfiguration &configuration)
 
static int generateRaw (char *buffer, const Datetime &object)
 
static int generateRaw (char *buffer, const Datetime &object, const FixUtilConfiguration &configuration)
 
static int generateRaw (char *buffer, const DateTz &object)
 
static int generateRaw (char *buffer, const DateTz &object, const FixUtilConfiguration &configuration)
 
static int generateRaw (char *buffer, const TimeTz &object)
 
static int generateRaw (char *buffer, const TimeTz &object, const FixUtilConfiguration &configuration)
 
static int generateRaw (char *buffer, const DatetimeTz &object)
 
static int generateRaw (char *buffer, const DatetimeTz &object, const FixUtilConfiguration &configuration)
 
static int parse (Date *result, const char *string, int length)
 
static int parse (Time *result, const char *string, int length)
 
static int parse (Datetime *result, const char *string, int length)
 
static int parse (DateTz *result, const char *string, int length)
 
static int parse (TimeTz *result, const char *string, int length)
 
static int parse (DatetimeTz *result, const char *string, int length)
 
static int parse (Date *result, const bsl::string_view &string)
 
static int parse (Time *result, const bsl::string_view &string)
 
static int parse (Datetime *result, const bsl::string_view &string)
 
static int parse (DateTz *result, const bsl::string_view &string)
 
static int parse (TimeTz *result, const bsl::string_view &string)
 
static int parse (DatetimeTz *result, const bsl::string_view &string)
 

Detailed Description

This struct provides a namespace for a suite of pure functions that perform conversions between objects of bdlt vocabulary type and their FIX representations. Each generate and generateRaw method takes a bdlt object (of type Date, DateTz, Time, TimeTz, Datetime, or DatetimeTz) and outputs its corresponding FIX representation to a user-supplied character buffer or bsl::ostream. The parse methods effect the opposite conversion in that they populate a bdlt object from the result of parsing a FIX representation.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

This enumeration defines fixed lengths for the FIX representations of date, time, and datetime values. Note that these constants do not account for the null terminator that may be produced by the generate functions taking a bufferLength argument.

Enumerator
k_DATE_STRLEN 
k_DATETZ_STRLEN 
k_TIME_STRLEN 
k_TIMETZ_STRLEN 
k_DATETIME_STRLEN 
k_DATETIMETZ_STRLEN 
k_MAX_STRLEN 

Member Function Documentation

◆ generate() [1/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const Date object 
)
inlinestatic

Write the FIX representation of the specified object to the specified stream. Optionally specify a configuration to affect the format of the generated string. If configuration is not supplied, the process-wide default value FixUtilConfiguration::defaultConfiguration() is used. Return a reference to stream. Note that stream is not null terminated.

◆ generate() [2/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const Date object,
const FixUtilConfiguration configuration 
)
inlinestatic

◆ generate() [3/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const Datetime object 
)
inlinestatic

◆ generate() [4/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const Datetime object,
const FixUtilConfiguration configuration 
)
inlinestatic

◆ generate() [5/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const DatetimeTz object 
)
inlinestatic

◆ generate() [6/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const DatetimeTz object,
const FixUtilConfiguration configuration 
)
inlinestatic

◆ generate() [7/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const DateTz object 
)
inlinestatic

◆ generate() [8/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const DateTz object,
const FixUtilConfiguration configuration 
)
inlinestatic

◆ generate() [9/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const Time object 
)
inlinestatic

◆ generate() [10/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const Time object,
const FixUtilConfiguration configuration 
)
inlinestatic

◆ generate() [11/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const TimeTz object 
)
inlinestatic

◆ generate() [12/48]

bsl::ostream & bdlt::FixUtil::generate ( bsl::ostream &  stream,
const TimeTz object,
const FixUtilConfiguration configuration 
)
inlinestatic

◆ generate() [13/48]

int bdlt::FixUtil::generate ( bsl::string string,
const Date object 
)
inlinestatic

◆ generate() [14/48]

static int bdlt::FixUtil::generate ( bsl::string string,
const Date object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [15/48]

int bdlt::FixUtil::generate ( bsl::string string,
const Datetime object 
)
inlinestatic

◆ generate() [16/48]

static int bdlt::FixUtil::generate ( bsl::string string,
const Datetime object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [17/48]

int bdlt::FixUtil::generate ( bsl::string string,
const DatetimeTz object 
)
inlinestatic

◆ generate() [18/48]

static int bdlt::FixUtil::generate ( bsl::string string,
const DatetimeTz object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [19/48]

int bdlt::FixUtil::generate ( bsl::string string,
const DateTz object 
)
inlinestatic

◆ generate() [20/48]

static int bdlt::FixUtil::generate ( bsl::string string,
const DateTz object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [21/48]

int bdlt::FixUtil::generate ( bsl::string string,
const Time object 
)
inlinestatic

◆ generate() [22/48]

static int bdlt::FixUtil::generate ( bsl::string string,
const Time object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [23/48]

int bdlt::FixUtil::generate ( bsl::string string,
const TimeTz object 
)
inlinestatic

◆ generate() [24/48]

static int bdlt::FixUtil::generate ( bsl::string string,
const TimeTz object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [25/48]

int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const Date object 
)
inlinestatic

◆ generate() [26/48]

static int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const Date object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [27/48]

int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const Datetime object 
)
inlinestatic

◆ generate() [28/48]

static int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const Datetime object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [29/48]

int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const DatetimeTz object 
)
inlinestatic

◆ generate() [30/48]

static int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const DatetimeTz object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [31/48]

int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const DateTz object 
)
inlinestatic

◆ generate() [32/48]

static int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const DateTz object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [33/48]

int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const Time object 
)
inlinestatic

◆ generate() [34/48]

static int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const Time object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [35/48]

int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const TimeTz object 
)
inlinestatic

◆ generate() [36/48]

static int bdlt::FixUtil::generate ( char *  buffer,
int  bufferLength,
const TimeTz object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [37/48]

int bdlt::FixUtil::generate ( std::string *  string,
const Date object 
)
inlinestatic

◆ generate() [38/48]

static int bdlt::FixUtil::generate ( std::string *  string,
const Date object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [39/48]

int bdlt::FixUtil::generate ( std::string *  string,
const Datetime object 
)
inlinestatic

◆ generate() [40/48]

static int bdlt::FixUtil::generate ( std::string *  string,
const Datetime object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [41/48]

int bdlt::FixUtil::generate ( std::string *  string,
const DatetimeTz object 
)
inlinestatic

◆ generate() [42/48]

static int bdlt::FixUtil::generate ( std::string *  string,
const DatetimeTz object,
const FixUtilConfiguration configuration 
)
static

Write the FIX representation of the specified object to the specified buffer of the specified bufferLength (in bytes), truncating (if necessary) to bufferLength. Optionally specify a configuration to affect the format of the generated string. If configuration is not supplied, the process-wide default value FixUtilConfiguration::defaultConfiguration() is used. Return the number of characters in the formatted string before truncation (not counting a null terminator). If bufferLength indicates sufficient capacity, buffer is null terminated. The behavior is undefined unless 0 <= bufferLength. Note that a buffer of size k_MAX_STRLEN + 1 is large enough to hold any string generated by this component (counting a null terminator, if any).

◆ generate() [43/48]

int bdlt::FixUtil::generate ( std::string *  string,
const DateTz object 
)
inlinestatic

◆ generate() [44/48]

static int bdlt::FixUtil::generate ( std::string *  string,
const DateTz object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [45/48]

int bdlt::FixUtil::generate ( std::string *  string,
const Time object 
)
inlinestatic

◆ generate() [46/48]

static int bdlt::FixUtil::generate ( std::string *  string,
const Time object,
const FixUtilConfiguration configuration 
)
static

◆ generate() [47/48]

int bdlt::FixUtil::generate ( std::string *  string,
const TimeTz object 
)
inlinestatic

◆ generate() [48/48]

static int bdlt::FixUtil::generate ( std::string *  string,
const TimeTz object,
const FixUtilConfiguration configuration 
)
static

◆ generateRaw() [1/12]

int bdlt::FixUtil::generateRaw ( char *  buffer,
const Date object 
)
inlinestatic

◆ generateRaw() [2/12]

static int bdlt::FixUtil::generateRaw ( char *  buffer,
const Date object,
const FixUtilConfiguration configuration 
)
static

◆ generateRaw() [3/12]

int bdlt::FixUtil::generateRaw ( char *  buffer,
const Datetime object 
)
inlinestatic

◆ generateRaw() [4/12]

static int bdlt::FixUtil::generateRaw ( char *  buffer,
const Datetime object,
const FixUtilConfiguration configuration 
)
static

◆ generateRaw() [5/12]

int bdlt::FixUtil::generateRaw ( char *  buffer,
const DatetimeTz object 
)
inlinestatic

◆ generateRaw() [6/12]

static int bdlt::FixUtil::generateRaw ( char *  buffer,
const DatetimeTz object,
const FixUtilConfiguration configuration 
)
static

Write the FIX representation of the specified object to the specified buffer. Optionally specify a configuration to affect the format of the generated string. If configuration is not supplied, the process-wide default value FixUtilConfiguration::defaultConfiguration() is used. Return the number of characters in the formatted string. buffer is not null terminated. The behavior is undefined unless buffer has sufficient capacity. Note that a buffer of size k_MAX_STRLEN + 1 is large enough to hold any string generated by this component (counting a null terminator, if any).

◆ generateRaw() [7/12]

int bdlt::FixUtil::generateRaw ( char *  buffer,
const DateTz object 
)
inlinestatic

◆ generateRaw() [8/12]

static int bdlt::FixUtil::generateRaw ( char *  buffer,
const DateTz object,
const FixUtilConfiguration configuration 
)
static

◆ generateRaw() [9/12]

int bdlt::FixUtil::generateRaw ( char *  buffer,
const Time object 
)
inlinestatic

◆ generateRaw() [10/12]

static int bdlt::FixUtil::generateRaw ( char *  buffer,
const Time object,
const FixUtilConfiguration configuration 
)
static

◆ generateRaw() [11/12]

int bdlt::FixUtil::generateRaw ( char *  buffer,
const TimeTz object 
)
inlinestatic

◆ generateRaw() [12/12]

static int bdlt::FixUtil::generateRaw ( char *  buffer,
const TimeTz object,
const FixUtilConfiguration configuration 
)
static

◆ parse() [1/12]

int bdlt::FixUtil::parse ( Date result,
const bsl::string_view string 
)
inlinestatic

Parse the specified FIX string as a Date 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:

YYYYMMDD{(+|-)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 the optional timezone offset is present in string, it is parsed but ignored. The behavior is undefined unless string.data() is non-null.

◆ parse() [2/12]

static int bdlt::FixUtil::parse ( Date result,
const char *  string,
int  length 
)
static

Parse the specified initial length characters of the specified FIX string as a Date 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:

YYYYMMDD{(+|-)hh{:mm}|Z}

Exactly length characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire length characters do not. If the optional timezone offset is present in string, it is parsed but ignored. The behavior is undefined unless 0 <= length.

◆ parse() [3/12]

int bdlt::FixUtil::parse ( Datetime result,
const bsl::string_view string 
)
inlinestatic

Parse the specified FIX string as a Datetime 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:

YYYYMMDD-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 Datetime value is converted to the equivalent UTC value; 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.

◆ parse() [4/12]

static int bdlt::FixUtil::parse ( Datetime result,
const char *  string,
int  length 
)
static

Parse the specified initial length characters of the specified FIX string as a Datetime 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:

YYYYMMDD-hh:mm{:ss{.s+}}{(+|-)hh{:mm}|Z}

Exactly length characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire 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 Datetime value is converted to the equivalent UTC value; 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 0 <= length.

◆ parse() [5/12]

int bdlt::FixUtil::parse ( DatetimeTz result,
const bsl::string_view string 
)
inlinestatic

Parse the specified FIX string as a DatetimeTz 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:

YYYYMMDD-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 not present in string, 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.

◆ parse() [6/12]

static int bdlt::FixUtil::parse ( DatetimeTz result,
const char *  string,
int  length 
)
static

Parse the specified initial length characters of the specified FIX string as a DatetimeTz 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:

YYYYMMDD-hh:mm{:ss{.s+}}{(+|-)hh{:mm}|Z}

Exactly length characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire 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 not present in string, 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 0 <= length.

◆ parse() [7/12]

int bdlt::FixUtil::parse ( DateTz result,
const bsl::string_view string 
)
inlinestatic

Parse the specified FIX string as a DateTz 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:

YYYYMMDD{(+|-)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 the optional timezone offset is not present in string, UTC is assumed. The behavior is undefined unless string.data() is non-null.

◆ parse() [8/12]

static int bdlt::FixUtil::parse ( DateTz result,
const char *  string,
int  length 
)
static

Parse the specified initial length characters of the specified FIX string as a DateTz 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:

YYYYMMDD{(+|-)hh{:mm}|Z}

Exactly length characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire length characters do not. If the optional timezone offset is not present in string, UTC is assumed. The behavior is undefined unless 0 <= length.

◆ parse() [9/12]

int bdlt::FixUtil::parse ( Time result,
const bsl::string_view string 
)
inlinestatic

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.

◆ parse() [10/12]

static int bdlt::FixUtil::parse ( Time result,
const char *  string,
int  length 
)
static

Parse the specified initial length characters of 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 length characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire 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 0 <= length.

◆ parse() [11/12]

int bdlt::FixUtil::parse ( TimeTz result,
const bsl::string_view string 
)
inlinestatic

Parse the specified FIX string as a TimeTz 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 not present in string, 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.

◆ parse() [12/12]

static int bdlt::FixUtil::parse ( TimeTz result,
const char *  string,
int  length 
)
static

Parse the specified initial length characters of the specified FIX string as a TimeTz 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 length characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire 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 not present in string, 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 0 <= length.


The documentation for this struct was generated from the following file: