BDE 4.14.0 Production release
|
#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) |
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.
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 |
|
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.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
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).
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
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).
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
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:
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.
|
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:
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
.
|
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:
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.
|
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:
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
.
|
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:
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.
|
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:
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
.
|
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:
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.
|
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:
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
.
|
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:
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.
|
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:
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
.
|
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:
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.
|
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:
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
.