decode overloads
Synopses
Declared in <baljsn_decoder.h>
Decode an object of (template parameter) TYPE from the specified stream and load the result into the specified modifiable value. Return 0 on success, and a non‐zero value otherwise. Note that stream will be invalidated if the decoding fails.
template<class TYPE>
int
decode(
std::istream& stream,
TYPE* value);
Decode an object of (template parameter) TYPE from the specified streamBuf and load the result into the specified modifiable value. Return 0 on success, and a non‐zero value otherwise.
template<class TYPE>
int
decode(
std::streambuf* streamBuf,
TYPE* value);
Decode into the specified value, of a (template parameter) TYPE, the JSON data read from the specified stream and using the specified options. TYPE shall be a bdeat‐compatible sequence, choice, or array type, or a bdeat‐compatible dynamic type referring to one of those types. Specifying a nullptr options is equivalent to passing a default‐constructed DecoderOptions in options. Return 0 on success, and a non‐zero value otherwise. Note that this operation internally buffers input from stream, and if decoding is successful, will attempt to update the input position of stream to the last unprocessed byte.
template<class TYPE>
int
decode(
std::istream& stream,
TYPE* value,
DecoderOptions const& options);
Same as the preceding overload, accepting a nullable options pointer.
template<class TYPE>
int
decode(
std::istream& stream,
TYPE* value,
DecoderOptions const* options);
Decode into the specified value, of a (template parameter) TYPE, the JSON data read from the specified streamBuf and using the specified options. Specifying a nullptr options is equivalent to passing a default‐constructed DecoderOptions in options. TYPE shall be a bdeat‐compatible sequence, choice, or array type, or a bdeat‐compatible dynamic type referring to one of those types. Return 0 on success, and a non‐zero value otherwise. Note that this operation internally buffers input from streambuf, and if decoding is successful, will attempt to update the input position of streambuf to the last unprocessed byte.
template<class TYPE>
int
decode(
std::streambuf* streamBuf,
TYPE* value,
DecoderOptions const& options);
Same as the preceding overload, accepting a nullable options pointer.
template<class TYPE>
int
decode(
std::streambuf* streamBuf,
TYPE* value,
DecoderOptions const* options);
Created with MrDocs