1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Add parser to read JSON array (of histograms) into string vector

Signed-off-by: Michael Okoko <okokomichaels@outlook.com>
This commit is contained in:
Michael Okoko
2021-07-21 07:23:01 +01:00
committed by Sergei Petrunia
parent 524322ad3e
commit 6bc2df5fa4
3 changed files with 93 additions and 4 deletions

View File

@@ -282,6 +282,14 @@ int json_key_matches(json_engine_t *je, json_string_t *k);
*/
int json_read_value(json_engine_t *j);
/*
* smart_read_value() reads parses a scalar value and value length from the json engine,
* and copies them into `value` and `value_length` respectively.
* It should only be called when the json_engine state is JST_VALUE.
* If it encounters a non-scalar value (say object or array) before getting to value_len,
* such value is also read and copied into value.
*/
enum json_types smart_read_value(json_engine_t *je, const char **value, int *value_len);
/*
json_skip_key() makes parser skip the content of the current