Decode JSON from streamBuf into value using options.
Synopsis
Declared in <baljsn_decoder.h>
template<class TYPE>
int
decode(
std::streambuf* streamBuf,
TYPE* value,
DecoderOptions const& options);
Description
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.
Return Value
0 on success, and a non‐zero value otherwise
Parameters
Name |
Description |
streamBuf |
input buffer supplying JSON |
value |
object to decode into |
options |
decoding options |
Created with MrDocs