json_encoder_access_buffer()

QNX SDP8.0JSON Library ReferenceAPIDeveloper

Get a read/write pointer to the JSON encoder's data buffer

Synopsis:

#include <sys/json.h>
char* json_encoder_access_buffer(json_encoder_t *encoder)

Arguments:

encoder
The JSON encoder instance.

Library:

libjson

Description:

This function returns a read/write pointer to the buffer holding the encoded data for the given JSON encoder. A valid pointer is returned if there have been no errors and all objects have had their encoding properly ended. The pointer returned is not valid after any subsequent json_encoder_*() calls.

Note:

This call is not applicable to encoder instances obtained from json_decoder_get_encoder(), since JSON items encoded with these encoders are added directly to the decoder tree rather than into a JSON-formatted buffer.

Returns:

A read/write pointer to the encoded buffer, or NULL if an error status exists in the encoder, the encoded data is incomplete, or the encoder instance was obtained from json_decoder_get_encoder().

Page updated: