BDE 4.14.0 Production release
|
#include <baljsn_parserutil.h>
Public Types | |
typedef bdlb::Variant2< bdlt::Date, bdlt::DateTz > | DateOrDateTz |
typedef bdlb::Variant2< bdlt::Time, bdlt::TimeTz > | TimeOrTimeTz |
typedef bdlb::Variant2< bdlt::Datetime, bdlt::DatetimeTz > | DatetimeOrDatetimeTz |
Static Public Member Functions | |
static int | getQuotedString (bsl::string *value, const bsl::string_view &data) |
static int | getUnquotedString (bsl::string *value, const bsl::string_view &data) |
static int | getValue (bool *value, const bsl::string_view &data) |
static int | getValue (char *value, const bsl::string_view &data) |
static int | getValue (unsigned char *value, const bsl::string_view &data) |
static int | getValue (signed char *value, const bsl::string_view &data) |
static int | getValue (short *value, const bsl::string_view &data) |
static int | getValue (unsigned short *value, const bsl::string_view &data) |
static int | getValue (int *value, const bsl::string_view &data) |
static int | getValue (unsigned int *value, const bsl::string_view &data) |
static int | getValue (bsls::Types::Int64 *value, const bsl::string_view &data) |
static int | getValue (bsls::Types::Uint64 *value, const bsl::string_view &data) |
static int | getValue (float *value, const bsl::string_view &data) |
static int | getValue (double *value, const bsl::string_view &data) |
static int | getValue (bdldfp::Decimal64 *value, const bsl::string_view &data) |
static int | getValue (bdlt::Date *value, const bsl::string_view &data) |
static int | getValue (bdlt::Datetime *value, const bsl::string_view &data) |
static int | getValue (bdlt::DatetimeTz *value, const bsl::string_view &data) |
static int | getValue (bdlt::DateTz *value, const bsl::string_view &data) |
static int | getValue (bdlt::Time *value, const bsl::string_view &data) |
static int | getValue (bdlt::TimeTz *value, const bsl::string_view &data) |
static int | getValue (DateOrDateTz *value, const bsl::string_view &data) |
static int | getValue (TimeOrTimeTz *value, const bsl::string_view &data) |
static int | getValue (DatetimeOrDatetimeTz *value, const bsl::string_view &data) |
static int | getValue (bsl::vector< char > *value, const bsl::string_view &data) |
static int | getValue (bsl::string *value, const bsl::string_view &data) |
static bool | stripQuotes (bsl::string_view *str) |
This class provides utility functions for decoding data in the JSON format into a bdeat
Simple type. The primary method is getValue
, which decodes into a specified object and is overloaded for all bdeat
Simple types.
DateOrDateTz
is a convenient alias for bdlb::Variant2<Date, DateTz>
.
DatetimeOrDatetimeTz
is a convenient alias for bdlb::Variant2<Datetime, DatetimeTz>
.
TimeOrTimeTz
is a convenient alias for bdlb::Variant2<Time, TimeTz>
.
|
inlinestatic |
Load into the specified value
the string value in the specified data
. The string must be begin and end in "
characters which are not part of the resulting value
. Return 0 on success and a non-zero value otherwise.
|
static |
Load into the specified value
the string value in the specified data
. Return 0 on success and a non-zero value otherwise.
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
Load into the specified value
the string value in the specified data
. The string must be begin and end in "
characters which are not part of the resulting value
. Return 0 on success and a non-zero value otherwise.
|
static |
Load into the specified value
the characters read from the specified data
. Return 0 on success or a non-zero value on failure.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
If the specified *str
is at least two characters long and begins and ends with quotation marks ("), then remove the first and last characters; otherwise, do not modify *str
. Return true
if *str
was modified.