BDE 4.14.0 Production release
Loading...
Searching...
No Matches
baljsn::PrintUtil Struct Reference

#include <baljsn_printutil.h>

Public Types

typedef bdlb::Variant2< bdlt::Date, bdlt::DateTzDateOrDateTz
 
typedef bdlb::Variant2< bdlt::Time, bdlt::TimeTzTimeOrTimeTz
 
typedef bdlb::Variant2< bdlt::Datetime, bdlt::DatetimeTzDatetimeOrDatetimeTz
 

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)
 

Detailed Description

This struct provides functions for printing objects to output streams in JSON format.

Member Typedef Documentation

◆ DateOrDateTz

DateOrDateTz is a convenient alias for bdlb::Variant2<Date, DateTz>.

◆ DatetimeOrDatetimeTz

DatetimeOrDatetimeTz is a convenient alias for bdlb::Variant2<Datetime, DatetimeTz>.

◆ TimeOrTimeTz

TimeOrTimeTz is a convenient alias for bdlb::Variant2<Time, TimeTz>.

Member Function Documentation

◆ printDateAndTime()

template<class TYPE >
int baljsn::PrintUtil::printDateAndTime ( bsl::ostream &  stream,
const TYPE &  value,
const EncoderOptions options 
)
inlinestatic

Encode the specified value into JSON using ISO 8601 format and output the result to the specified stream using the specified options.

◆ printFloatingPoint()

template<class TYPE >
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.

◆ printString()

int baljsn::PrintUtil::printString ( bsl::ostream &  stream,
const bsl::string_view value 
)
inlinestatic

Encode the specified string value into JSON format and output the result to the specified stream.

◆ printValue() [1/25]

static int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
bdldfp::Decimal64  value,
const EncoderOptions options = 0 
)
static

◆ printValue() [2/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
bool  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [3/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
bsls::Types::Int64  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [4/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
bsls::Types::Uint64  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [5/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
char  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [6/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bdlt::Date value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [7/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bdlt::Datetime value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [8/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bdlt::DatetimeInterval value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [9/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bdlt::DatetimeTz value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [10/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bdlt::DateTz value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [11/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bdlt::Time value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [12/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bdlt::TimeTz value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [13/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const bsl::string_view value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [14/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const char *  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [15/25]

static int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const DateOrDateTz value,
const EncoderOptions options = 0 
)
static

◆ printValue() [16/25]

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.

◆ printValue() [17/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
const TimeOrTimeTz value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [18/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
double  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [19/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
float  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [20/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
int  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [21/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
short  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [22/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
signed char  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [23/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
unsigned char  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [24/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
unsigned int  value,
const EncoderOptions options = 0 
)
inlinestatic

◆ printValue() [25/25]

int baljsn::PrintUtil::printValue ( bsl::ostream &  stream,
unsigned short  value,
const EncoderOptions options = 0 
)
inlinestatic

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