![]() |
MySQL 9.6.0
Source Code Documentation
|
A specialized service that transcodes input text from specified encoding into UTF-8 (MB4) and escapes JSON characters. More...
#include <mysql_json_encode.h>
Public Attributes | |
| const unsigned char *(* | encode )(const unsigned char *src, const unsigned char *src_end, const unsigned char *src_data_end, unsigned char *dst, unsigned char *dst_end, const CHARSET_INFO_h charset, unsigned char **dst_out) |
| Transcode input buffer (a chunk of data) into destination buffer. More... | |
A specialized service that transcodes input text from specified encoding into UTF-8 (MB4) and escapes JSON characters.
Regular encoders require that a source is placed in single buffer and the size of the output buffer cannot be determined (it must be counted). This service allows to transcode input buffer in chunks.
| const unsigned char *(* s_mysql_mysql_json_encode::encode) (const unsigned char *src, const unsigned char *src_end, const unsigned char *src_data_end, unsigned char *dst, unsigned char *dst_end, const CHARSET_INFO_h charset, unsigned char **dst_out) |
Transcode input buffer (a chunk of data) into destination buffer.
| [in] | src | Input buffer pointer. |
| [in] | src_end | When dividing input stream into smaller chunks, this pointer must be set to src_data_end - max_encoded_char - 1, where max_encoded_char is the maximum lenght of the character in the specified encoding (charset argument). This ensures that a partial character is not consumed. The last chunk should be called with src_end == src_data_end and the returned pointer should point to src_data_end. |
| [in] | src_data_end | Input buffer end pointer. |
| [in] | dst | Destination buffer. |
| [in] | dst_end | Destination buffer end. The buffer should be at least 6 buffer long (JSON encodes single character as \uXXXX), which can be a case in a single encode method call. |
| [in] | charset | Input data encoding. |
| [out] | dst_out | Pointer ending the transcoded data buffer. The pointer is not part of the transcoded data. |