json_encoder_reset()
QNX SDP8.0JSON Library ReferenceAPIDeveloper
Reset a JSON encoder instance
Synopsis:
#include <sys/json.h>
void json_encoder_reset(json_encoder_t *encoder,
int offset)
Arguments:
- encoder
- The JSON encoder instance.
- offset
- The offset within the encoder's buffer to position the encoder at. Typically this would be 0, but providing another value allows callers to encode multiple data sets in a single buffer.
Library:
libjsonDescription:
This function resets the given JSON encoder for encoding new data. It is typically better to call json_encoder_reset() rather than json_encoder_cleanup() when performing multiple encoding operations, to reduce memory allocation operations. This is because the encoder's buffer will automatically grow to accommodate the largest size required.
Page updated: