Write binary data converted to hexadecimal string representation.
MCO_RET mcorest_api_json_write_hex_string( mcorest_api_json_write_ctx_t *ctx,
const void *data,
size_t len);
| ctx | Pointer to the JSON write context structure |
| data | Data array to be written in hex string format |
| len | The length of the data array to be written in hex string format |
This function writes binary data converted to hexadecimal string representation. If the string is NULL, writes null. This is a convenience wrapper for
mcorest_api_json_write_string_begin(),mcorest_api_json_write_hex_string_part()andmcorest_api_json_write_string_end().
| MCO_S_OK = 0 | Success |
| MCO_E_REST_* | Any of the Web Services Error Codes |
static void print_hex_string(mcorest_api_json_write_ctx_t *jctx,
const char *s)
{
mcorest_api_json_write_object_begin(jctx);
mcorest_api_json_write_key(jctx, "hex_string_value");
mcorest_api_json_write_hex_string(jctx, s, strlen(s));
...
mcorest_api_json_write_object_end(jctx);
...
}