Quick Links: |
#include <baljsn_printutil.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 | |
template<class TYPE > | |
static int | printDateAndTime (bsl::ostream &stream, const TYPE &value, const EncoderOptions *options) |
template<class TYPE > | |
static int | printFloatingPoint (bsl::ostream &stream, TYPE value, const EncoderOptions *options) |
static int | printString (bsl::ostream &stream, const bsl::string_view &value) |
static int | printValue (bsl::ostream &stream, bool value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, char value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, signed char value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, unsigned char value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, short value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, unsigned short value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, int value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, unsigned int value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, bsls::Types::Int64 value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, bsls::Types::Uint64 value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, float value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, double value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, bdldfp::Decimal64 value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const char *value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bsl::string_view &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bdlt::Time &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bdlt::Date &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bdlt::Datetime &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bdlt::DatetimeInterval &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bdlt::TimeTz &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bdlt::DateTz &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const bdlt::DatetimeTz &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const TimeOrTimeTz &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const DateOrDateTz &value, const EncoderOptions *options=0) |
static int | printValue (bsl::ostream &stream, const DatetimeOrDatetimeTz &value, const EncoderOptions *options=0) |
This struct
provides functions for printing objects to output streams in JSON format.
See Component baljsn_printutil
static int baljsn::PrintUtil::printDateAndTime | ( | bsl::ostream & | stream, | |
const TYPE & | value, | |||
const EncoderOptions * | options | |||
) | [static] |
Encode the specified value
into JSON using ISO 8601 format and output the result to the specified stream
using the specified options
.
static int baljsn::PrintUtil::printFloatingPoint | ( | bsl::ostream & | stream, | |
TYPE | value, | |||
const EncoderOptions * | options | |||
) | [static] |
Encode the specified floating point value
into JSON and output the result to the specified stream
. Use the optionally-specified options
to decide how value
is encoded.
static int baljsn::PrintUtil::printString | ( | bsl::ostream & | stream, | |
const bsl::string_view & | value | |||
) | [static] |
Encode the specified string value
into JSON format and output the result to the specified stream
.
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
bool | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
char | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
signed char | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
unsigned char | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
short | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
unsigned short | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
int | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
unsigned int | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
bsls::Types::Int64 | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
bsls::Types::Uint64 | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
float | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
double | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
bdldfp::Decimal64 | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const char * | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bsl::string_view & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bdlt::Time & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bdlt::Date & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bdlt::Datetime & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bdlt::DatetimeInterval & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bdlt::TimeTz & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bdlt::DateTz & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const bdlt::DatetimeTz & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const TimeOrTimeTz & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const DateOrDateTz & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
static int baljsn::PrintUtil::printValue | ( | bsl::ostream & | stream, | |
const DatetimeOrDatetimeTz & | value, | |||
const EncoderOptions * | options = 0 | |||
) | [static] |
Encode the specified value
into JSON format and output the result to the specified stream
using the optionally specified options
. Return 0 on success and a non-zero value otherwise.