Quick Links: |
#include <bdlt_iso8601util.h>
Public Types | |
enum | { k_DATE_STRLEN = 10, k_DATETZ_STRLEN = 16, k_TIME_STRLEN = 15, k_TIMETZ_STRLEN = 21, k_DATETIME_STRLEN = 26, k_DATETIMETZ_STRLEN = 32, k_TIMEINTERVAL_STRLEN = 38, k_MAX_STRLEN = k_TIMEINTERVAL_STRLEN, BDEPU_DATE_STRLEN = k_DATE_STRLEN, BDEPU_DATETIME_STRLEN = k_DATETIME_STRLEN, BDEPU_DATETIMETZ_STRLEN = k_DATETIMETZ_STRLEN, BDEPU_DATETZ_STRLEN = k_DATETZ_STRLEN, BDEPU_TIME_STRLEN = k_TIME_STRLEN, BDEPU_TIMETZ_STRLEN = k_TIMETZ_STRLEN, BDEPU_MAX_DATETIME_STRLEN = k_MAX_STRLEN, DATE_STRLEN = k_DATE_STRLEN, DATETIME_STRLEN = k_DATETIME_STRLEN, DATETIMETZ_STRLEN = k_DATETIMETZ_STRLEN, DATETZ_STRLEN = k_DATETZ_STRLEN, TIME_STRLEN = k_TIME_STRLEN, TIMETZ_STRLEN = k_TIMETZ_STRLEN, MAX_DATETIME_STRLEN = k_MAX_STRLEN } |
typedef bdlb::Variant2< Date, DateTz > | DateOrDateTz |
typedef bdlb::Variant2< Time, TimeTz > | TimeOrTimeTz |
typedef bdlb::Variant2 < Datetime, DatetimeTz > | DatetimeOrDatetimeTz |
Static Public Member Functions | |
static int | generate (char *buffer, int bufferLength, const bsls::TimeInterval &object) |
static int | generate (char *buffer, int bufferLength, const bsls::TimeInterval &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const Date &object) |
static int | generate (char *buffer, int bufferLength, const Date &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const Time &object) |
static int | generate (char *buffer, int bufferLength, const Time &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const Datetime &object) |
static int | generate (char *buffer, int bufferLength, const Datetime &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const DateTz &object) |
static int | generate (char *buffer, int bufferLength, const DateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const TimeTz &object) |
static int | generate (char *buffer, int bufferLength, const TimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const DatetimeTz &object) |
static int | generate (char *buffer, int bufferLength, const DatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const DateOrDateTz &object) |
static int | generate (char *buffer, int bufferLength, const DateOrDateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const TimeOrTimeTz &object) |
static int | generate (char *buffer, int bufferLength, const TimeOrTimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (char *buffer, int bufferLength, const DatetimeOrDatetimeTz &object) |
static int | generate (char *buffer, int bufferLength, const DatetimeOrDatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const bsls::TimeInterval &object) |
static int | generate (bsl::string *string, const bsls::TimeInterval &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const Date &object) |
static int | generate (bsl::string *string, const Date &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const Time &object) |
static int | generate (bsl::string *string, const Time &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const Datetime &object) |
static int | generate (bsl::string *string, const Datetime &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const DateTz &object) |
static int | generate (bsl::string *string, const DateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const TimeTz &object) |
static int | generate (bsl::string *string, const TimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const DatetimeTz &object) |
static int | generate (bsl::string *string, const DatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const DateOrDateTz &object) |
static int | generate (bsl::string *string, const DateOrDateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const TimeOrTimeTz &object) |
static int | generate (bsl::string *string, const TimeOrTimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (bsl::string *string, const DatetimeOrDatetimeTz &object) |
static int | generate (bsl::string *string, const DatetimeOrDatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const bsls::TimeInterval &object) |
static int | generate (std::string *string, const bsls::TimeInterval &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const Date &object) |
static int | generate (std::string *string, const Date &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const Time &object) |
static int | generate (std::string *string, const Time &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const Datetime &object) |
static int | generate (std::string *string, const Datetime &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const DateTz &object) |
static int | generate (std::string *string, const DateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const TimeTz &object) |
static int | generate (std::string *string, const TimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const DatetimeTz &object) |
static int | generate (std::string *string, const DatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const DateOrDateTz &object) |
static int | generate (std::string *string, const DateOrDateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const TimeOrTimeTz &object) |
static int | generate (std::string *string, const TimeOrTimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generate (std::string *string, const DatetimeOrDatetimeTz &object) |
static int | generate (std::string *string, const DatetimeOrDatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const bsls::TimeInterval &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const bsls::TimeInterval &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const Date &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const Date &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const Time &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const Time &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const Datetime &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const Datetime &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const DateTz &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const DateTz &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const TimeTz &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const TimeTz &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const DatetimeTz &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const DatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const DateOrDateTz &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const DateOrDateTz &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const TimeOrTimeTz &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const TimeOrTimeTz &object, const Iso8601UtilConfiguration &configuration) |
static bsl::ostream & | generate (bsl::ostream &stream, const DatetimeOrDatetimeTz &object) |
static bsl::ostream & | generate (bsl::ostream &stream, const DatetimeOrDatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const bsls::TimeInterval &object) |
static int | generateRaw (char *buffer, const bsls::TimeInterval &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const Date &object) |
static int | generateRaw (char *buffer, const Date &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const Time &object) |
static int | generateRaw (char *buffer, const Time &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const Datetime &object) |
static int | generateRaw (char *buffer, const Datetime &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const DateTz &object) |
static int | generateRaw (char *buffer, const DateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const TimeTz &object) |
static int | generateRaw (char *buffer, const TimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const DatetimeTz &object) |
static int | generateRaw (char *buffer, const DatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const DateOrDateTz &object) |
static int | generateRaw (char *buffer, const DateOrDateTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const TimeOrTimeTz &object) |
static int | generateRaw (char *buffer, const TimeOrTimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | generateRaw (char *buffer, const DatetimeOrDatetimeTz &object) |
static int | generateRaw (char *buffer, const DatetimeOrDatetimeTz &object, const Iso8601UtilConfiguration &configuration) |
static int | parse (bsls::TimeInterval *result, const char *string, int length) |
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 (DateOrDateTz *result, const char *string, int length) |
static int | parse (TimeOrTimeTz *result, const char *string, int length) |
static int | parse (DatetimeOrDatetimeTz *result, const char *string, int length) |
static int | parse (bsls::TimeInterval *result, const bsl::string_view &string) |
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) |
static int | parse (DateOrDateTz *result, const bsl::string_view &string) |
static int | parse (TimeOrTimeTz *result, const bsl::string_view &string) |
static int | parse (DatetimeOrDatetimeTz *result, const bsl::string_view &string) |
static int | parseRelaxed (Datetime *result, const char *string, int length) |
static int | parseRelaxed (DatetimeTz *result, const char *string, int length) |
static int | parseRelaxed (DatetimeOrDatetimeTz *result, const char *string, int length) |
static int | parseRelaxed (Datetime *result, const bsl::string_view &string) |
static int | parseRelaxed (DatetimeTz *result, const bsl::string_view &string) |
static int | parseRelaxed (DatetimeOrDatetimeTz *result, const bsl::string_view &string) |
static int | generate (char *buffer, const Date &object, int bufferLength) |
static int | generate (char *buffer, const Time &object, int bufferLength) |
static int | generate (char *buffer, const Datetime &object, int bufferLength) |
static int | generate (char *buffer, const DateTz &object, int bufferLength) |
static int | generate (char *buffer, const TimeTz &object, int bufferLength) |
static int | generate (char *buffer, const DatetimeTz &object, int bufferLength) |
static int | generate (char *buffer, const DateTz &object, int bufferLength, bool useZAbbreviationForUtc) |
static int | generate (char *buffer, const TimeTz &object, int bufferLength, bool useZAbbreviationForUtc) |
static int | generate (char *buffer, const DatetimeTz &object, int bufferLength, bool useZAbbreviationForUtc) |
static bsl::ostream & | generate (bsl::ostream &stream, const DateTz &object, bool useZAbbreviationForUtc) |
static bsl::ostream & | generate (bsl::ostream &stream, const TimeTz &object, bool useZAbbreviationForUtc) |
static bsl::ostream & | generate (bsl::ostream &stream, const DatetimeTz &object, bool useZAbbreviationForUtc) |
static int | generateRaw (char *buffer, const DateTz &object, bool useZAbbreviationForUtc) |
static int | generateRaw (char *buffer, const TimeTz &object, bool useZAbbreviationForUtc) |
static int | generateRaw (char *buffer, const DatetimeTz &object, bool useZAbbreviationForUtc) |
This struct
provides a namespace for a suite of pure functions that perform conversions between objects of bdlt
vocabulary type and their ISO 8601 representations. Each generate
and generateRaw
method takes a bdlt
object (of type Date
, DateTz
, Time
, TimeTz
, Datetime
, or DatetimeTz
) and outputs its corresponding ISO 8601 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 an ISO 8601 representation.
See Component bdlt_iso8601util
anonymous enum |
This enumeration defines fixed lengths for the ISO 8601 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.
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const bsls::TimeInterval & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const bsls::TimeInterval & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const Date & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const Date & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const Time & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const Time & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const Datetime & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const Datetime & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const TimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const TimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DateOrDateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DateOrDateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const TimeOrTimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const TimeOrTimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DatetimeOrDatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
int | bufferLength, | |||
const DatetimeOrDatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
Write the ISO 8601 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 Iso8601UtilConfiguration::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).
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const bsls::TimeInterval & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const bsls::TimeInterval & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const Date & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const Date & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const Time & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const Time & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const Datetime & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const Datetime & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const TimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const TimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DateOrDateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DateOrDateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const TimeOrTimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const TimeOrTimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DatetimeOrDatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | bsl::string * | string, | |
const DatetimeOrDatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const bsls::TimeInterval & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const bsls::TimeInterval & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const Date & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const Date & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const Time & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const Time & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const Datetime & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const Datetime & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const TimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const TimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DateOrDateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DateOrDateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const TimeOrTimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const TimeOrTimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DatetimeOrDatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | std::string * | string, | |
const DatetimeOrDatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
Load the ISO 8601 representation of the specified object
into the specified string
. Optionally specify a configuration
to affect the format of the generated string. If configuration
is not supplied, the process-wide default value Iso8601UtilConfiguration::defaultConfiguration()
is used. Return the number of characters in the formatted string. The previous contents of string
(if any) are discarded.
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const bsls::TimeInterval & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const bsls::TimeInterval & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const Date & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const Date & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const Time & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const Time & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const Datetime & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const Datetime & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DateTz & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const TimeTz & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const TimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DatetimeTz & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DateOrDateTz & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DateOrDateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const TimeOrTimeTz & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const TimeOrTimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DatetimeOrDatetimeTz & | object | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DatetimeOrDatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
Write the ISO 8601 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 Iso8601UtilConfiguration::defaultConfiguration()
is used. Return a reference to stream
. Note that stream
is not null terminated.
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const bsls::TimeInterval & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const bsls::TimeInterval & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const Date & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const Date & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const Time & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const Time & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const Datetime & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const Datetime & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const TimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const TimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DateOrDateTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DateOrDateTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const TimeOrTimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const TimeOrTimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DatetimeOrDatetimeTz & | object | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DatetimeOrDatetimeTz & | object, | |||
const Iso8601UtilConfiguration & | configuration | |||
) | [static] |
Write the ISO 8601 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 Iso8601UtilConfiguration::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).
static int bdlt::Iso8601Util::parse | ( | bsls::TimeInterval * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 string
as a bsls::TimeInterval
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:
<Parsed Duration>
See "Summary of Supported ISO 8601 Duration Representations" for a complete description of this format.
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 nine digits is present in string
, it is rounded to the nearest value in nanoseconds. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | Date * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 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:
YYYY-MM-DD{(+|-)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 zone designator is present in string
, it is parsed but ignored. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | Time * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 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 zone designator is present in string
, the resulting Time
value is converted to the equivalent UTC time; if the zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | Datetime * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 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:
YYYY-MM-DDThh: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 zone designator is present in string
, the resulting Datetime
value is converted to the equivalent UTC value; if the zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | DateTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 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:
YYYY-MM-DD{(+|-)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 zone designator is not present in string
, UTC is assumed. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | TimeTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 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 zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | DatetimeTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 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:
YYYY-MM-DDThh: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 zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | DateOrDateTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 string
as a Date
or DateTz
value, depending on the presence of a zone designator, 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:
YYYY-MM-DD{(+|-)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 zone designator is present in the string
, the input is parsed as a DateTz
value, and as a Date
value otherwise. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | TimeOrTimeTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 string
as a Time
or TimeTz
value, depending on the presence of a zone designator, 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 zone designator is present in the string
, the input is parsed as a TimeTz
value, and as a Time
value otherwise. 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | DatetimeOrDatetimeTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified ISO 8601 string
as a Datetime
or DatetimeTz
value, depending on the presence of a zone designator, 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:
YYYY-MM-DDThh: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 zone designator is present in the string
, the input is parsed as a DatetimeTz
value, and as a Datetime
value otherwise. 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | bsls::TimeInterval * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 string
as a bsls::TimeInterval
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:
<Parsed Duration>
See "Summary of Supported ISO 8601 Duration Representations" for a complete description of this format.
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 nine digits is present in string
, it is rounded to the nearest value in nanoseconds. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parse | ( | Date * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 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:
YYYY-MM-DD{(+|-)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 zone designator is present in string
, it is parsed but ignored. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | Time * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 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 zone designator is present in string
, the resulting Time
value is converted to the equivalent UTC time; if the zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | Datetime * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 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:
YYYY-MM-DDThh: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 zone designator is present in string
, the resulting Datetime
value is converted to the equivalent UTC value; if the zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | DateTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 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:
YYYY-MM-DD{(+|-)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 zone designator is not present in string
, UTC is assumed. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | TimeTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 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 zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | DatetimeTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 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:
YYYY-MM-DDThh: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 zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | DateOrDateTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 string
as a Date
or DateTz
value, depending on the presence of a zone designator, 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:
YYYY-MM-DD{(+|-)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 zone designator is present in the string
, the input is parsed as a DateTz
value, and as a Date
value otherwise. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | TimeOrTimeTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 string
as a Time
or TimeTz
value, depending on the presence of a zone designator, 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 zone designator is present in the string
, the input is parsed as a TimeTz
value, and as a Time
value otherwise. 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parse | ( | DatetimeOrDatetimeTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified ISO 8601 string
as a Datetime
or DatetimeTz
value, depending on the presence of a zone designator, 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:
YYYY-MM-DDThh: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 zone designator is present in the string
, the input is parsed as a DatetimeTz
value, and as a Datetime
value otherwise. 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parseRelaxed | ( | Datetime * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified "relaxed" ISO 8601 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:
YYYY-MM-DD(T| )hh:mm:ss{(.|,)s+}{(+|-)hh{:}mm|Z}
The "relaxed" format parsed by this function is a superset of the strict ISO 8601 format, currently allowing a SPACE character to be used as a separated (where ISO 8601 requires a T
). 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 zone designator is present in string
, the resulting Datetime
value is converted to the equivalent UTC value; if the zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parseRelaxed | ( | DatetimeTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified "relaxed" ISO 8601 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:
YYYY-MM-DD(T| )hh:mm:ss{(.|,)s+}{(+|-)hh{:}mm|Z}
The "relaxed" format parsed by this function is a superset of the strict ISO 8601 format, currently allowing a SPACE character to be used as a separated (where ISO 8601 requires a T
). 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 zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parseRelaxed | ( | DatetimeOrDatetimeTz * | result, | |
const char * | string, | |||
int | length | |||
) | [static] |
Parse the specified initial length
characters of the specified "relaxed" ISO 8601 string
as a Datetime
or DatetimeTz
value, depending on the presence of a zone designator, 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:
YYYY-MM-DD(T| )hh:mm:ss{(.|,)s+}{(+|-)hh{:}mm|Z}
The "relaxed" format parsed by this function is a superset of the strict ISO 8601 format, currently allowing a SPACE character to be used as a separated (where ISO 8601 requires a T
). 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 zone designator is present in the string
, the input is parsed as a DatetimeTz
value, and as a Datetime
value otherwise. 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless 0 <= length
.
static int bdlt::Iso8601Util::parseRelaxed | ( | Datetime * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified "relaxed" ISO 8601 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:
YYYY-MM-DD(T| )hh:mm:ss{(.|,)s+}{(+|-)hh{:}mm|Z}
The "relaxed" format parsed by this function is a superset of the strict ISO 8601 format, currently allowing a SPACE character to be used as a separated (where ISO 8601 requires a T
). 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 zone designator is present in string
, the resulting Datetime
value is converted to the equivalent UTC value; if the zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parseRelaxed | ( | DatetimeTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified "relaxed" ISO 8601 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:
YYYY-MM-DD(T| )hh:mm:ss{(.|,)s+}{(+|-)hh{:}mm|Z}
The "relaxed" format parsed by this function is a superset of the strict ISO 8601 format, currently allowing a SPACE character to be used as a separated (where ISO 8601 requires a T
). 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 zone designator 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::parseRelaxed | ( | DatetimeOrDatetimeTz * | result, | |
const bsl::string_view & | string | |||
) | [static] |
Parse the specified "relaxed" ISO 8601 string
as a Datetime
or DatetimeTz
value, depending on the presence of a zone designator, 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:
YYYY-MM-DD(T| )hh:mm:ss{(.|,)s+}{(+|-)hh{:}mm|Z}
The "relaxed" format parsed by this function is a superset of the strict ISO 8601 format, currently allowing a SPACE character to be used as a separated (where ISO 8601 requires a T
). 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 zone designator is present in the string
, the input is parsed as a DatetimeTz
value, and as a Datetime
value otherwise. 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. If the "hh:mm:ss" portion of string
is "24:00:00", then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC. The behavior is undefined unless string.data()
is non-null.
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const Date & | object, | |||
int | bufferLength | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const Time & | object, | |||
int | bufferLength | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const Datetime & | object, | |||
int | bufferLength | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const DateTz & | object, | |||
int | bufferLength | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const TimeTz & | object, | |||
int | bufferLength | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const DatetimeTz & | object, | |||
int | bufferLength | |||
) | [static] |
DEPRECATED: Use the overloads taking the bufferLength
argument before the object
argument instead.
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const DateTz & | object, | |||
int | bufferLength, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const TimeTz & | object, | |||
int | bufferLength, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
static int bdlt::Iso8601Util::generate | ( | char * | buffer, | |
const DatetimeTz & | object, | |||
int | bufferLength, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
DEPRECATED: Use the overloads taking an Iso8601UtilConfiguration
object instead.
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DateTz & | object, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const TimeTz & | object, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
static bsl::ostream& bdlt::Iso8601Util::generate | ( | bsl::ostream & | stream, | |
const DatetimeTz & | object, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
DEPRECATED: Use the overloads taking an Iso8601UtilConfiguration
object instead.
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DateTz & | object, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const TimeTz & | object, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
static int bdlt::Iso8601Util::generateRaw | ( | char * | buffer, | |
const DatetimeTz & | object, | |||
bool | useZAbbreviationForUtc | |||
) | [static] |
DEPRECATED: Use the overloads taking an Iso8601UtilConfiguration
object instead.