|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
#include <stddef.h>#include <limits.h>#include <float.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>Go to the source code of this file.
Data Structures | |
| struct | yyjson_alc |
| struct | yyjson_read_err |
| struct | yyjson_write_err |
| struct | yyjson_arr_iter |
| struct | yyjson_obj_iter |
| struct | yyjson_mut_arr_iter |
| struct | yyjson_mut_obj_iter |
| struct | yyjson_ptr_err |
| struct | yyjson_ptr_ctx |
| struct | yyjson_patch_err |
| union | yyjson_val_uni |
| struct | yyjson_val |
| struct | yyjson_doc |
| struct | yyjson_mut_val |
| struct | yyjson_str_chunk |
| struct | yyjson_str_pool |
| struct | yyjson_val_chunk |
| struct | yyjson_val_pool |
| struct | yyjson_mut_doc |
Macros | |
| #define | YYJSON_DISABLE_READER 0 |
| #define | YYJSON_DISABLE_WRITER 0 |
| #define | YYJSON_DISABLE_INCR_READER 0 |
| #define | YYJSON_DISABLE_FILE 0 |
| #define | YYJSON_DISABLE_UTILS 0 |
| #define | YYJSON_DISABLE_FAST_FP_CONV 0 |
| #define | YYJSON_DISABLE_NON_STANDARD 0 |
| #define | YYJSON_DISABLE_UTF8_VALIDATION 0 |
| #define | YYJSON_READER_DEPTH_LIMIT 0 |
| #define | YYJSON_FREESTANDING 0 |
| #define | YYJSON_MSC_VER 0 |
| #define | YYJSON_GCC_VER 0 |
| #define | yyjson_gcc_available(major, minor, patch) |
| #define | YYJSON_IS_REAL_GCC 0 |
| #define | YYJSON_STDC_VER 0 |
| #define | YYJSON_CPP_VER 0 |
| #define | yyjson_has_builtin(x) |
| #define | yyjson_has_attribute(x) |
| #define | yyjson_has_feature(x) |
| #define | yyjson_has_include(x) |
| #define | yyjson_inline |
| #define | yyjson_noinline |
| #define | yyjson_align(x) |
| #define | yyjson_likely(expr) |
| #define | yyjson_unlikely(expr) |
| #define | yyjson_assume(expr) |
| #define | YYJSON_HAS_CONSTANT_P 0 |
| #define | yyjson_constant_p(value) |
| #define | yyjson_deprecated(msg) |
| #define | yyjson_api |
| #define | yyjson_api_inline static yyjson_inline |
| #define | yyjson_constcast(type) |
| #define | YYJSON_U64_TO_F64_NO_IMPL 0 |
| #define | __bool_true_false_are_defined 1 |
| #define | bool unsigned char |
| #define | true 1 |
| #define | false 0 |
| #define | YYJSON_VERSION_MAJOR 0 |
| #define | YYJSON_VERSION_MINOR 12 |
| #define | YYJSON_VERSION_PATCH 0 |
| #define | YYJSON_VERSION_HEX 0x000C00 |
| #define | YYJSON_VERSION_STRING "0.12.0" |
| #define | YYJSON_TYPE_NONE ((uint8_t)0) /* _____000 */ |
| #define | YYJSON_TYPE_RAW ((uint8_t)1) /* _____001 */ |
| #define | YYJSON_TYPE_NULL ((uint8_t)2) /* _____010 */ |
| #define | YYJSON_TYPE_BOOL ((uint8_t)3) /* _____011 */ |
| #define | YYJSON_TYPE_NUM ((uint8_t)4) /* _____100 */ |
| #define | YYJSON_TYPE_STR ((uint8_t)5) /* _____101 */ |
| #define | YYJSON_TYPE_ARR ((uint8_t)6) /* _____110 */ |
| #define | YYJSON_TYPE_OBJ ((uint8_t)7) /* _____111 */ |
| #define | YYJSON_SUBTYPE_NONE ((uint8_t)(0 << 3)) /* ___00___ */ |
| #define | YYJSON_SUBTYPE_FALSE ((uint8_t)(0 << 3)) /* ___00___ */ |
| #define | YYJSON_SUBTYPE_TRUE ((uint8_t)(1 << 3)) /* ___01___ */ |
| #define | YYJSON_SUBTYPE_UINT ((uint8_t)(0 << 3)) /* ___00___ */ |
| #define | YYJSON_SUBTYPE_SINT ((uint8_t)(1 << 3)) /* ___01___ */ |
| #define | YYJSON_SUBTYPE_REAL ((uint8_t)(2 << 3)) /* ___10___ */ |
| #define | YYJSON_SUBTYPE_NOESC ((uint8_t)(1 << 3)) /* ___01___ */ |
| #define | YYJSON_TYPE_MASK ((uint8_t)0x07) /* _____111 */ |
| #define | YYJSON_TYPE_BIT ((uint8_t)3) |
| #define | YYJSON_SUBTYPE_MASK ((uint8_t)0x18) /* ___11___ */ |
| #define | YYJSON_SUBTYPE_BIT ((uint8_t)2) |
| #define | YYJSON_RESERVED_MASK ((uint8_t)0xE0) /* 111_____ */ |
| #define | YYJSON_RESERVED_BIT ((uint8_t)3) |
| #define | YYJSON_TAG_MASK ((uint8_t)0xFF) /* 11111111 */ |
| #define | YYJSON_TAG_BIT ((uint8_t)8) |
| #define | YYJSON_PADDING_SIZE 4 |
| #define | YYJSON_WRITE_FP_FLAG_BITS 8 |
| #define | YYJSON_WRITE_FP_PREC_BITS 4 |
| #define | YYJSON_WRITE_FP_TO_FIXED(prec) |
| #define | YYJSON_WRITE_FP_TO_FLOAT ((yyjson_write_flag)(1 << (32 - 5))) |
| #define | yyjson_arr_foreach(arr, idx, max, val) |
| #define | yyjson_obj_foreach(obj, idx, max, key, val) |
| #define | yyjson_mut_arr_foreach(arr, idx, max, val) |
| #define | yyjson_mut_obj_foreach(obj, idx, max, key, val) |
| #define | yyjson_mut_val_one(func) |
| #define | yyjson_mut_val_one_str(func) |
| #define | yyjson_mut_arr_with_func(func) |
| #define | yyjson_mut_obj_add_func(func) |
| #define | yyjson_ptr_set_err(_code, _msg) |
Typedefs | |
| typedef uint8_t | yyjson_type |
| typedef uint8_t | yyjson_subtype |
| typedef struct yyjson_alc | yyjson_alc |
| typedef struct yyjson_doc | yyjson_doc |
| typedef struct yyjson_val | yyjson_val |
| typedef struct yyjson_mut_doc | yyjson_mut_doc |
| typedef struct yyjson_mut_val | yyjson_mut_val |
| typedef uint32_t | yyjson_read_flag |
| typedef uint32_t | yyjson_read_code |
| typedef struct yyjson_read_err | yyjson_read_err |
| typedef struct yyjson_incr_state | yyjson_incr_state |
| typedef uint32_t | yyjson_write_flag |
| typedef uint32_t | yyjson_write_code |
| typedef struct yyjson_write_err | yyjson_write_err |
| typedef struct yyjson_arr_iter | yyjson_arr_iter |
| typedef struct yyjson_obj_iter | yyjson_obj_iter |
| typedef struct yyjson_mut_arr_iter | yyjson_mut_arr_iter |
| typedef struct yyjson_mut_obj_iter | yyjson_mut_obj_iter |
| typedef uint32_t | yyjson_ptr_code |
| typedef struct yyjson_ptr_err | yyjson_ptr_err |
| typedef struct yyjson_ptr_ctx | yyjson_ptr_ctx |
| typedef uint32_t | yyjson_patch_code |
| typedef struct yyjson_patch_err | yyjson_patch_err |
| typedef union yyjson_val_uni | yyjson_val_uni |
| typedef struct yyjson_str_chunk | yyjson_str_chunk |
| typedef struct yyjson_str_pool | yyjson_str_pool |
| typedef struct yyjson_val_chunk | yyjson_val_chunk |
| typedef struct yyjson_val_pool | yyjson_val_pool |
Definition in file yyjson.h.
| #define __bool_true_false_are_defined 1 |
| #define bool unsigned char |
Definition at line 522 of file yyjson.h.
Referenced by mut_write_root_pretty(), write_root_pretty(), yyjson_mut_write_ctx_get(), and yyjson_write_ctx_get().
| #define yyjson_api_inline static yyjson_inline |
inline function export
Definition at line 350 of file yyjson.h.
Referenced by unsafe_yyjson_is_str_noesc(), yyjson_mut_read_number(), yyjson_mut_val_write(), yyjson_mut_write(), yyjson_mut_write_number(), yyjson_read(), yyjson_read_max_memory_usage(), yyjson_val_write(), and yyjson_write().
| #define yyjson_arr_foreach | ( | arr, | |
| idx, | |||
| max, | |||
| val ) |
Macro for iterating over an array. It works like iterator, but with a more intuitive API.
Example
| #define yyjson_assume | ( | expr | ) |
| #define yyjson_constant_p | ( | value | ) |
| #define yyjson_constcast | ( | type | ) |
| #define yyjson_gcc_available | ( | major, | |
| minor, | |||
| patch ) |
| #define yyjson_has_attribute | ( | x | ) |
| #define yyjson_has_builtin | ( | x | ) |
| #define YYJSON_HAS_CONSTANT_P 0 |
| #define yyjson_has_feature | ( | x | ) |
| #define yyjson_has_include | ( | x | ) |
| #define yyjson_likely | ( | expr | ) |
| #define yyjson_mut_arr_foreach | ( | arr, | |
| idx, | |||
| max, | |||
| val ) |
Macro for iterating over an array. It works like iterator, but with a more intuitive API.
Example
Definition at line 2987 of file yyjson.h.
Referenced by find_mut_array_item_by_long_field_runtime(), generated_surface_normalize_order_mut_runtime(), handle_action_route(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_mutate_command(), handle_state_named_command(), and revoke_session_by_cookie_runtime().
| #define yyjson_mut_arr_with_func | ( | func | ) |
| #define yyjson_mut_obj_add_func | ( | func | ) |
| #define yyjson_mut_obj_foreach | ( | obj, | |
| idx, | |||
| max, | |||
| key, | |||
| val ) |
Macro for iterating over an object. It works like iterator, but with a more intuitive API.
Example
Definition at line 3859 of file yyjson.h.
Referenced by yyjson_mut_merge_patch().
| #define yyjson_mut_val_one | ( | func | ) |
| #define yyjson_mut_val_one_str | ( | func | ) |
| #define yyjson_obj_foreach | ( | obj, | |
| idx, | |||
| max, | |||
| key, | |||
| val ) |
Macro for iterating over an object. It works like iterator, but with a more intuitive API.
Example
Definition at line 2419 of file yyjson.h.
Referenced by yyjson_merge_patch().
| #define YYJSON_PADDING_SIZE 4 |
Padding size for JSON reader.
Definition at line 648 of file yyjson.h.
Referenced by yyjson_incr_new(), yyjson_read_fp(), and yyjson_read_opts().
| #define yyjson_ptr_set_err | ( | _code, | |
| _msg ) |
| #define YYJSON_READER_DEPTH_LIMIT 0 |
Definition at line 115 of file yyjson.h.
Referenced by read_root_minify(), read_root_pretty(), and yyjson_incr_read().
| #define YYJSON_RESERVED_BIT ((uint8_t)3) |
| #define YYJSON_RESERVED_MASK ((uint8_t)0xE0) /* 111_____ */ |
| #define YYJSON_SUBTYPE_BIT ((uint8_t)2) |
| #define YYJSON_SUBTYPE_FALSE ((uint8_t)(0 << 3)) /* ___00___ */ |
| #define YYJSON_SUBTYPE_MASK ((uint8_t)0x18) /* ___11___ */ |
| #define YYJSON_SUBTYPE_NOESC ((uint8_t)(1 << 3)) /* ___01___ */ |
String that does not need to be escaped for writing (internal use).
Definition at line 628 of file yyjson.h.
Referenced by read_str_opt().
| #define YYJSON_SUBTYPE_NONE ((uint8_t)(0 << 3)) /* ___00___ */ |
| #define YYJSON_SUBTYPE_REAL ((uint8_t)(2 << 3)) /* ___10___ */ |
Real number subtype: double.
Definition at line 626 of file yyjson.h.
Referenced by read_inf(), read_nan(), read_num(), write_num(), and yyjson_write_number().
| #define YYJSON_SUBTYPE_SINT ((uint8_t)(1 << 3)) /* ___01___ */ |
Signed integer subtype: int64_t.
Definition at line 624 of file yyjson.h.
Referenced by unsafe_yyjson_num_equals(), write_num(), and yyjson_write_number().
| #define YYJSON_SUBTYPE_TRUE ((uint8_t)(1 << 3)) /* ___01___ */ |
| #define YYJSON_SUBTYPE_UINT ((uint8_t)(0 << 3)) /* ___00___ */ |
Unsigned integer subtype: uint64_t.
Definition at line 622 of file yyjson.h.
Referenced by unsafe_yyjson_num_equals(), and yyjson_write_number().
| #define YYJSON_TAG_BIT ((uint8_t)8) |
The number of bits used by the tag.
Definition at line 645 of file yyjson.h.
Referenced by read_inf(), read_nan(), read_num_hex(), read_root_minify(), read_root_pretty(), read_str_opt(), and yyjson_incr_read().
| #define YYJSON_TAG_MASK ((uint8_t)0xFF) /* 11111111 */ |
The mask used to extract the tag of a JSON value.
Definition at line 643 of file yyjson.h.
Referenced by read_root_minify(), read_root_pretty(), yyjson_incr_read(), and yyjson_write_number().
| #define YYJSON_TYPE_ARR ((uint8_t)6) /* _____110 */ |
Array type, no subtype.
Definition at line 609 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), read_root_minify(), read_root_pretty(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), unsafe_yyjson_mut_ptr_getx(), unsafe_yyjson_mut_ptr_putx(), unsafe_yyjson_mut_val_mut_copy(), unsafe_yyjson_ptr_getx(), write_root_minify(), write_root_pretty(), write_root_single(), yyjson_imut_copy(), yyjson_incr_read(), yyjson_mut_stat(), and yyjson_val_mut_copy().
| #define YYJSON_TYPE_BIT ((uint8_t)3) |
| #define YYJSON_TYPE_BOOL ((uint8_t)3) /* _____011 */ |
Boolean type, subtype: TRUE, FALSE.
Definition at line 603 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), read_false(), read_true(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), write_root_minify(), write_root_pretty(), and write_root_single().
| #define YYJSON_TYPE_MASK ((uint8_t)0x07) /* _____111 */ |
The mask used to extract the type of a JSON value.
Definition at line 631 of file yyjson.h.
Referenced by read_root_minify(), read_root_pretty(), and yyjson_incr_read().
| #define YYJSON_TYPE_NONE ((uint8_t)0) /* _____000 */ |
| #define YYJSON_TYPE_NULL ((uint8_t)2) /* _____010 */ |
Null type: null literal, no subtype.
Definition at line 601 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), read_null(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), write_root_minify(), write_root_pretty(), and write_root_single().
| #define YYJSON_TYPE_NUM ((uint8_t)4) /* _____100 */ |
Number type, subtype: UINT, SINT, REAL.
Definition at line 605 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), read_inf(), read_nan(), read_num(), read_num_hex(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), write_root_minify(), write_root_pretty(), write_root_single(), and yyjson_write_number().
| #define YYJSON_TYPE_OBJ ((uint8_t)7) /* _____111 */ |
Object type, no subtype.
Definition at line 611 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), read_root_minify(), read_root_pretty(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), unsafe_yyjson_mut_ptr_getx(), unsafe_yyjson_mut_ptr_putx(), unsafe_yyjson_mut_val_mut_copy(), unsafe_yyjson_ptr_getx(), write_root_minify(), write_root_pretty(), write_root_single(), yyjson_imut_copy(), yyjson_incr_read(), yyjson_mut_stat(), and yyjson_val_mut_copy().
| #define YYJSON_TYPE_RAW ((uint8_t)1) /* _____001 */ |
Raw string type, no subtype.
Definition at line 599 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), read_inf(), read_nan(), read_num_hex(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), unsafe_yyjson_mut_val_mut_copy(), write_root_minify(), write_root_pretty(), write_root_single(), yyjson_imut_copy(), yyjson_mut_stat(), and yyjson_val_mut_copy().
| #define YYJSON_TYPE_STR ((uint8_t)5) /* _____101 */ |
String type, subtype: NONE, NOESC.
Definition at line 607 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), read_str_opt(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), unsafe_yyjson_mut_val_mut_copy(), write_root_minify(), write_root_pretty(), write_root_single(), yyjson_imut_copy(), yyjson_mut_stat(), and yyjson_val_mut_copy().
| #define YYJSON_U64_TO_F64_NO_IMPL 0 |
| #define yyjson_unlikely | ( | expr | ) |
| #define YYJSON_VERSION_HEX 0x000C00 |
The version of yyjson in hex: (major << 16) | (minor << 8) | (patch).
Definition at line 580 of file yyjson.h.
Referenced by yyjson_version().
| #define YYJSON_VERSION_MAJOR 0 |
| #define YYJSON_VERSION_MINOR 12 |
| #define YYJSON_VERSION_PATCH 0 |
| #define YYJSON_VERSION_STRING "0.12.0" |
| #define YYJSON_WRITE_FP_FLAG_BITS 8 |
The highest 8 bits of yyjson_write_flag and real number value's tag are reserved for controlling the output format of floating-point numbers.
Definition at line 1286 of file yyjson.h.
Referenced by write_num(), and yyjson_write_number().
| #define YYJSON_WRITE_FP_PREC_BITS 4 |
The highest 4 bits of flag are reserved for precision value.
Definition at line 1289 of file yyjson.h.
Referenced by write_num(), and yyjson_write_number().
| #define YYJSON_WRITE_FP_TO_FIXED | ( | prec | ) |
Write floating-point number using fixed-point notation.
| #define YYJSON_WRITE_FP_TO_FLOAT ((yyjson_write_flag)(1 << (32 - 5))) |
Write floating-point numbers using single-precision (float).
Definition at line 1302 of file yyjson.h.
Referenced by write_num(), and yyjson_write_number().
| typedef struct yyjson_alc yyjson_alc |
A memory allocator.
Typically you don't need to use it, unless you want to customize your own memory allocator.
| typedef struct yyjson_arr_iter yyjson_arr_iter |
A JSON array iterator.
Example
| typedef struct yyjson_doc yyjson_doc |
An immutable document for reading JSON. This document holds memory for all its JSON values and strings. When it is no longer used, the user should call yyjson_doc_free() to free its memory.
| typedef struct yyjson_incr_state yyjson_incr_state |
| typedef struct yyjson_mut_arr_iter yyjson_mut_arr_iter |
A mutable JSON array iterator.
Example
| typedef struct yyjson_mut_doc yyjson_mut_doc |
A mutable document for building JSON. This document holds memory for all its JSON values and strings. When it is no longer used, the user should call yyjson_mut_doc_free() to free its memory.
| typedef struct yyjson_mut_obj_iter yyjson_mut_obj_iter |
A mutable JSON object iterator.
Example
If the ordering of the keys is known at compile-time, you can use this method to speed up value lookups:
| typedef struct yyjson_mut_val yyjson_mut_val |
| typedef struct yyjson_obj_iter yyjson_obj_iter |
A JSON object iterator.
Example
If the ordering of the keys is known at compile-time, you can use this method to speed up value lookups:
| typedef uint32_t yyjson_patch_code |
| typedef struct yyjson_patch_err yyjson_patch_err |
Error information for JSON patch.
| typedef uint32_t yyjson_ptr_code |
| typedef struct yyjson_ptr_ctx yyjson_ptr_ctx |
A context for JSON pointer operation.
This struct stores the context of JSON Pointer operation result. The struct can be used with three helper functions: ctx_append(), ctx_replace(), and ctx_remove(), which perform the corresponding operations on the container without re-parsing the JSON Pointer.
For example:
| typedef struct yyjson_ptr_err yyjson_ptr_err |
Error information for JSON pointer.
| typedef uint32_t yyjson_read_code |
| typedef struct yyjson_read_err yyjson_read_err |
Error information for JSON reader.
| typedef uint32_t yyjson_read_flag |
| typedef struct yyjson_str_chunk yyjson_str_chunk |
A memory chunk in string memory pool.
| typedef struct yyjson_str_pool yyjson_str_pool |
A memory pool to hold all strings in a mutable document.
| typedef uint8_t yyjson_subtype |
| typedef uint8_t yyjson_type |
| typedef struct yyjson_val yyjson_val |
| typedef struct yyjson_val_chunk yyjson_val_chunk |
A memory chunk in value memory pool. sizeof(yyjson_val_chunk) should not be larger than sizeof(yyjson_mut_val).
| typedef struct yyjson_val_pool yyjson_val_pool |
A memory pool to hold all values in a mutable document.
| typedef union yyjson_val_uni yyjson_val_uni |
Payload of a JSON value (8 bytes).
| typedef uint32_t yyjson_write_code |
| typedef struct yyjson_write_err yyjson_write_err |
Error information for JSON writer.
| typedef uint32_t yyjson_write_flag |
| yyjson_api_inline bool unsafe_yyjson_arr_is_flat | ( | const yyjson_val * | val | ) |
Definition at line 5136 of file yyjson.h.
Referenced by ptr_arr_get().
| yyjson_api bool unsafe_yyjson_equals | ( | const yyjson_val * | lhs, |
| const yyjson_val * | rhs ) |
Definition at line 2967 of file yyjson.c.
References len, yyjson_val_uni::str, yyjson_val::tag, yyjson_val::uni, unsafe_yyjson_equals(), unsafe_yyjson_get_first(), unsafe_yyjson_get_len(), unsafe_yyjson_get_next(), unsafe_yyjson_get_type(), unsafe_yyjson_num_equals(), unsafe_yyjson_str_equals(), yyjson_obj_iter_getn(), yyjson_obj_iter_init(), YYJSON_TYPE_ARR, YYJSON_TYPE_BOOL, YYJSON_TYPE_NULL, YYJSON_TYPE_NUM, YYJSON_TYPE_OBJ, YYJSON_TYPE_RAW, and YYJSON_TYPE_STR.
Referenced by unsafe_yyjson_equals().
| yyjson_api_inline bool unsafe_yyjson_equals_str | ( | const void * | val, |
| const char * | str ) |
| yyjson_api_inline bool unsafe_yyjson_equals_strn | ( | const void * | val, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline bool unsafe_yyjson_get_bool | ( | const void * | val | ) |
Definition at line 5146 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), write_root_minify(), write_root_pretty(), and write_root_single().
| yyjson_api_inline yyjson_val * unsafe_yyjson_get_first | ( | const yyjson_val * | ctn | ) |
Definition at line 5187 of file yyjson.h.
Referenced by ptr_arr_get(), ptr_obj_get(), and unsafe_yyjson_equals().
| yyjson_api_inline int unsafe_yyjson_get_int | ( | const void * | val | ) |
| yyjson_api_inline size_t unsafe_yyjson_get_len | ( | const void * | val | ) |
Definition at line 5183 of file yyjson.h.
Referenced by mut_write_root(), mut_write_root_minify(), mut_write_root_pretty(), patch_op_get(), ptr_arr_get(), ptr_mut_arr_get(), ptr_mut_obj_get(), ptr_obj_get(), ptr_token_eq(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), unsafe_yyjson_mut_ptr_putx(), unsafe_yyjson_mut_val_mut_copy(), unsafe_yyjson_str_equals(), write_root(), write_root_minify(), write_root_pretty(), write_root_single(), yyjson_imut_copy(), yyjson_merge_patch(), yyjson_mut_merge_patch(), yyjson_mut_patch(), yyjson_mut_stat(), yyjson_patch(), and yyjson_val_mut_copy().
| yyjson_api_inline yyjson_val * unsafe_yyjson_get_next | ( | const yyjson_val * | val | ) |
Definition at line 5191 of file yyjson.h.
Referenced by ptr_arr_get(), ptr_obj_get(), unsafe_yyjson_equals(), and yyjson_val_mut_copy().
| yyjson_api_inline double unsafe_yyjson_get_num | ( | const void * | val | ) |
| yyjson_api_inline const char * unsafe_yyjson_get_raw | ( | const void * | val | ) |
| yyjson_api_inline double unsafe_yyjson_get_real | ( | const void * | val | ) |
| yyjson_api_inline int64_t unsafe_yyjson_get_sint | ( | const void * | val | ) |
| yyjson_api_inline const char * unsafe_yyjson_get_str | ( | const void * | val | ) |
Definition at line 5179 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), unsafe_yyjson_str_equals(), write_root_minify(), write_root_pretty(), write_root_single(), yyjson_merge_patch(), and yyjson_mut_merge_patch().
| yyjson_api_inline yyjson_subtype unsafe_yyjson_get_subtype | ( | const void * | val | ) |
Definition at line 5062 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), unsafe_yyjson_num_equals(), write_root_minify(), write_root_pretty(), and write_root_single().
| yyjson_api_inline uint8_t unsafe_yyjson_get_tag | ( | const void * | val | ) |
| yyjson_api_inline yyjson_type unsafe_yyjson_get_type | ( | const void * | val | ) |
Definition at line 5057 of file yyjson.h.
Referenced by mut_write_root_minify(), mut_write_root_pretty(), unsafe_yyjson_equals(), unsafe_yyjson_mut_equals(), unsafe_yyjson_mut_ptr_getx(), unsafe_yyjson_mut_ptr_putx(), unsafe_yyjson_mut_val_mut_copy(), unsafe_yyjson_ptr_getx(), write_root_minify(), write_root_pretty(), write_root_single(), yyjson_imut_copy(), yyjson_mut_stat(), and yyjson_val_mut_copy().
| yyjson_api_inline uint64_t unsafe_yyjson_get_uint | ( | const void * | val | ) |
| yyjson_api_inline void unsafe_yyjson_inc_len | ( | void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_arr | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_bool | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_ctn | ( | const void * | val | ) |
Definition at line 5100 of file yyjson.h.
Referenced by mut_write_root(), and write_root().
| yyjson_api_inline bool unsafe_yyjson_is_false | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_int | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_null | ( | const void * | val | ) |
Definition at line 5076 of file yyjson.h.
Referenced by yyjson_merge_patch(), and yyjson_mut_merge_patch().
| yyjson_api_inline bool unsafe_yyjson_is_num | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_obj | ( | const void * | val | ) |
Definition at line 5096 of file yyjson.h.
Referenced by yyjson_mut_patch(), and yyjson_patch().
| yyjson_api_inline bool unsafe_yyjson_is_raw | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_real | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_sint | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_str | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_str_noesc | ( | const char * | str, |
| size_t | len ) |
Definition at line 5007 of file yyjson.h.
References len, yyjson_api_inline, and yyjson_constant_p.
| yyjson_api_inline bool unsafe_yyjson_is_true | ( | const void * | val | ) |
| yyjson_api_inline bool unsafe_yyjson_is_uint | ( | const void * | val | ) |
| yyjson_api bool unsafe_yyjson_mut_equals | ( | const yyjson_mut_val * | lhs, |
| const yyjson_mut_val * | rhs ) |
Definition at line 3022 of file yyjson.c.
References constcast, len, yyjson_mut_val::next, yyjson_val_uni::ptr, yyjson_val_uni::str, yyjson_mut_val::tag, yyjson_mut_val::uni, unsafe_yyjson_get_len(), unsafe_yyjson_get_type(), unsafe_yyjson_mut_equals(), unsafe_yyjson_num_equals(), unsafe_yyjson_str_equals(), yyjson_mut_obj_iter_getn(), yyjson_mut_obj_iter_init(), YYJSON_TYPE_ARR, YYJSON_TYPE_BOOL, YYJSON_TYPE_NULL, YYJSON_TYPE_NUM, YYJSON_TYPE_OBJ, YYJSON_TYPE_RAW, and YYJSON_TYPE_STR.
Referenced by unsafe_yyjson_mut_equals().
| yyjson_api_inline void unsafe_yyjson_mut_obj_add | ( | yyjson_mut_val * | obj, |
| yyjson_mut_val * | key, | ||
| yyjson_mut_val * | val, | ||
| size_t | len ) |
Definition at line 7174 of file yyjson.h.
Referenced by unsafe_yyjson_mut_ptr_putx().
| yyjson_api_inline yyjson_mut_val * unsafe_yyjson_mut_obj_remove | ( | yyjson_mut_val * | obj, |
| const char * | key, | ||
| size_t | key_len ) |
| yyjson_api_inline bool unsafe_yyjson_mut_obj_replace | ( | yyjson_mut_val * | obj, |
| yyjson_mut_val * | key, | ||
| yyjson_mut_val * | val ) |
| yyjson_api_inline void unsafe_yyjson_mut_obj_rotate | ( | yyjson_mut_val * | obj, |
| size_t | idx ) |
| yyjson_api yyjson_mut_val * unsafe_yyjson_mut_ptr_getx | ( | const yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Definition at line 10738 of file yyjson.c.
References constcast, yyjson_ptr_ctx::ctn, len, yyjson_ptr_ctx::pre, ptr, ptr_mut_arr_get(), ptr_mut_obj_get(), ptr_next_token(), return_err_resolve, return_err_syntax, unlikely, unsafe_yyjson_get_type(), YYJSON_TYPE_ARR, and YYJSON_TYPE_OBJ.
Referenced by unsafe_yyjson_mut_ptr_removex(), and unsafe_yyjson_mut_ptr_replacex().
| yyjson_api bool unsafe_yyjson_mut_ptr_putx | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_mut_doc * | doc, | ||
| bool | create_parent, | ||
| bool | insert_new, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Definition at line 10772 of file yyjson.c.
References yyjson_ptr_ctx::ctn, yyjson_mut_val::next, yyjson_ptr_ctx::old, yyjson_ptr_ctx::pre, ptr, yyjson_val_uni::ptr, ptr_mut_arr_get(), ptr_mut_obj_get(), ptr_new_key(), ptr_next_token(), return_err_alloc, return_err_resolve, return_err_syntax, yyjson_mut_val::uni, unlikely, unsafe_yyjson_get_len(), unsafe_yyjson_get_type(), unsafe_yyjson_mut_obj_add(), unsafe_yyjson_set_len(), yyjson_mut_arr_append(), yyjson_mut_obj(), yyjson_mut_obj_add(), yyjson_mut_obj_put(), YYJSON_TYPE_ARR, and YYJSON_TYPE_OBJ.
| yyjson_api yyjson_mut_val * unsafe_yyjson_mut_ptr_removex | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Definition at line 10929 of file yyjson.c.
References yyjson_ptr_ctx::ctn, len, yyjson_mut_val::next, yyjson_ptr_ctx::old, yyjson_ptr_ctx::pre, ptr, unsafe_yyjson_mut_ptr_getx(), yyjson_mut_is_obj(), yyjson_mut_obj_put(), and yyjson_ptr_ctx_remove().
| yyjson_api yyjson_mut_val * unsafe_yyjson_mut_ptr_replacex | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Definition at line 10908 of file yyjson.c.
References yyjson_ptr_ctx::ctn, len, yyjson_mut_val::next, yyjson_ptr_ctx::old, yyjson_ptr_ctx::pre, ptr, unsafe_yyjson_mut_ptr_getx(), yyjson_mut_is_obj(), yyjson_mut_obj_put(), and yyjson_ptr_ctx_replace().
| yyjson_api_inline char * unsafe_yyjson_mut_str_alc | ( | yyjson_mut_doc * | doc, |
| size_t | len ) |
Definition at line 5866 of file yyjson.h.
Referenced by ptr_new_key().
| yyjson_api_inline char * unsafe_yyjson_mut_strncpy | ( | yyjson_mut_doc * | doc, |
| const char * | str, | ||
| size_t | len ) |
Definition at line 5885 of file yyjson.h.
Referenced by unsafe_yyjson_mut_val_mut_copy(), and yyjson_val_mut_copy().
| yyjson_api_inline yyjson_mut_val * unsafe_yyjson_mut_val | ( | yyjson_mut_doc * | doc, |
| size_t | count ) |
Definition at line 5894 of file yyjson.h.
Referenced by unsafe_yyjson_mut_val_mut_copy(), and yyjson_val_mut_copy().
| yyjson_api yyjson_val * unsafe_yyjson_ptr_getx | ( | const yyjson_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_err * | err ) |
Definition at line 10714 of file yyjson.c.
References constcast, len, ptr, ptr_arr_get(), ptr_next_token(), ptr_obj_get(), return_err_resolve, return_err_syntax, unlikely, unsafe_yyjson_get_type(), YYJSON_TYPE_ARR, and YYJSON_TYPE_OBJ.
| yyjson_api_inline void unsafe_yyjson_set_arr | ( | void * | val, |
| size_t | size ) |
| yyjson_api_inline void unsafe_yyjson_set_bool | ( | void * | val, |
| bool | num ) |
| yyjson_api_inline void unsafe_yyjson_set_double | ( | void * | val, |
| double | num ) |
| yyjson_api_inline void unsafe_yyjson_set_float | ( | void * | val, |
| float | num ) |
| yyjson_api_inline void unsafe_yyjson_set_fp_to_fixed | ( | void * | val, |
| int | prec ) |
| yyjson_api_inline void unsafe_yyjson_set_fp_to_float | ( | void * | val, |
| bool | flt ) |
| yyjson_api_inline void unsafe_yyjson_set_len | ( | void * | val, |
| size_t | len ) |
Definition at line 5218 of file yyjson.h.
Referenced by unsafe_yyjson_mut_ptr_putx().
| yyjson_api_inline void unsafe_yyjson_set_null | ( | void * | val | ) |
| yyjson_api_inline void unsafe_yyjson_set_obj | ( | void * | val, |
| size_t | size ) |
| yyjson_api_inline void unsafe_yyjson_set_raw | ( | void * | val, |
| const char * | raw, | ||
| size_t | len ) |
| yyjson_api_inline void unsafe_yyjson_set_real | ( | void * | val, |
| double | num ) |
| yyjson_api_inline void unsafe_yyjson_set_sint | ( | void * | val, |
| int64_t | num ) |
| yyjson_api_inline void unsafe_yyjson_set_str | ( | void * | val, |
| const char * | str ) |
| yyjson_api_inline void unsafe_yyjson_set_str_noesc | ( | void * | val, |
| bool | noesc ) |
| yyjson_api_inline void unsafe_yyjson_set_strn | ( | void * | val, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline void unsafe_yyjson_set_tag | ( | void * | val, |
| yyjson_type | type, | ||
| yyjson_subtype | subtype, | ||
| size_t | len ) |
| yyjson_api_inline void unsafe_yyjson_set_type | ( | void * | val, |
| yyjson_type | type, | ||
| yyjson_subtype | subtype ) |
| yyjson_api_inline void unsafe_yyjson_set_uint | ( | void * | val, |
| uint64_t | num ) |
| yyjson_api bool unsafe_yyjson_str_pool_grow | ( | yyjson_str_pool * | pool, |
| const yyjson_alc * | alc, | ||
| size_t | len ) |
Definition at line 2585 of file yyjson.c.
References yyjson_str_chunk::chunk_size, yyjson_str_pool::chunk_size, yyjson_str_pool::chunk_size_max, yyjson_str_pool::chunks, yyjson_alc::ctx, yyjson_str_pool::cur, yyjson_str_pool::end, len, yyjson_alc::malloc, yyjson_str_chunk::next, unlikely, USIZE_MAX, yyjson_max, and yyjson_min.
| yyjson_api_inline double unsafe_yyjson_u64_to_f64 | ( | uint64_t | num | ) |
Definition at line 5044 of file yyjson.h.
Referenced by read_num().
| yyjson_api bool unsafe_yyjson_val_pool_grow | ( | yyjson_val_pool * | pool, |
| const yyjson_alc * | alc, | ||
| size_t | count ) |
Definition at line 2612 of file yyjson.c.
References yyjson_val_chunk::chunk_size, yyjson_val_pool::chunk_size, yyjson_val_pool::chunk_size_max, yyjson_val_pool::chunks, yyjson_alc::ctx, yyjson_val_pool::cur, yyjson_val_pool::end, yyjson_alc::malloc, yyjson_val_chunk::next, unlikely, USIZE_MAX, yyjson_max, and yyjson_min.
| yyjson_api void yyjson_alc_dyn_free | ( | yyjson_alc * | alc | ) |
Free a dynamic allocator which is created by yyjson_alc_dyn_new().
| alc | The dynamic allocator to be destroyed. |
Definition at line 2540 of file yyjson.c.
References yyjson_alc::ctx, yyjson_alc::free, dyn_ctx::free_list, dyn_chunk::next, unlikely, dyn_ctx::used_list, and YYJSON_DEFAULT_ALC.
| yyjson_api yyjson_alc * yyjson_alc_dyn_new | ( | void | ) |
A dynamic allocator.
This allocator has a similar usage to the pool allocator above. However, when there is not enough memory, this allocator will dynamically request more memory using libc's malloc function, and frees it all at once when it is destroyed.
Definition at line 2524 of file yyjson.c.
References yyjson_alc::ctx, dyn_free(), dyn_malloc(), dyn_realloc(), yyjson_alc::free, yyjson_alc::malloc, yyjson_alc::realloc, unlikely, and YYJSON_DEFAULT_ALC.
| yyjson_api bool yyjson_alc_pool_init | ( | yyjson_alc * | alc, |
| void * | buf, | ||
| size_t | size ) |
A pool allocator uses fixed length pre-allocated memory.
This allocator may be used to avoid malloc/realloc calls. The pre-allocated memory should be held by the caller. The maximum amount of memory required to read a JSON can be calculated using the yyjson_read_max_memory_usage() function, but the amount of memory required to write a JSON cannot be directly calculated.
This is not a general-purpose allocator. It is designed to handle a single JSON document at a time. If it is used for overly complex memory tasks, such as parsing multiple JSON documents using the same allocator but releasing only a few of them, it may cause memory fragmentation, resulting in performance degradation and memory waste.
| alc | The allocator to be initialized. If alc is NULL, returns false. If buf or size is invalid, this will be set to an empty allocator. |
| buf | The buffer memory for this allocator. If buf is NULL, returns false. |
| size | The size of buf, in bytes. If size is less than 8 words (32/64 bytes on 32/64-bit OS), returns false. |
Example
Definition at line 2376 of file yyjson.c.
References yyjson_alc::ctx, yyjson_alc::free, pool_ctx::free_list, yyjson_alc::malloc, mem_align_up(), pool_chunk::next, pool_free(), pool_malloc(), pool_realloc(), yyjson_alc::realloc, pool_chunk::size, pool_ctx::size, size_align_down(), unlikely, and YYJSON_NULL_ALC.
| yyjson_api_inline yyjson_val * yyjson_arr_get | ( | const yyjson_val * | arr, |
| size_t | idx ) |
Returns the element at the specified position in this array. Returns NULL if array is NULL/empty or the index is out of bounds.
Definition at line 5603 of file yyjson.h.
Referenced by ensure_media_subtree(), handle_action_route(), handle_state_named_command(), and native_dynamic_dispatch_match().
| yyjson_api_inline yyjson_val * yyjson_arr_get_first | ( | const yyjson_val * | arr | ) |
Returns the first element of this array. Returns NULL if arr is NULL/empty or type is not array.
Definition at line 5619 of file yyjson.h.
Referenced by handle_generated_surface_validation_report_command().
| yyjson_api_inline yyjson_val * yyjson_arr_get_last | ( | const yyjson_val * | arr | ) |
| yyjson_api_inline bool yyjson_arr_iter_has_next | ( | yyjson_arr_iter * | iter | ) |
| yyjson_api_inline bool yyjson_arr_iter_init | ( | const yyjson_val * | arr, |
| yyjson_arr_iter * | iter ) |
Initialize an iterator for this array.
| arr | The array to be iterated over. If arr is NULL or not an array, iter is cleared. |
| iter | The iterator to be initialized. If iter is NULL, returns false. |
Definition at line 5650 of file yyjson.h.
Referenced by active_user_id_from_cookie_runtime(), append_generated_admin_surface_rows_runtime(), append_generated_surface_relation_checkboxes_html_runtime(), append_generated_surface_select_options_html_runtime(), append_profile_subscription_rows_runtime(), appointments_render_page_params_json_dup_runtime(), assign_technician_for_slot_runtime(), assign_technician_for_slot_runtime_local(), build_generated_surface_filter_controls_html_runtime(), build_generated_surface_form_fields_html_runtime(), build_generated_surface_sort_options_html_runtime(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), business_open_for_slot_runtime(), business_open_for_slot_runtime_local(), collect_business_service_list_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_active_tenant_ids_lines_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_availability_lines_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_business_technician_ids_lines_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_assigned_technician_ids_lines_runtime(), emit_service_book_form_page_json_runtime(), emit_sorted_section_lines_runtime(), emit_technician_appointments_lines_runtime(), emit_technician_availability_lines_runtime(), emit_user_appointments_json_runtime(), emit_user_membership_tenant_ids_json_runtime(), explore_render_page_params_json_dup_runtime(), find_active_token_record_runtime(), find_appointment_by_id_runtime_local(), find_array_item_by_long_field_runtime(), find_array_item_by_string_field_runtime(), find_business_by_id_runtime_local(), find_business_by_slug_runtime_local(), find_form_field_value_runtime(), find_service_for_business_runtime_local(), find_user_by_id_runtime_local(), find_user_by_username_runtime_local(), generated_surface_array_contains_string_runtime(), generated_surface_display_value_dup_runtime(), generated_surface_relation_array_all_integers_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_bundle_manifest_layer_for_slice_command(), handle_bundle_manifest_slice_order_command(), handle_file_generated_surface_match_command(), handle_file_migration_backend_list_lines_command(), handle_file_migration_rows_lines_command(), handle_form_field_json_lines_command(), handle_form_options_csv_command(), handle_form_options_html_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_relation_checkboxes_html_command(), handle_generated_surface_select_options_html_command(), handle_generated_surface_submitted_command(), handle_generated_surface_validation_report_command(), handle_object_array_all_integers_command(), handle_object_array_item_json_lines_command(), handle_object_array_lines_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_validation_field_list_html_command(), handle_validation_summary_text_command(), issue_browser_session_runtime(), json_array_contains_long_runtime(), long_in_array_runtime(), max_id_in_state_section_runtime(), migration_backend_record_runtime(), migration_backend_record_runtime_local(), migration_expected_checksum_dup_runtime(), migration_expected_checksum_dup_runtime_local(), migration_record_by_id_runtime(), native_append_forward_sql_bundle(), native_append_seed_sources_to_buffer(), native_capture_migrate_verify_sqlite_report_json(), native_dynamic_relational_postgresql_runtime_prepare(), native_dynamic_relational_sqlite_runtime_prepare(), native_json_find_object_by_string_field(), native_json_string_array_contains(), native_json_string_array_lines_dup(), native_sqlite_migrate_verify_preflight_ok(), next_array_id_runtime_local(), postgresql_apply_file_list_runtime(), postgresql_apply_file_list_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_task_items_html_dup_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), resolve_invite_accept_page_params_json_runtime(), resource_link_display_load_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), sqlite_apply_file_list_runtime(), sqlite_apply_file_list_runtime_local(), state_find_booking_for_user_runtime(), state_find_business_availability_for_business_runtime(), state_find_first_service_for_business_runtime(), state_find_google_calendar_connection_for_business_runtime(), state_find_service_for_business_runtime(), state_find_technician_for_business_runtime(), state_find_user_by_email_runtime(), state_tenant_id_for_business_id_runtime(), state_tenant_id_for_business_runtime_local(), state_tenant_id_for_business_slug_runtime(), surface_build_active_filters_runtime(), surface_build_sort_config_runtime(), surface_filter_item_runtime(), surface_find_by_id_runtime(), surface_find_form_runtime(), surface_find_record_by_string_field_runtime(), technician_booked_for_slot_runtime(), technician_booked_for_slot_runtime_local(), user_has_active_tenant_membership_runtime_local(), user_manages_business_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), and yyjson_patch().
| yyjson_api_inline yyjson_val * yyjson_arr_iter_next | ( | yyjson_arr_iter * | iter | ) |
Returns the next element in the iteration, or NULL on end. If iter is NULL, returns NULL.
Definition at line 5672 of file yyjson.h.
Referenced by active_user_id_from_cookie_runtime(), append_generated_admin_surface_rows_runtime(), append_generated_surface_relation_checkboxes_html_runtime(), append_generated_surface_select_options_html_runtime(), append_profile_subscription_rows_runtime(), appointments_render_page_params_json_dup_runtime(), assign_technician_for_slot_runtime(), assign_technician_for_slot_runtime_local(), build_generated_surface_filter_controls_html_runtime(), build_generated_surface_form_fields_html_runtime(), build_generated_surface_sort_options_html_runtime(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), business_open_for_slot_runtime(), business_open_for_slot_runtime_local(), collect_business_service_list_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_active_tenant_ids_lines_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_availability_lines_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_business_technician_ids_lines_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_assigned_technician_ids_lines_runtime(), emit_service_book_form_page_json_runtime(), emit_sorted_section_lines_runtime(), emit_technician_appointments_lines_runtime(), emit_technician_availability_lines_runtime(), emit_user_appointments_json_runtime(), emit_user_membership_tenant_ids_json_runtime(), explore_render_page_params_json_dup_runtime(), find_active_token_record_runtime(), find_appointment_by_id_runtime_local(), find_array_item_by_long_field_runtime(), find_array_item_by_string_field_runtime(), find_business_by_id_runtime_local(), find_business_by_slug_runtime_local(), find_form_field_value_runtime(), find_service_for_business_runtime_local(), find_user_by_id_runtime_local(), find_user_by_username_runtime_local(), generated_surface_array_contains_string_runtime(), generated_surface_display_value_dup_runtime(), generated_surface_relation_array_all_integers_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_bundle_manifest_layer_for_slice_command(), handle_bundle_manifest_slice_order_command(), handle_file_generated_surface_match_command(), handle_file_migration_backend_list_lines_command(), handle_file_migration_rows_lines_command(), handle_form_field_json_lines_command(), handle_form_options_csv_command(), handle_form_options_html_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_relation_checkboxes_html_command(), handle_generated_surface_select_options_html_command(), handle_generated_surface_submitted_command(), handle_generated_surface_validation_report_command(), handle_object_array_all_integers_command(), handle_object_array_item_json_lines_command(), handle_object_array_lines_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_validation_field_list_html_command(), handle_validation_summary_text_command(), issue_browser_session_runtime(), json_array_contains_long_runtime(), long_in_array_runtime(), max_id_in_state_section_runtime(), migration_backend_record_runtime(), migration_backend_record_runtime_local(), migration_expected_checksum_dup_runtime(), migration_expected_checksum_dup_runtime_local(), migration_record_by_id_runtime(), native_append_forward_sql_bundle(), native_append_seed_sources_to_buffer(), native_capture_migrate_verify_sqlite_report_json(), native_dynamic_relational_postgresql_runtime_prepare(), native_dynamic_relational_sqlite_runtime_prepare(), native_json_find_object_by_string_field(), native_json_string_array_contains(), native_json_string_array_lines_dup(), native_sqlite_migrate_verify_preflight_ok(), next_array_id_runtime_local(), postgresql_apply_file_list_runtime(), postgresql_apply_file_list_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_task_items_html_dup_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), resolve_invite_accept_page_params_json_runtime(), resource_link_display_load_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), sqlite_apply_file_list_runtime(), sqlite_apply_file_list_runtime_local(), state_find_booking_for_user_runtime(), state_find_business_availability_for_business_runtime(), state_find_first_service_for_business_runtime(), state_find_google_calendar_connection_for_business_runtime(), state_find_service_for_business_runtime(), state_find_technician_for_business_runtime(), state_find_user_by_email_runtime(), state_tenant_id_for_business_id_runtime(), state_tenant_id_for_business_runtime_local(), state_tenant_id_for_business_slug_runtime(), surface_build_active_filters_runtime(), surface_build_sort_config_runtime(), surface_filter_item_runtime(), surface_find_by_id_runtime(), surface_find_form_runtime(), surface_find_record_by_string_field_runtime(), technician_booked_for_slot_runtime(), technician_booked_for_slot_runtime_local(), user_has_active_tenant_membership_runtime_local(), user_manages_business_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), and yyjson_patch().
| yyjson_api_inline yyjson_arr_iter yyjson_arr_iter_with | ( | const yyjson_val * | arr | ) |
Create an iterator with an array, same as yyjson_arr_iter_init().
| arr | The array to be iterated over. If arr is NULL or not an array, returns an empty iterator. |
| yyjson_api_inline size_t yyjson_arr_size | ( | const yyjson_val * | arr | ) |
Returns the number of elements in this array. Returns 0 if arr is NULL or type is not array.
Definition at line 5599 of file yyjson.h.
Referenced by diagnostics_render_page_params_json_dup_runtime(), emit_appointments_page_json_runtime(), emit_calendar_page_json_runtime(), ensure_media_subtree(), handle_action_route(), handle_file_migration_backend_files_json_command(), handle_file_migration_rows_lines_command(), handle_file_section_length_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_validation_report_command(), handle_object_array_length_command(), handle_object_path_array_length_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_validation_has_errors_command(), native_dynamic_dispatch_match(), native_dynamic_relational_postgresql_runtime_prepare(), and native_dynamic_relational_sqlite_runtime_prepare().
| yyjson_deprecated | ( | "renamed to unsafe_yyjson_mut_ptr_getx" | ) |
Compatibility alias for unsafe_yyjson_mut_ptr_getx.
| yyjson_deprecated | ( | "renamed to unsafe_yyjson_ptr_getn" | ) |
Compatibility alias for unsafe_yyjson_ptr_getx.
| yyjson_deprecated | ( | "renamed to yyjson_doc_ptr_get" | ) |
Compatibility alias for yyjson_doc_ptr_get.
| yyjson_deprecated | ( | "renamed to yyjson_doc_ptr_getn" | ) |
Compatibility alias for yyjson_doc_ptr_getn.
| yyjson_deprecated | ( | "renamed to yyjson_mut_doc_ptr_get" | ) |
Compatibility alias for yyjson_mut_doc_ptr_get.
| yyjson_deprecated | ( | "renamed to yyjson_mut_doc_ptr_getn" | ) |
Compatibility alias for yyjson_mut_doc_ptr_getn.
| yyjson_deprecated | ( | "renamed to yyjson_mut_ptr_get" | ) |
Compatibility alias for yyjson_mut_ptr_get.
| yyjson_deprecated | ( | "renamed to yyjson_mut_ptr_getn" | ) |
Compatibility alias for yyjson_mut_ptr_getn.
| yyjson_deprecated | ( | "renamed to yyjson_ptr_get" | ) |
Compatibility alias for yyjson_ptr_get.
| yyjson_deprecated | ( | "renamed to yyjson_ptr_getn" | ) |
Compatibility alias for yyjson_ptr_getn.
| yyjson_api_inline void yyjson_doc_free | ( | yyjson_doc * | doc | ) |
Release the JSON document and free the memory. After calling this function, the doc and all values from the doc are no longer available. This function will do nothing if the doc is NULL.
Definition at line 5335 of file yyjson.h.
Referenced by native_json_doc_free().
| yyjson_api_inline size_t yyjson_doc_get_read_size | ( | const yyjson_doc * | doc | ) |
| yyjson_api_inline yyjson_val * yyjson_doc_get_root | ( | const yyjson_doc * | doc | ) |
Returns the root value of this JSON document. Returns NULL if doc is NULL.
Definition at line 5323 of file yyjson.h.
Referenced by active_user_id_from_cookie_runtime(), append_rate_limit_event_runtime_local(), appointments_render_page_params_json_dup_runtime(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), ensure_media_subtree(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_bundle_manifest_layer_for_slice_command(), handle_bundle_manifest_slice_order_command(), handle_file_compact_object_command(), handle_file_field_number_command(), handle_file_field_string_command(), handle_file_generated_surface_match_command(), handle_file_migration_backend_files_json_command(), handle_file_migration_backend_list_lines_command(), handle_file_migration_backend_record_json_command(), handle_file_migration_rows_lines_command(), handle_file_normalize_ucal_state_command(), handle_file_section_length_command(), handle_form_field_json_command(), handle_form_field_json_lines_command(), handle_form_options_csv_command(), handle_form_options_html_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_edit_page_json_command(), handle_generated_surface_form_fields_html_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_mutate_command(), handle_generated_surface_relation_checkboxes_html_command(), handle_generated_surface_submitted_command(), handle_generated_surface_validation_report_command(), handle_issue_business_invite_action_runtime(), handle_manifest_app_root_command(), handle_manifest_fixture_path_raw_command(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_named_command(), handle_template_declared_page_contract_command(), issue_browser_session_runtime(), load_root_from_text_runtime(), native_build_sqlite_migrate_verify_failure_report_json(), native_capture_migrate_verify_sqlite_report_json(), native_dynamic_dispatch_match(), native_dynamic_relational_postgresql_runtime_prepare(), native_dynamic_relational_sqlite_runtime_prepare(), native_sqlite_migrate_verify_preflight_ok(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_state_root_load_runtime(), resolve_declared_page_params_json_runtime(), resolve_invite_accept_page_params_json_runtime(), resolve_route_fixture_path(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), write_business_availability_api_response(), write_business_services_api_response(), and write_generated_surface_schema_response().
| yyjson_api_inline size_t yyjson_doc_get_val_count | ( | const yyjson_doc * | doc | ) |
| yyjson_api yyjson_mut_doc * yyjson_doc_mut_copy | ( | const yyjson_doc * | doc, |
| const yyjson_alc * | alc ) |
Copies and returns a new mutable document from input, returns NULL on error. This makes a deep-copy on the immutable document. If allocator is NULL, the default allocator will be used.
Definition at line 2678 of file yyjson.c.
References yyjson_doc::root, yyjson_mut_doc_free(), yyjson_mut_doc_new(), yyjson_mut_doc_set_root(), and yyjson_val_mut_copy().
Referenced by append_rate_limit_event_runtime_local(), append_validation_error_runtime(), build_artifact_local_app_manifest_json(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_normalize_ucal_state_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_mutate_command(), handle_generated_surface_validation_report_command(), handle_issue_business_invite_action_runtime(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_named_command(), issue_browser_session_runtime(), and revoke_session_by_cookie_runtime().
| yyjson_api_inline yyjson_val * yyjson_doc_ptr_get | ( | const yyjson_doc * | doc, |
| const char * | ptr ) |
| yyjson_api_inline yyjson_val * yyjson_doc_ptr_getn | ( | const yyjson_doc * | doc, |
| const char * | ptr, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_val * yyjson_doc_ptr_getx | ( | const yyjson_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_err * | err ) |
Get value by a JSON Pointer.
| doc | The JSON document to be queried. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline bool yyjson_equals | ( | const yyjson_val * | lhs, |
| const yyjson_val * | rhs ) |
| yyjson_api_inline bool yyjson_equals_str | ( | const yyjson_val * | val, |
| const char * | str ) |
Returns whether the JSON value is equal to a string. Returns false if val is NULL or type is not string.
Definition at line 5477 of file yyjson.h.
Referenced by active_user_id_from_cookie_runtime(), find_active_token_record_runtime(), find_array_item_by_string_field_runtime(), find_business_by_slug_runtime_local(), find_user_by_username_runtime_local(), generated_surface_array_contains_string_runtime(), handle_accept_invite_action_runtime(), handle_password_reset_complete_action_runtime(), handle_state_named_command(), migration_backend_record_runtime(), migration_backend_record_runtime_local(), migration_record_by_id_runtime(), native_json_find_object_by_string_field(), native_json_string_array_contains(), resolve_invite_accept_page_params_json_runtime(), revoke_session_by_cookie_runtime(), state_tenant_id_for_business_slug_runtime(), surface_build_sort_config_runtime(), surface_find_by_id_runtime(), surface_find_form_runtime(), and write_generated_surface_schema_response().
| yyjson_api_inline bool yyjson_equals_strn | ( | const yyjson_val * | val, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline bool yyjson_get_bool | ( | const yyjson_val * | val | ) |
Returns the content if the value is bool. Returns false if val is NULL or type is not bool.
Definition at line 5445 of file yyjson.h.
Referenced by append_generated_admin_surface_rows_runtime(), emit_active_tenant_ids_lines_runtime(), emit_explore_page_json_runtime(), emit_public_business_cards_json_runtime(), explore_render_page_params_json_dup_runtime(), generated_surface_display_value_dup_runtime(), handle_action_route(), handle_object_path_bool_command(), handle_password_reset_request_action_runtime(), handle_state_named_command(), json_value_truthy_runtime(), proof_task_items_html_dup_runtime(), state_find_user_by_email_runtime(), and template_value_text_dup_runtime().
| yyjson_api_inline int yyjson_get_int | ( | const yyjson_val * | val | ) |
| yyjson_api_inline size_t yyjson_get_len | ( | const yyjson_val * | val | ) |
Returns the content length (string length, array size, object size). Returns 0 if val is NULL or type is not string/array/object.
Definition at line 5473 of file yyjson.h.
Referenced by handle_file_generated_surface_match_command(), handle_file_migration_backend_list_lines_command(), handle_manifest_fixture_path_raw_command(), handle_object_array_lines_command(), handle_object_path_string_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_complete_action_runtime(), handle_state_named_command(), json_value_tostring_dup_runtime(), native_json_string_array_lines_dup(), native_json_string_dup(), and revoke_session_by_cookie_runtime().
| yyjson_api_inline double yyjson_get_num | ( | const yyjson_val * | val | ) |
| yyjson_api_inline const char * yyjson_get_raw | ( | const yyjson_val * | val | ) |
| yyjson_api_inline double yyjson_get_real | ( | const yyjson_val * | val | ) |
Returns the content if the value is real number, or 0.0 on error. Returns 0.0 if val is NULL or type is not real(double).
Definition at line 5461 of file yyjson.h.
Referenced by long_from_value_runtime(), and native_json_long_from_value().
| yyjson_api_inline int64_t yyjson_get_sint | ( | const yyjson_val * | val | ) |
Returns the content cast to int64_t. Returns 0 if val is NULL or type is not integer(sint/uint).
Definition at line 5453 of file yyjson.h.
Referenced by handle_object_path_number_command(), long_from_value_runtime(), long_from_value_runtime_local(), and native_json_long_from_value().
| yyjson_api_inline const char * yyjson_get_str | ( | const yyjson_val * | val | ) |
Returns the content if the value is string. Returns NULL if val is NULL or type is not string.
Definition at line 5469 of file yyjson.h.
Referenced by business_dashboard_render_page_params_json_dup_runtime(), default_signed_in_path_runtime(), emit_service_book_form_page_json_runtime(), ensure_media_subtree(), generated_surface_operation_path_dup_runtime(), handle_accept_invite_action_runtime(), handle_file_generated_surface_match_command(), handle_file_migration_backend_list_lines_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_validation_report_command(), handle_manifest_fixture_path_raw_command(), handle_object_array_lines_command(), handle_object_merge_command(), handle_object_path_string_command(), handle_object_relative_path_array_to_absolute_json_command(), json_value_tostring_dup_runtime(), merge_patch_into_mut_object_runtime(), migration_expected_checksum_dup_runtime(), migration_expected_checksum_dup_runtime_local(), native_append_forward_sql_bundle(), native_append_seed_sources_to_buffer(), native_capture_migrate_verify_sqlite_report_json(), native_dynamic_dispatch_match(), native_dynamic_runtime_handle_request(), native_json_string_array_lines_dup(), native_json_string_dup(), native_sqlite_migrate_verify_preflight_ok(), postgresql_apply_file_list_runtime(), postgresql_apply_file_list_runtime_local(), service_book_form_page_params_json_dup_runtime(), sqlite_apply_file_list_runtime(), sqlite_apply_file_list_runtime_local(), template_value_text_dup_runtime(), user_has_active_tenant_membership_runtime_local(), and user_manages_business_runtime().
| yyjson_api_inline yyjson_subtype yyjson_get_subtype | ( | const yyjson_val * | val | ) |
| yyjson_api_inline uint8_t yyjson_get_tag | ( | const yyjson_val * | val | ) |
| yyjson_api_inline yyjson_type yyjson_get_type | ( | const yyjson_val * | val | ) |
| yyjson_api_inline const char * yyjson_get_type_desc | ( | const yyjson_val * | val | ) |
| yyjson_api_inline uint64_t yyjson_get_uint | ( | const yyjson_val * | val | ) |
Returns the content cast to uint64_t. Returns 0 if val is NULL or type is not integer(sint/uint).
Definition at line 5449 of file yyjson.h.
Referenced by long_from_value_runtime(), and native_json_long_from_value().
| yyjson_api void yyjson_incr_free | ( | yyjson_incr_state * | state | ) |
Release the incremental read state and free the memory.
Definition at line 6613 of file yyjson.c.
References yyjson_incr_state::alc, yyjson_alc::ctx, yyjson_incr_state::flg, yyjson_alc::free, yyjson_incr_state::hdr, yyjson_incr_state::val_hdr, and YYJSON_READ_INSITU.
| yyjson_api yyjson_incr_state * yyjson_incr_new | ( | char * | buf, |
| size_t | buf_len, | ||
| yyjson_read_flag | flg, | ||
| const yyjson_alc * | alc ) |
Initialize state for incremental read.
To read a large JSON document incrementally:
Note: The incremental JSON reader only supports standard JSON. Flags for non-standard features (e.g. comments, trailing commas) are ignored.
| buf | The JSON data, null-terminator is not required. If buf is NULL, returns NULL. |
| buf_len | The length of the JSON data in buf. If using YYJSON_READ_INSITU, buf_len should not include the padding size. |
| flg | The JSON read options. Multiple options can be combined with | operator. |
| alc | The memory allocator used by JSON reader. Pass NULL to use the libc's default allocator. |
Definition at line 6575 of file yyjson.c.
References yyjson_incr_state::alc, yyjson_incr_state::buf_len, yyjson_alc::ctx, yyjson_incr_state::cur, yyjson_incr_state::flg, yyjson_alc::free, has_flg, yyjson_incr_state::hdr, yyjson_incr_state::label, LABEL_doc_begin, yyjson_alc::malloc, yyjson_incr_state::raw_end, yyjson_incr_state::raw_ptr, unlikely, USIZE_MAX, YYJSON_DEFAULT_ALC, YYJSON_PADDING_SIZE, YYJSON_READ_ALLOW_BOM, YYJSON_READ_ALLOW_INVALID_UNICODE, and YYJSON_READ_JSON5.
| yyjson_api yyjson_doc * yyjson_incr_read | ( | yyjson_incr_state * | state, |
| size_t | len, | ||
| yyjson_read_err * | err ) |
Performs incremental read of up to len bytes.
If NULL is returned and err->code is set to YYJSON_READ_ERROR_MORE, it indicates that more data is required to continue parsing. Then, call this function again with incremented len. Continue until a document is returned or an error other than YYJSON_READ_ERROR_MORE is returned.
Note: Parsing in very small increments is not efficient. An increment of several kilobytes or megabytes is recommended.
| state | The state for incremental reading, created using yyjson_incr_new(). |
| len | The number of bytes of JSON data available to parse. If len is 0, returns NULL. |
| err | A pointer to receive error information. |
Definition at line 6627 of file yyjson.c.
References yyjson_doc::alc, yyjson_incr_state::alc, yyjson_incr_state::alc_len, yyjson_incr_state::buf_len, char_is_ctn(), char_is_num(), char_is_space(), check_maybe_truncated_number, yyjson_read_err::code, yyjson_incr_state::ctn, yyjson_incr_state::ctn_len, yyjson_alc::ctx, yyjson_incr_state::cur, yyjson_doc::dat_read, yyjson_incr_state::flg, has_flg, yyjson_incr_state::hdr, yyjson_incr_state::hdr_len, is_utf16_bom(), is_utf32_bom(), is_utf8_bom(), yyjson_incr_state::label, LABEL_arr_val_begin, LABEL_arr_val_end, LABEL_doc_begin, LABEL_doc_end, LABEL_obj_key_begin, LABEL_obj_key_end, LABEL_obj_val_begin, LABEL_obj_val_end, len, likely, yyjson_alc::malloc, yyjson_read_err::msg, MSG_ARR_END, MSG_CHAR, MSG_CHAR_F, MSG_CHAR_N, MSG_CHAR_T, MSG_COMMA, MSG_DEPTH, MSG_ERR_BOM, MSG_ERR_UTF16, MSG_ERR_UTF32, MSG_GARBAGE, MSG_MALLOC, MSG_NOT_END, MSG_OBJ_END, MSG_OBJ_KEY, MSG_OBJ_SEP, yyjson_val_uni::ofs, yyjson_read_err::pos, yyjson_incr_state::raw_ptr, read_false(), read_null(), read_num(), read_str_con(), read_true(), return_err, return_err_inv_param, yyjson_doc::root, save_incr_state, yyjson_incr_state::str_con, yyjson_doc::str_pool, yyjson_val::tag, yyjson_val::uni, unlikely, USIZE_MAX, yyjson_incr_state::val, yyjson_incr_state::val_end, yyjson_incr_state::val_hdr, val_incr, yyjson_doc::val_read, yyjson_min, YYJSON_READ_ERROR_MORE, YYJSON_READ_ERROR_UNEXPECTED_END, YYJSON_READER_DEPTH_LIMIT, YYJSON_READER_ESTIMATED_MINIFY_RATIO, YYJSON_TAG_BIT, YYJSON_TAG_MASK, YYJSON_TYPE_ARR, YYJSON_TYPE_MASK, and YYJSON_TYPE_OBJ.
| yyjson_api_inline bool yyjson_is_arr | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is array. Returns false if val is NULL.
Definition at line 5394 of file yyjson.h.
Referenced by append_generated_surface_relation_checkboxes_html_runtime(), assign_technician_for_slot_runtime(), assign_technician_for_slot_runtime_local(), find_active_token_record_runtime(), find_array_item_by_long_field_runtime(), find_array_item_by_string_field_runtime(), generated_surface_array_contains_string_runtime(), generated_surface_display_value_dup_runtime(), generated_surface_relation_array_all_integers_runtime(), handle_action_route(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_relation_checkboxes_html_command(), handle_generated_surface_validation_report_command(), handle_object_array_all_integers_command(), handle_object_array_item_json_lines_command(), handle_object_array_length_command(), handle_object_array_lines_command(), handle_object_path_array_length_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_state_named_command(), json_array_contains_long_runtime(), long_in_array_runtime(), native_append_seed_sources_to_buffer(), native_json_obj_get_array(), native_json_string_array_contains(), native_json_string_array_lines_dup(), proof_state_root_load_runtime(), proof_task_items_html_dup_runtime(), service_edit_page_params_json_dup_runtime(), state_array_runtime_local(), surface_filter_item_runtime(), write_generated_surface_schema_response(), and yyjson_patch().
| yyjson_api_inline bool yyjson_is_bool | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is bool (true/false). Returns false if val is NULL.
Definition at line 5366 of file yyjson.h.
Referenced by emit_active_tenant_ids_lines_runtime(), emit_explore_page_json_runtime(), emit_public_business_cards_json_runtime(), explore_render_page_params_json_dup_runtime(), generated_surface_display_value_dup_runtime(), handle_generated_surface_coerce_candidate_command(), handle_object_path_bool_command(), handle_state_named_command(), json_value_truthy_runtime(), state_find_user_by_email_runtime(), and template_value_text_dup_runtime().
| yyjson_api_inline bool yyjson_is_ctn | ( | const yyjson_val * | val | ) |
| yyjson_api_inline bool yyjson_is_false | ( | const yyjson_val * | val | ) |
| yyjson_api_inline bool yyjson_is_int | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is integer (uint64_t/int64_t). Returns false if val is NULL.
Definition at line 5378 of file yyjson.h.
Referenced by handle_object_array_all_integers_command(), handle_object_path_number_command(), and long_from_value_runtime_local().
| yyjson_api_inline bool yyjson_is_null | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is null. Returns false if val is NULL.
Definition at line 5354 of file yyjson.h.
Referenced by event_stream_resource_id_dup_runtime(), generated_surface_display_value_dup_runtime(), generated_surface_normalize_order_mut_runtime(), handle_accept_invite_action_runtime(), handle_generated_surface_default_candidate_command(), handle_generated_surface_validation_report_command(), handle_object_field_text_command(), handle_password_reset_complete_action_runtime(), handle_state_named_command(), json_value_tostring_dup_runtime(), resolve_invite_accept_page_params_json_runtime(), revoke_session_by_cookie_runtime(), and surface_context_match_runtime().
| yyjson_api_inline bool yyjson_is_num | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is number (uint64_t/int64_t/double). Returns false if val is NULL.
Definition at line 5386 of file yyjson.h.
Referenced by json_value_truthy_runtime(), long_from_value_runtime(), native_json_long_from_value(), and template_value_text_dup_runtime().
| yyjson_api_inline bool yyjson_is_obj | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is object. Returns false if val is NULL.
Definition at line 5398 of file yyjson.h.
Referenced by active_user_id_from_cookie_runtime(), append_generated_admin_surface_rows_runtime(), append_generated_surface_relation_checkboxes_html_runtime(), append_generated_surface_select_options_html_runtime(), append_profile_subscription_rows_runtime(), append_validation_error_runtime(), appointments_render_page_params_json_dup_runtime(), assign_technician_for_slot_runtime(), assign_technician_for_slot_runtime_local(), build_generated_surface_filter_controls_html_runtime(), build_generated_surface_form_fields_html_runtime(), build_generated_surface_sort_options_html_runtime(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), business_open_for_slot_runtime(), business_open_for_slot_runtime_local(), collect_business_service_list_runtime(), collect_event_stream_row_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_active_tenant_ids_lines_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_availability_lines_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_business_technician_ids_lines_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_assigned_technician_ids_lines_runtime(), emit_sorted_section_lines_runtime(), emit_technician_appointments_lines_runtime(), emit_technician_availability_lines_runtime(), emit_user_appointments_json_runtime(), emit_user_membership_tenant_ids_json_runtime(), ensure_media_subtree(), event_stream_allowed_by_scope_runtime(), event_stream_matches_filters_runtime(), event_stream_resource_id_dup_runtime(), explore_render_page_params_json_dup_runtime(), find_active_token_record_runtime(), find_appointment_by_id_runtime_local(), find_array_item_by_long_field_runtime(), find_array_item_by_string_field_runtime(), find_business_by_id_runtime_local(), find_service_for_business_runtime_local(), generated_surface_delete_button_label_dup_runtime(), generated_surface_display_value_dup_runtime(), generated_surface_operation_path_dup_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_compact_object_command(), handle_file_field_number_command(), handle_file_field_string_command(), handle_file_generated_surface_match_command(), handle_file_migration_backend_files_json_command(), handle_file_migration_rows_lines_command(), handle_file_normalize_ucal_state_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_display_value_command(), handle_generated_surface_edit_page_json_command(), handle_generated_surface_filter_controls_html_command(), handle_generated_surface_form_fields_html_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_mutate_command(), handle_generated_surface_params_json_command(), handle_generated_surface_relation_checkboxes_html_command(), handle_generated_surface_select_options_html_command(), handle_generated_surface_sort_options_html_command(), handle_generated_surface_submitted_command(), handle_generated_surface_validation_report_command(), handle_object_field_number_command(), handle_object_field_string_command(), handle_object_field_text_command(), handle_object_merge_command(), handle_password_reset_complete_action_runtime(), handle_request_compact_object_command(), handle_request_compact_object_strict_command(), handle_request_field_command(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_template_declared_page_contract_command(), handle_template_render_file_command(), handle_template_render_path_command(), handle_validation_error_envelope_command(), handle_validation_field_list_html_command(), handle_validation_has_errors_command(), handle_validation_summary_text_command(), issue_browser_session_runtime(), max_id_in_state_section_runtime(), merge_patch_into_mut_object_runtime(), migration_expected_checksum_dup_runtime(), migration_expected_checksum_dup_runtime_local(), native_capture_migrate_verify_sqlite_report_json(), native_json_find_object_by_string_field(), native_json_obj_get(), normalized_payload_object_mut_runtime(), object_value_at_path_runtime(), payload_first_long_runtime(), payload_first_string_dup_runtime(), profile_render_page_params_json_dup_runtime(), proof_state_root_load_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_business_fragment_from_doc_dup_runtime(), render_file_template_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), render_template_text_with_default_kind_dup_runtime(), resolve_invite_accept_page_params_json_runtime(), resource_link_display_load_runtime(), service_edit_page_params_json_dup_runtime(), state_find_booking_for_user_runtime(), state_find_business_availability_for_business_runtime(), state_find_first_service_for_business_runtime(), state_find_google_calendar_connection_for_business_runtime(), state_find_service_for_business_runtime(), state_find_technician_for_business_runtime(), state_find_user_by_email_runtime(), state_tenant_id_for_business_id_runtime(), state_tenant_id_for_business_runtime_local(), state_tenant_id_for_business_slug_runtime(), surface_build_sort_config_runtime(), surface_sort_items_runtime(), technician_booked_for_slot_runtime(), technician_booked_for_slot_runtime_local(), user_has_active_tenant_membership_runtime_local(), user_manages_business_runtime(), write_business_availability_api_response(), write_business_services_api_response(), and yyjson_merge_patch().
| yyjson_api_inline bool yyjson_is_raw | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is raw. Returns false if val is NULL.
Definition at line 5350 of file yyjson.h.
Referenced by yyjson_read_number().
| yyjson_api_inline bool yyjson_is_real | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is real number (double). Returns false if val is NULL.
Definition at line 5382 of file yyjson.h.
Referenced by handle_object_path_number_command(), long_from_value_runtime(), long_from_value_runtime_local(), and native_json_long_from_value().
| yyjson_api_inline bool yyjson_is_sint | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is signed integer (int64_t). Returns false if val is NULL.
Definition at line 5374 of file yyjson.h.
Referenced by long_from_value_runtime(), and native_json_long_from_value().
| yyjson_api_inline bool yyjson_is_str | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is string. Returns false if val is NULL.
Definition at line 5390 of file yyjson.h.
Referenced by active_user_id_from_cookie_runtime(), emit_service_book_form_page_json_runtime(), ensure_media_subtree(), find_active_token_record_runtime(), find_array_item_by_string_field_runtime(), find_business_by_slug_runtime_local(), find_user_by_username_runtime_local(), handle_accept_invite_action_runtime(), handle_bundle_manifest_slice_order_command(), handle_file_generated_surface_match_command(), handle_file_migration_backend_list_lines_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_validation_report_command(), handle_manifest_fixture_path_raw_command(), handle_object_array_lines_command(), handle_object_merge_command(), handle_object_path_string_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_complete_action_runtime(), handle_request_field_command(), handle_state_named_command(), json_value_tostring_dup_runtime(), merge_patch_into_mut_object_runtime(), migration_backend_record_runtime_local(), migration_expected_checksum_dup_runtime(), migration_expected_checksum_dup_runtime_local(), native_append_forward_sql_bundle(), native_append_seed_sources_to_buffer(), native_capture_migrate_verify_sqlite_report_json(), native_dynamic_runtime_handle_request(), native_json_find_object_by_string_field(), native_json_string_array_contains(), native_json_string_array_lines_dup(), native_json_string_dup(), native_sqlite_migrate_verify_preflight_ok(), postgresql_apply_file_list_runtime(), postgresql_apply_file_list_runtime_local(), resolve_invite_accept_page_params_json_runtime(), revoke_session_by_cookie_runtime(), service_book_form_page_params_json_dup_runtime(), sqlite_apply_file_list_runtime(), sqlite_apply_file_list_runtime_local(), state_tenant_id_for_business_slug_runtime(), template_value_text_dup_runtime(), write_generated_surface_schema_response(), and yyjson_patch().
| yyjson_api_inline bool yyjson_is_true | ( | const yyjson_val * | val | ) |
| yyjson_api_inline bool yyjson_is_uint | ( | const yyjson_val * | val | ) |
Returns whether the JSON value is unsigned integer (uint64_t). Returns false if val is NULL.
Definition at line 5370 of file yyjson.h.
Referenced by handle_object_array_all_integers_command(), handle_object_path_number_command(), long_from_value_runtime(), long_from_value_runtime_local(), and native_json_long_from_value().
| yyjson_api bool yyjson_locate_pos | ( | const char * | str, |
| size_t | len, | ||
| size_t | pos, | ||
| size_t * | line, | ||
| size_t * | col, | ||
| size_t * | chr ) |
Locate the line and column number for a byte position in a string. This can be used to get better description for error position.
| str | The input string. |
| len | The byte length of the input string. |
| pos | The byte position within the input string. |
| line | A pointer to receive the line number, starting from 1. |
| col | A pointer to receive the column number, starting from 1. |
| chr | A pointer to receive the character index, starting from 0. |
Definition at line 3078 of file yyjson.c.
References is_utf8_bom(), len, and likely.
| yyjson_api yyjson_mut_val * yyjson_merge_patch | ( | yyjson_mut_doc * | doc, |
| const yyjson_val * | orig, | ||
| const yyjson_val * | patch ) |
Creates and returns a merge-patched JSON value (RFC 7386). The memory of the returned value is allocated by the doc. Returns NULL if the patch could not be applied.
Definition at line 11284 of file yyjson.c.
References yyjson_mut_val::tag, yyjson_val::tag, yyjson_mut_val::uni, yyjson_val::uni, unlikely, unsafe_yyjson_get_len(), unsafe_yyjson_get_str(), unsafe_yyjson_is_null(), yyjson_is_obj(), yyjson_merge_patch(), yyjson_mut_obj(), yyjson_mut_obj_add(), yyjson_obj_foreach, yyjson_obj_getn(), and yyjson_val_mut_copy().
Referenced by yyjson_merge_patch().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr | ( | yyjson_mut_doc * | doc | ) |
Creates and returns an empty mutable array.
| doc | A mutable document, used for memory allocation only. |
Definition at line 6410 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_public_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_user_appointments_json_runtime(), ensure_mut_array_field_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_normalize_ucal_state_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_submitted_command(), handle_issue_business_invite_action_runtime(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_request_action_runtime(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), issue_browser_session_runtime(), surface_build_active_filters_runtime(), write_business_availability_api_response(), and write_business_services_api_response().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_add_arr | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr ) |
| yyjson_api_inline bool yyjson_mut_arr_add_bool | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| bool | val ) |
Adds a bool value at the end of the array.
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| val | The bool value to be added. |
| yyjson_api_inline bool yyjson_mut_arr_add_double | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| double | num ) |
Adds a double value at the end of the array.
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| num | The number to be added. |
| yyjson_api_inline bool yyjson_mut_arr_add_false | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr ) |
| yyjson_api_inline bool yyjson_mut_arr_add_float | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| float | num ) |
Adds a float value at the end of the array.
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| num | The number to be added. |
| yyjson_api_inline bool yyjson_mut_arr_add_int | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| int64_t | num ) |
Adds an integer value at the end of the array.
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| num | The number to be added. |
| yyjson_api_inline bool yyjson_mut_arr_add_null | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_add_obj | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr ) |
| yyjson_api_inline bool yyjson_mut_arr_add_real | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| double | num ) |
Adds a double value at the end of the array.
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| num | The number to be added. |
| yyjson_api_inline bool yyjson_mut_arr_add_sint | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| int64_t | num ) |
Adds a signed integer value at the end of the array.
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| num | The number to be added. |
| yyjson_api_inline bool yyjson_mut_arr_add_str | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| const char * | str ) |
Adds a string value at the end of the array (no copy).
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| str | A null-terminated UTF-8 string. |
| yyjson_api_inline bool yyjson_mut_arr_add_strcpy | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| const char * | str ) |
Adds a string value at the end of the array (copied).
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| str | A null-terminated UTF-8 string. |
| yyjson_api_inline bool yyjson_mut_arr_add_strn | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| const char * | str, | ||
| size_t | len ) |
Adds a string value at the end of the array (no copy).
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| str | A UTF-8 string, null-terminator is not required. |
| len | The length of the string, in bytes. |
| yyjson_api_inline bool yyjson_mut_arr_add_strncpy | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| const char * | str, | ||
| size_t | len ) |
Adds a string value at the end of the array (copied).
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| str | A UTF-8 string, null-terminator is not required. |
| len | The length of the string, in bytes. |
| yyjson_api_inline bool yyjson_mut_arr_add_true | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr ) |
| yyjson_api_inline bool yyjson_mut_arr_add_uint | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | arr, | ||
| uint64_t | num ) |
Adds an unsigned integer value at the end of the array.
| doc | The doc is only used for memory allocation. |
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| num | The number to be added. |
| yyjson_api_inline bool yyjson_mut_arr_add_val | ( | yyjson_mut_val * | arr, |
| yyjson_mut_val * | val ) |
| yyjson_api_inline bool yyjson_mut_arr_append | ( | yyjson_mut_val * | arr, |
| yyjson_mut_val * | val ) |
Inserts a value at the end of the array.
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| val | The value to be inserted. Returns false if it is NULL. |
Definition at line 6621 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), append_validation_error_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_public_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_user_appointments_json_runtime(), generated_surface_append_audit_event_mut_runtime(), generated_surface_report_add_field_error_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_mutate_command(), handle_generated_surface_submitted_command(), handle_issue_business_invite_action_runtime(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_request_action_runtime(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), handle_state_named_command(), issue_browser_session_runtime(), surface_build_active_filters_runtime(), unsafe_yyjson_mut_ptr_putx(), write_business_availability_api_response(), and write_business_services_api_response().
| yyjson_api_inline bool yyjson_mut_arr_clear | ( | yyjson_mut_val * | arr | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_get | ( | const yyjson_mut_val * | arr, |
| size_t | idx ) |
Returns the element at the specified position in this array. Returns NULL if array is NULL/empty or the index is out of bounds.
Definition at line 6318 of file yyjson.h.
Referenced by handle_accept_invite_action_runtime(), handle_action_route(), handle_password_reset_complete_action_runtime(), and handle_state_named_command().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_get_first | ( | const yyjson_mut_val * | arr | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_get_last | ( | const yyjson_mut_val * | arr | ) |
| yyjson_api_inline bool yyjson_mut_arr_insert | ( | yyjson_mut_val * | arr, |
| yyjson_mut_val * | val, | ||
| size_t | idx ) |
Inserts a value into an array at a given index.
| arr | The array to which the value is to be inserted. Returns false if it is NULL or not an array. |
| val | The value to be inserted. Returns false if it is NULL. |
| idx | The index to which to insert the new value. Returns false if the index is out of range. |
| yyjson_api_inline bool yyjson_mut_arr_iter_has_next | ( | yyjson_mut_arr_iter * | iter | ) |
| yyjson_api_inline bool yyjson_mut_arr_iter_init | ( | yyjson_mut_val * | arr, |
| yyjson_mut_arr_iter * | iter ) |
Initialize an iterator for this array.
| arr | The array to be iterated over. If arr is NULL or not an array, iter is cleared. |
| iter | The iterator to be initialized. If iter is NULL, returns false. |
Definition at line 6350 of file yyjson.h.
Referenced by yyjson_mut_patch().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_iter_next | ( | yyjson_mut_arr_iter * | iter | ) |
Returns the next element in the iteration, or NULL on end. If iter is NULL, returns NULL.
Definition at line 6375 of file yyjson.h.
Referenced by yyjson_mut_patch().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_iter_remove | ( | yyjson_mut_arr_iter * | iter | ) |
| yyjson_api_inline yyjson_mut_arr_iter yyjson_mut_arr_iter_with | ( | yyjson_mut_val * | arr | ) |
Create an iterator with an array, same as yyjson_mut_arr_iter_init().
| arr | The array to be iterated over. If arr is NULL or not an array, returns an empty iterator. |
| yyjson_api_inline bool yyjson_mut_arr_prepend | ( | yyjson_mut_val * | arr, |
| yyjson_mut_val * | val ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_remove | ( | yyjson_mut_val * | arr, |
| size_t | idx ) |
Removes and returns a value at index.
| arr | The array from which the value is to be removed. Returns false if it is NULL or not an array. |
| idx | The index from which to remove the value. Returns false if the index is out of range. |
Definition at line 6687 of file yyjson.h.
Referenced by handle_action_route(), handle_generated_surface_mutate_command(), and handle_state_named_command().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_remove_first | ( | yyjson_mut_val * | arr | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_remove_last | ( | yyjson_mut_val * | arr | ) |
| yyjson_api_inline bool yyjson_mut_arr_remove_range | ( | yyjson_mut_val * | arr, |
| size_t | idx, | ||
| size_t | len ) |
Removes all values within a specified range in the array.
| arr | The array from which the value is to be removed. Returns false if it is NULL or not an array. |
| idx | The start index of the range (0 is the first). |
| len | The number of items in the range (can be 0). |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_replace | ( | yyjson_mut_val * | arr, |
| size_t | idx, | ||
| yyjson_mut_val * | val ) |
Replaces a value at index and returns old value.
| arr | The array to which the value is to be replaced. Returns false if it is NULL or not an array. |
| idx | The index to which to replace the value. Returns false if the index is out of range. |
| val | The new value to replace. Returns false if it is NULL. |
| yyjson_api_inline bool yyjson_mut_arr_rotate | ( | yyjson_mut_val * | arr, |
| size_t | idx ) |
| yyjson_api_inline size_t yyjson_mut_arr_size | ( | const yyjson_mut_val * | arr | ) |
Returns the number of elements in this array. Returns 0 if arr is NULL or type is not array.
Definition at line 6314 of file yyjson.h.
Referenced by handle_state_named_command().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_bool | ( | yyjson_mut_doc * | doc, |
| const bool * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given boolean values.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of boolean values. |
| count | The value count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_double | ( | yyjson_mut_doc * | doc, |
| const double * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given double numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of double numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_float | ( | yyjson_mut_doc * | doc, |
| const float * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given float numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of float numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_real | ( | yyjson_mut_doc * | doc, |
| const double * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given real numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of real numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_sint | ( | yyjson_mut_doc * | doc, |
| const int64_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given sint numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of sint numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_sint16 | ( | yyjson_mut_doc * | doc, |
| const int16_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given int16 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of int16 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_sint32 | ( | yyjson_mut_doc * | doc, |
| const int32_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given int32 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of int32 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_sint64 | ( | yyjson_mut_doc * | doc, |
| const int64_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given int64 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of int64 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_sint8 | ( | yyjson_mut_doc * | doc, |
| const int8_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given int8 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of int8 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_str | ( | yyjson_mut_doc * | doc, |
| const char ** | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given strings, these strings will not be copied.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of UTF-8 null-terminator strings. If vals contains NULL, returns NULL. |
| count | The number of values in vals. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_strcpy | ( | yyjson_mut_doc * | doc, |
| const char ** | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given strings, these strings will be copied.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of UTF-8 null-terminator strings. If vals contains NULL, returns NULL. |
| count | The number of values in vals. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_strn | ( | yyjson_mut_doc * | doc, |
| const char ** | vals, | ||
| const size_t * | lens, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given strings and string lengths, these strings will not be copied.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of UTF-8 strings, null-terminator is not required. If vals contains NULL, returns NULL. |
| lens | A C array of string lengths, in bytes. |
| count | The number of strings in vals. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_strncpy | ( | yyjson_mut_doc * | doc, |
| const char ** | vals, | ||
| const size_t * | lens, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given strings and string lengths, these strings will be copied.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of UTF-8 strings, null-terminator is not required. If vals contains NULL, returns NULL. |
| lens | A C array of string lengths, in bytes. |
| count | The number of strings in vals. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_uint | ( | yyjson_mut_doc * | doc, |
| const uint64_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given uint numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of uint numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_uint16 | ( | yyjson_mut_doc * | doc, |
| const uint16_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given uint16 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of uint16 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_uint32 | ( | yyjson_mut_doc * | doc, |
| const uint32_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given uint32 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of uint32 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_uint64 | ( | yyjson_mut_doc * | doc, |
| const uint64_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given uint64 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of uint64 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_arr_with_uint8 | ( | yyjson_mut_doc * | doc, |
| const uint8_t * | vals, | ||
| size_t | count ) |
Creates and returns a new mutable array with the given uint8 numbers.
| doc | A mutable document, used for memory allocation only. If doc is NULL, returns NULL. |
| vals | A C array of uint8 numbers. |
| count | The number count. If this value is 0, an empty array is returned. |
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_bool | ( | yyjson_mut_doc * | doc, |
| bool | val ) |
Creates and returns a bool value, returns NULL on error.
Definition at line 6236 of file yyjson.h.
Referenced by handle_generated_surface_coerce_candidate_command(), handle_generated_surface_mutate_command(), and handle_state_named_command().
| yyjson_api void yyjson_mut_doc_free | ( | yyjson_mut_doc * | doc | ) |
Release the JSON document and free the memory. After calling this function, the doc and all values from the doc are no longer available. This function will do nothing if the doc is NULL.
Definition at line 2653 of file yyjson.c.
References yyjson_mut_doc::alc, yyjson_alc::ctx, yyjson_alc::free, yyjson_mut_doc::str_pool, unsafe_yyjson_str_pool_release(), unsafe_yyjson_val_pool_release(), and yyjson_mut_doc::val_pool.
Referenced by append_rate_limit_event_runtime_local(), append_validation_error_runtime(), appointments_render_page_params_json_dup_runtime(), build_artifact_local_app_manifest_json(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_dashboard_page_json_runtime(), emit_business_edit_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_json_string_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_book_form_page_json_runtime(), emit_service_edit_page_json_runtime(), emit_technician_edit_page_json_runtime(), emit_template_page_params_json_runtime(), emit_user_appointments_json_runtime(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), generated_surface_operation_path_dup_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_file_normalize_ucal_state_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_edit_page_json_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_mutate_command(), handle_generated_surface_params_json_command(), handle_generated_surface_submitted_command(), handle_generated_surface_validation_report_command(), handle_issue_business_invite_action_runtime(), handle_object_build_command(), handle_object_merge_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_template_declared_page_contract_command(), handle_template_layout_page_html_command(), handle_template_layout_page_json_command(), invite_accept_done_page_params_json_dup_runtime(), invite_accept_page_params_json_dup_runtime(), invite_created_page_params_json_dup_runtime(), issue_browser_session_runtime(), login_page_params_json_dup_runtime(), password_reset_complete_page_params_json_dup_runtime(), password_reset_request_page_params_json_dup_runtime(), password_reset_sent_page_params_json_dup_runtime(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_home_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), render_business_admin_empty_state_dup_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_page_html_dup_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_service_visual_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), revoke_session_by_cookie_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), yyjson_doc_mut_copy(), and yyjson_mut_doc_mut_copy().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_get_root | ( | yyjson_mut_doc * | doc | ) |
Returns the root value of this JSON document. Returns NULL if doc is NULL.
Definition at line 5915 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), append_validation_error_runtime(), build_artifact_local_app_manifest_json(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_normalize_ucal_state_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_mutate_command(), handle_generated_surface_validation_report_command(), handle_issue_business_invite_action_runtime(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_named_command(), issue_browser_session_runtime(), and revoke_session_by_cookie_runtime().
| yyjson_api yyjson_doc * yyjson_mut_doc_imut_copy | ( | const yyjson_mut_doc * | doc, |
| const yyjson_alc * | alc ) |
Copies and returns a new immutable document from input, returns NULL on error. This makes a deep-copy on the mutable document. The returned document should be freed with yyjson_doc_free().
Definition at line 2898 of file yyjson.c.
References yyjson_mut_doc::root, and yyjson_mut_val_imut_copy().
| yyjson_api yyjson_mut_doc * yyjson_mut_doc_mut_copy | ( | const yyjson_mut_doc * | doc, |
| const yyjson_alc * | alc ) |
Copies and returns a new mutable document from input, returns NULL on error. This makes a deep-copy on the mutable document. If allocator is NULL, the default allocator will be used.
Definition at line 2695 of file yyjson.c.
References yyjson_mut_doc::root, yyjson_mut_doc_free(), yyjson_mut_doc_new(), yyjson_mut_doc_set_root(), and yyjson_mut_val_mut_copy().
| yyjson_api yyjson_mut_doc * yyjson_mut_doc_new | ( | const yyjson_alc * | alc | ) |
Creates and returns a new mutable JSON document, returns NULL on error. If allocator is NULL, the default allocator will be used.
Definition at line 2663 of file yyjson.c.
References yyjson_mut_doc::alc, yyjson_str_pool::chunk_size, yyjson_val_pool::chunk_size, yyjson_str_pool::chunk_size_max, yyjson_val_pool::chunk_size_max, yyjson_alc::ctx, yyjson_alc::malloc, yyjson_mut_doc::str_pool, yyjson_mut_doc::val_pool, YYJSON_DEFAULT_ALC, YYJSON_MUT_DOC_STR_POOL_INIT_SIZE, YYJSON_MUT_DOC_STR_POOL_MAX_SIZE, YYJSON_MUT_DOC_VAL_POOL_INIT_SIZE, and YYJSON_MUT_DOC_VAL_POOL_MAX_SIZE.
Referenced by appointments_render_page_params_json_dup_runtime(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_dashboard_page_json_runtime(), emit_business_edit_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_json_string_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_book_form_page_json_runtime(), emit_service_edit_page_json_runtime(), emit_technician_edit_page_json_runtime(), emit_template_page_params_json_runtime(), emit_user_appointments_json_runtime(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), generated_surface_operation_path_dup_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_edit_page_json_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_params_json_command(), handle_generated_surface_submitted_command(), handle_object_build_command(), handle_object_merge_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_template_declared_page_contract_command(), handle_template_layout_page_html_command(), handle_template_layout_page_json_command(), invite_accept_done_page_params_json_dup_runtime(), invite_accept_page_params_json_dup_runtime(), invite_created_page_params_json_dup_runtime(), login_page_params_json_dup_runtime(), password_reset_complete_page_params_json_dup_runtime(), password_reset_request_page_params_json_dup_runtime(), password_reset_sent_page_params_json_dup_runtime(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_home_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), render_business_admin_empty_state_dup_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_page_html_dup_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_service_visual_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), yyjson_doc_mut_copy(), and yyjson_mut_doc_mut_copy().
| yyjson_api_inline bool yyjson_mut_doc_ptr_add | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| yyjson_mut_val * | new_val ) |
Add (insert) value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8 with null-terminator). |
| new_val | The value to be added. |
| yyjson_api_inline bool yyjson_mut_doc_ptr_addn | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val ) |
Add (insert) value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The value to be added. |
| yyjson_api_inline bool yyjson_mut_doc_ptr_addx | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| bool | create_parent, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Add (insert) value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The value to be added. |
| create_parent | Whether to create parent nodes if they do not exist. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_get | ( | const yyjson_mut_doc * | doc, |
| const char * | ptr ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_getn | ( | const yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_getx | ( | const yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Get value by a JSON Pointer.
| doc | The JSON document to be queried. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_remove | ( | yyjson_mut_doc * | doc, |
| const char * | ptr ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_removen | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_removex | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Remove value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_replace | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| yyjson_mut_val * | new_val ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_replacen | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val ) |
Replace value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The new value to replace the old one. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_doc_ptr_replacex | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Replace value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The new value to replace the old one. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline bool yyjson_mut_doc_ptr_set | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| yyjson_mut_val * | new_val ) |
Set value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8 with null-terminator). |
| new_val | The value to be set, pass NULL to remove. |
| yyjson_api_inline bool yyjson_mut_doc_ptr_setn | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val ) |
Set value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The value to be set, pass NULL to remove. |
| yyjson_api_inline bool yyjson_mut_doc_ptr_setx | ( | yyjson_mut_doc * | doc, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| bool | create_parent, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Set value by a JSON pointer.
| doc | The target JSON document. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The value to be set, pass NULL to remove. |
| create_parent | Whether to create parent nodes if they do not exist. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline void yyjson_mut_doc_set_root | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | root ) |
Sets the root value of this JSON document. Pass NULL to clear root value of the document.
Definition at line 5919 of file yyjson.h.
Referenced by appointments_render_page_params_json_dup_runtime(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_dashboard_page_json_runtime(), emit_business_edit_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_book_form_page_json_runtime(), emit_service_edit_page_json_runtime(), emit_technician_edit_page_json_runtime(), emit_template_page_params_json_runtime(), emit_user_appointments_json_runtime(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), generated_surface_operation_path_dup_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_edit_page_json_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_params_json_command(), handle_generated_surface_submitted_command(), handle_generated_surface_validation_report_command(), handle_object_build_command(), handle_object_merge_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), handle_state_event_stream_row_json_lines_command(), handle_template_layout_page_html_command(), handle_template_layout_page_json_command(), login_page_params_json_dup_runtime(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_home_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), render_business_admin_empty_state_dup_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_page_html_dup_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_service_visual_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), runtime_page_params_write_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), yyjson_doc_mut_copy(), and yyjson_mut_doc_mut_copy().
| yyjson_api bool yyjson_mut_doc_set_str_pool_size | ( | yyjson_mut_doc * | doc, |
| size_t | len ) |
Set the string pool size for a mutable document. This function does not allocate memory immediately, but uses the size when the next memory allocation is needed.
If the caller knows the approximate bytes of strings that the document needs to store (e.g. copy string with yyjson_mut_strcpy function), setting a larger size can avoid multiple memory allocations and improve performance.
| doc | The mutable document. |
| len | The desired string pool size in bytes (total string length). |
Definition at line 2639 of file yyjson.c.
References yyjson_str_pool::chunk_size, len, yyjson_mut_doc::str_pool, and USIZE_MAX.
| yyjson_api bool yyjson_mut_doc_set_val_pool_size | ( | yyjson_mut_doc * | doc, |
| size_t | count ) |
Set the value pool size for a mutable document. This function does not allocate memory immediately, but uses the size when the next memory allocation is needed.
If the caller knows the approximate number of values that the document needs to store (e.g. create new value with yyjson_mut_xxx functions), setting a larger size can avoid multiple memory allocations and improve performance.
| doc | The mutable document. |
| count | The desired value pool size (number of yyjson_mut_val). |
Definition at line 2646 of file yyjson.c.
References yyjson_val_pool::chunk_size, USIZE_MAX, and yyjson_mut_doc::val_pool.
| yyjson_api_inline yyjson_mut_val * yyjson_mut_double | ( | yyjson_mut_doc * | doc, |
| double | num ) |
| yyjson_api_inline bool yyjson_mut_equals | ( | const yyjson_mut_val * | lhs, |
| const yyjson_mut_val * | rhs ) |
Returns whether two JSON values are equal (deep compare). Returns false if lhs or rhs is NULL.
Definition at line 6059 of file yyjson.h.
Referenced by yyjson_mut_patch(), and yyjson_patch().
| yyjson_api_inline bool yyjson_mut_equals_str | ( | const yyjson_mut_val * | val, |
| const char * | str ) |
| yyjson_api_inline bool yyjson_mut_equals_strn | ( | const yyjson_mut_val * | val, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_false | ( | yyjson_mut_doc * | doc | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_float | ( | yyjson_mut_doc * | doc, |
| float | num ) |
| yyjson_api_inline bool yyjson_mut_get_bool | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline int yyjson_mut_get_int | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline size_t yyjson_mut_get_len | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline double yyjson_mut_get_num | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline const char * yyjson_mut_get_raw | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline double yyjson_mut_get_real | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline int64_t yyjson_mut_get_sint | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline const char * yyjson_mut_get_str | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline yyjson_subtype yyjson_mut_get_subtype | ( | const yyjson_mut_val * | val | ) |
Returns the JSON value's subtype. Returns YYJSON_SUBTYPE_NONE if val is NULL.
| yyjson_api_inline uint8_t yyjson_mut_get_tag | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline yyjson_type yyjson_mut_get_type | ( | const yyjson_mut_val * | val | ) |
Returns the JSON value's type. Returns YYJSON_TYPE_NONE if val is NULL.
| yyjson_api_inline const char * yyjson_mut_get_type_desc | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline uint64_t yyjson_mut_get_uint | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_int | ( | yyjson_mut_doc * | doc, |
| int64_t | num ) |
Creates and returns a signed integer value, returns NULL on error.
Definition at line 6251 of file yyjson.h.
Referenced by generated_surface_append_audit_event_mut_runtime(), generated_surface_normalize_order_mut_runtime(), handle_accept_invite_action_runtime(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_mutate_command(), handle_generated_surface_submitted_command(), and handle_state_named_command().
| yyjson_api_inline bool yyjson_mut_is_arr | ( | const yyjson_mut_val * | val | ) |
Returns whether the JSON value is array. Returns false if val is NULL.
Definition at line 5974 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), ensure_mut_array_field_runtime(), find_mut_array_item_by_long_field_runtime(), generated_surface_normalize_order_mut_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_mutate_command(), handle_issue_business_invite_action_runtime(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_named_command(), issue_browser_session_runtime(), revoke_session_by_cookie_runtime(), and yyjson_mut_patch().
| yyjson_api_inline bool yyjson_mut_is_bool | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_ctn | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_false | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_int | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_null | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_num | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_obj | ( | const yyjson_mut_val * | val | ) |
Returns whether the JSON value is object. Returns false if val is NULL.
Definition at line 5978 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), append_validation_error_runtime(), build_artifact_local_app_manifest_json(), find_mut_array_item_by_long_field_runtime(), generated_surface_normalize_order_mut_runtime(), generated_surface_report_add_field_error_runtime(), handle_action_route(), handle_file_normalize_ucal_state_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_mutate_command(), handle_generated_surface_validation_report_command(), handle_issue_business_invite_action_runtime(), handle_object_merge_command(), handle_password_reset_request_action_runtime(), handle_state_named_command(), issue_browser_session_runtime(), merge_patch_into_mut_object_runtime(), normalized_payload_object_mut_runtime(), revoke_session_by_cookie_runtime(), surface_build_active_filters_runtime(), surface_build_sort_config_runtime(), unsafe_yyjson_mut_ptr_removex(), unsafe_yyjson_mut_ptr_replacex(), and yyjson_mut_merge_patch().
| yyjson_api_inline bool yyjson_mut_is_raw | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_real | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_sint | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_str | ( | const yyjson_mut_val * | val | ) |
Returns whether the JSON value is string. Returns false if val is NULL.
Definition at line 5970 of file yyjson.h.
Referenced by yyjson_mut_patch().
| yyjson_api_inline bool yyjson_mut_is_true | ( | const yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_is_uint | ( | const yyjson_mut_val * | val | ) |
| yyjson_api yyjson_mut_val * yyjson_mut_merge_patch | ( | yyjson_mut_doc * | doc, |
| const yyjson_mut_val * | orig, | ||
| const yyjson_mut_val * | patch ) |
Creates and returns a merge-patched JSON value (RFC 7386). The memory of the returned value is allocated by the doc. Returns NULL if the patch could not be applied.
Definition at line 11336 of file yyjson.c.
References yyjson_mut_val::tag, yyjson_mut_val::uni, unlikely, unsafe_yyjson_get_len(), unsafe_yyjson_get_str(), unsafe_yyjson_is_null(), yyjson_mut_is_obj(), yyjson_mut_merge_patch(), yyjson_mut_obj(), yyjson_mut_obj_add(), yyjson_mut_obj_foreach, yyjson_mut_obj_getn(), and yyjson_mut_val_mut_copy().
Referenced by yyjson_mut_merge_patch().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_null | ( | yyjson_mut_doc * | doc | ) |
Creates and returns a null value, returns NULL on error.
Definition at line 6224 of file yyjson.h.
Referenced by add_json_string_or_null_runtime(), generated_surface_append_audit_event_mut_runtime(), handle_generated_surface_context_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_issue_business_invite_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_named_command(), and issue_browser_session_runtime().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj | ( | yyjson_mut_doc * | doc | ) |
Creates and returns a mutable object, returns NULL on error.
Definition at line 7086 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), append_validation_error_runtime(), appointments_render_page_params_json_dup_runtime(), build_artifact_local_app_manifest_json(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_dashboard_page_json_runtime(), emit_business_edit_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_book_form_page_json_runtime(), emit_service_edit_page_json_runtime(), emit_technician_edit_page_json_runtime(), emit_template_page_params_json_runtime(), emit_user_appointments_json_runtime(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), generated_surface_append_audit_event_mut_runtime(), generated_surface_operation_path_dup_runtime(), generated_surface_report_add_field_error_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_edit_page_json_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_params_json_command(), handle_generated_surface_submitted_command(), handle_issue_business_invite_action_runtime(), handle_object_build_command(), handle_password_reset_request_action_runtime(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_template_declared_page_contract_command(), handle_template_layout_page_html_command(), handle_template_layout_page_json_command(), invite_accept_done_page_params_json_dup_runtime(), invite_accept_page_params_json_dup_runtime(), invite_created_page_params_json_dup_runtime(), issue_browser_session_runtime(), login_page_params_json_dup_runtime(), normalized_payload_object_mut_runtime(), password_reset_complete_page_params_json_dup_runtime(), password_reset_request_page_params_json_dup_runtime(), password_reset_sent_page_params_json_dup_runtime(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_home_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), render_business_admin_empty_state_dup_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_page_html_dup_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_service_visual_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), route_template_match_into_mut_obj_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), surface_build_sort_config_runtime(), unsafe_yyjson_mut_ptr_putx(), write_business_availability_api_response(), write_business_services_api_response(), yyjson_merge_patch(), and yyjson_mut_merge_patch().
| yyjson_api_inline bool yyjson_mut_obj_add | ( | yyjson_mut_val * | obj, |
| yyjson_mut_val * | key, | ||
| yyjson_mut_val * | val ) |
Adds a key-value pair at the end of the object. This function allows duplicate keys in one object.
| obj | The object to which the new key-value pair is to be added. |
| key | The key, should be a string which is created by yyjson_mut_str(), yyjson_mut_strn(), yyjson_mut_strcpy() or yyjson_mut_strncpy(). |
| val | The value to add to the object. |
Definition at line 7248 of file yyjson.h.
Referenced by handle_state_named_command(), unsafe_yyjson_mut_ptr_putx(), yyjson_merge_patch(), and yyjson_mut_merge_patch().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_add_arr | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key ) |
Creates and adds a new array to the target object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_bool | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| bool | val ) |
Adds a bool value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
Definition at line 7404 of file yyjson.h.
Referenced by emit_business_admin_service_rows_json_runtime(), emit_business_public_page_json_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_generated_surface_context_command(), handle_object_build_command(), and handle_state_ucal_import_row_json_lines_command().
| yyjson_api_inline bool yyjson_mut_obj_add_double | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| double | val ) |
Adds a double value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_false | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key ) |
Adds a false value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_float | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| float | val ) |
Adds a float value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_int | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| int64_t | val ) |
Adds an int value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
Definition at line 7425 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), build_artifact_local_app_manifest_json(), business_calendar_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_book_form_page_json_runtime(), emit_user_appointments_json_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_generated_surface_context_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_issue_business_invite_action_runtime(), handle_object_build_command(), handle_password_reset_request_action_runtime(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), issue_browser_session_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), and service_book_form_page_params_json_dup_runtime().
| yyjson_api_inline bool yyjson_mut_obj_add_null | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key ) |
Adds a null value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
Definition at line 7386 of file yyjson.h.
Referenced by handle_object_build_command().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_add_obj | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key ) |
Creates and adds a new object to the target object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_real | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| double | val ) |
Adds a real value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_sint | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| int64_t | val ) |
Adds a signed integer value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_str | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| const char * | val ) |
Adds a string value at the end of the object. The key and val should be null-terminated UTF-8 strings. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_strcpy | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| const char * | val ) |
Adds a string value at the end of the object. The key and val should be null-terminated UTF-8 strings. The value string is copied. This function allows duplicate keys in one object.
Definition at line 7479 of file yyjson.h.
Referenced by add_json_string_or_null_runtime(), append_rate_limit_event_runtime_local(), append_validation_error_runtime(), appointments_render_page_params_json_dup_runtime(), build_artifact_local_app_manifest_json(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_appointments_page_json_runtime(), emit_business_admin_page_json_runtime(), emit_business_admin_service_rows_json_runtime(), emit_business_admin_technician_rows_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_calendar_render_page_json_runtime(), emit_business_dashboard_page_json_runtime(), emit_business_edit_page_json_runtime(), emit_business_public_page_json_runtime(), emit_business_public_render_page_json_runtime(), emit_calendar_page_json_runtime(), emit_explore_page_json_runtime(), emit_manageable_business_cards_json_runtime(), emit_managed_appointments_json_runtime(), emit_profile_page_json_runtime(), emit_profile_render_page_json_runtime(), emit_public_business_cards_json_runtime(), emit_service_book_form_page_json_runtime(), emit_service_edit_page_json_runtime(), emit_technician_edit_page_json_runtime(), emit_template_page_params_json_runtime(), emit_user_appointments_json_runtime(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), generated_admin_surface_page_copy_runtime(), generated_surface_append_audit_event_mut_runtime(), generated_surface_operation_path_dup_runtime(), generated_surface_report_add_field_error_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_file_normalize_ucal_state_command(), handle_generated_surface_context_command(), handle_generated_surface_edit_page_json_command(), handle_generated_surface_list_columns_json_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_generated_surface_params_json_command(), handle_generated_surface_submitted_command(), handle_issue_business_invite_action_runtime(), handle_object_build_command(), handle_password_reset_request_action_runtime(), handle_request_booking_options_json_from_form_command(), handle_request_lines_to_booking_options_json_command(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), handle_state_ucal_import_row_json_lines_command(), handle_template_declared_page_contract_command(), handle_template_layout_page_html_command(), handle_template_layout_page_json_command(), issue_browser_session_runtime(), login_page_params_json_dup_runtime(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_home_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), render_business_admin_empty_state_dup_runtime(), render_business_dashboard_cards_html_dup_runtime(), render_page_html_dup_runtime(), render_service_booking_options_editor_html_dup_runtime(), render_service_sort_order_options_html_dup_runtime(), render_service_visual_html_dup_runtime(), render_technician_checkboxes_html_dup_runtime(), runtime_page_params_add_escaped_string_runtime(), runtime_page_params_add_string_runtime(), service_book_form_page_params_json_dup_runtime(), and service_edit_page_params_json_dup_runtime().
| yyjson_api_inline bool yyjson_mut_obj_add_strn | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| const char * | val, | ||
| size_t | len ) |
Adds a string value at the end of the object. The key should be a null-terminated UTF-8 string. The val should be a UTF-8 string, null-terminator is not required. The len should be the length of the val, in bytes. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_strncpy | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| const char * | val, | ||
| size_t | len ) |
Adds a string value at the end of the object. The key should be a null-terminated UTF-8 string. The val should be a UTF-8 string, null-terminator is not required. The len should be the length of the val, in bytes. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_true | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key ) |
Adds a true value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_uint | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| uint64_t | val ) |
Adds an unsigned integer value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
| yyjson_api_inline bool yyjson_mut_obj_add_val | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| yyjson_mut_val * | val ) |
Adds a JSON value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicate keys in one object.
Definition at line 7521 of file yyjson.h.
Referenced by handle_file_normalize_ucal_state_command().
| yyjson_api_inline bool yyjson_mut_obj_clear | ( | yyjson_mut_val * | obj | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_get | ( | const yyjson_mut_val * | obj, |
| const char * | key ) |
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
The key should be a null-terminated UTF-8 string.
Definition at line 6970 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), build_artifact_local_app_manifest_json(), ensure_mut_array_field_runtime(), find_mut_array_item_by_long_field_runtime(), generated_surface_normalize_order_mut_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_normalize_ucal_state_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_mutate_command(), handle_issue_business_invite_action_runtime(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_named_command(), issue_browser_session_runtime(), revoke_session_by_cookie_runtime(), and yyjson_mut_patch().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_getn | ( | const yyjson_mut_val * | obj, |
| const char * | key, | ||
| size_t | key_len ) |
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
The key should be a UTF-8 string, null-terminator is not required. The key_len should be the length of the key, in bytes.
Definition at line 6975 of file yyjson.h.
Referenced by yyjson_mut_merge_patch().
| yyjson_api_inline bool yyjson_mut_obj_insert | ( | yyjson_mut_val * | obj, |
| yyjson_mut_val * | key, | ||
| yyjson_mut_val * | val, | ||
| size_t | idx ) |
Inserts a key-value pair to the object at the given position. This function allows duplicate keys in one object.
| obj | The object to which the new key-value pair is to be added. |
| key | The key, should be a string which is created by yyjson_mut_str(), yyjson_mut_strn(), yyjson_mut_strcpy() or yyjson_mut_strncpy(). |
| val | The value to add to the object. |
| idx | The index to which to insert the new pair. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_iter_get | ( | yyjson_mut_obj_iter * | iter, |
| const char * | key ) |
Iterates to a specified key and returns the value.
This function does the same thing as yyjson_mut_obj_get(), but is much faster if the ordering of the keys is known at compile-time and you are using the same order to look up the values. If the key exists in this object, then the iterator will stop at the next key, otherwise the iterator will not change and NULL is returned.
| iter | The object iterator, should not be NULL. |
| key | The key, should be a UTF-8 string with null-terminator. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_iter_get_val | ( | yyjson_mut_val * | key | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_iter_getn | ( | yyjson_mut_obj_iter * | iter, |
| const char * | key, | ||
| size_t | key_len ) |
Iterates to a specified key and returns the value.
This function does the same thing as yyjson_mut_obj_getn() but is much faster if the ordering of the keys is known at compile-time and you are using the same order to look up the values. If the key exists in this object, then the iterator will stop at the next key, otherwise the iterator will not change and NULL is returned.
| iter | The object iterator, should not be NULL. |
| key | The key, should be a UTF-8 string, null-terminator is not required. |
| key_len | The length of key, in bytes. |
Definition at line 7059 of file yyjson.h.
Referenced by unsafe_yyjson_mut_equals().
| yyjson_api_inline bool yyjson_mut_obj_iter_has_next | ( | yyjson_mut_obj_iter * | iter | ) |
| yyjson_api_inline bool yyjson_mut_obj_iter_init | ( | yyjson_mut_val * | obj, |
| yyjson_mut_obj_iter * | iter ) |
Initialize an iterator for this object.
| obj | The object to be iterated over. If obj is NULL or not an object, iter is cleared. |
| iter | The iterator to be initialized. If iter is NULL, returns false. |
Definition at line 6995 of file yyjson.h.
Referenced by unsafe_yyjson_mut_equals().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_iter_next | ( | yyjson_mut_obj_iter * | iter | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_iter_remove | ( | yyjson_mut_obj_iter * | iter | ) |
| yyjson_api_inline yyjson_mut_obj_iter yyjson_mut_obj_iter_with | ( | yyjson_mut_val * | obj | ) |
Create an iterator with an object, same as yyjson_mut_obj_iter_init().
| obj | The object to be iterated over. If obj is NULL or not an object, returns an empty iterator. |
| yyjson_api_inline bool yyjson_mut_obj_put | ( | yyjson_mut_val * | obj, |
| yyjson_mut_val * | key, | ||
| yyjson_mut_val * | val ) |
Sets a key-value pair at the end of the object. This function may remove all key-value pairs for the given key before adding.
| obj | The object to which the new key-value pair is to be added. |
| key | The key, should be a string which is created by yyjson_mut_str(), yyjson_mut_strn(), yyjson_mut_strcpy() or yyjson_mut_strncpy(). |
| val | The value to add to the object. If this value is null, the behavior is the same as yyjson_mut_obj_remove(). |
Definition at line 7259 of file yyjson.h.
Referenced by add_json_string_or_null_runtime(), append_rate_limit_event_runtime_local(), build_artifact_local_app_manifest_json(), business_detail_admin_render_page_params_json_dup_runtime(), emit_business_admin_page_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_public_page_json_runtime(), emit_profile_page_json_runtime(), ensure_mut_array_field_runtime(), generated_surface_append_audit_event_mut_runtime(), generated_surface_normalize_order_mut_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_mutate_command(), handle_generated_surface_submitted_command(), handle_issue_business_invite_action_runtime(), handle_object_build_command(), handle_object_merge_command(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), issue_browser_session_runtime(), merge_patch_into_mut_object_runtime(), revoke_session_by_cookie_runtime(), route_template_match_into_mut_obj_runtime(), surface_build_active_filters_runtime(), surface_build_sort_config_runtime(), unsafe_yyjson_mut_ptr_putx(), unsafe_yyjson_mut_ptr_removex(), unsafe_yyjson_mut_ptr_replacex(), write_business_availability_api_response(), and write_business_services_api_response().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_remove | ( | yyjson_mut_val * | obj, |
| yyjson_mut_val * | key ) |
Removes all key-value pairs from the object with the given key.
| obj | The object from which the key-value pair is to be removed. |
| key | The key, should be a string value. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_remove_key | ( | yyjson_mut_val * | obj, |
| const char * | key ) |
Removes all key-value pairs from the object with the given key.
| obj | The object from which the key-value pair is to be removed. |
| key | The key, should be a UTF-8 string with null-terminator. |
Definition at line 7316 of file yyjson.h.
Referenced by build_artifact_local_app_manifest_json(), ensure_mut_array_field_runtime(), and handle_state_named_command().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_remove_keyn | ( | yyjson_mut_val * | obj, |
| const char * | key, | ||
| size_t | key_len ) |
Removes all key-value pairs from the object with the given key.
| obj | The object from which the key-value pair is to be removed. |
| key | The key, should be a UTF-8 string, null-terminator is not required. |
| key_len | The length of the key. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_remove_str | ( | yyjson_mut_val * | obj, |
| const char * | key ) |
Removes all key-value pairs for the given key. Returns the first value to which the specified key is mapped or NULL if this object contains no mapping for the key. The key should be a null-terminated UTF-8 string.
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_remove_strn | ( | yyjson_mut_val * | obj, |
| const char * | key, | ||
| size_t | len ) |
Removes all key-value pairs for the given key. Returns the first value to which the specified key is mapped or NULL if this object contains no mapping for the key. The key should be a UTF-8 string, null-terminator is not required. The len should be the length of the key, in bytes.
| yyjson_api_inline bool yyjson_mut_obj_rename_key | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| const char * | new_key ) |
Replaces all matching keys with the new key. Returns true if at least one key was renamed. The key and new_key should be a null-terminated UTF-8 string. The new_key is copied and held by doc.
| yyjson_api_inline bool yyjson_mut_obj_rename_keyn | ( | yyjson_mut_doc * | doc, |
| yyjson_mut_val * | obj, | ||
| const char * | key, | ||
| size_t | len, | ||
| const char * | new_key, | ||
| size_t | new_len ) |
Replaces all matching keys with the new key. Returns true if at least one key was renamed. The key and new_key should be a UTF-8 string, null-terminator is not required. The new_key is copied and held by doc.
| yyjson_api_inline bool yyjson_mut_obj_replace | ( | yyjson_mut_val * | obj, |
| yyjson_mut_val * | key, | ||
| yyjson_mut_val * | val ) |
Replaces value from the object with given key. If the key does not exist, or the value is NULL, it will fail.
| obj | The object to which the value is to be replaced. |
| key | The key, should be a string value. |
| val | The value to replace into the object. |
| yyjson_api_inline bool yyjson_mut_obj_rotate | ( | yyjson_mut_val * | obj, |
| size_t | idx ) |
Rotates key-value pairs in the object for the given number of times. For example: {"a":1,"b":2,"c":3,"d":4} rotate 1 is {"b":2,"c":3,"d":4,"a":1}.
| obj | The object to be rotated. |
| idx | Index (or times) to rotate. |
| yyjson_api_inline size_t yyjson_mut_obj_size | ( | const yyjson_mut_val * | obj | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_with_kv | ( | yyjson_mut_doc * | doc, |
| const char ** | kv_pairs, | ||
| size_t | pair_count ) |
Creates and returns a mutable object with key-value pairs and pair count, returns NULL on error. The keys and values are not copied. They should be null-terminated UTF-8 strings.
Example
| yyjson_api_inline yyjson_mut_val * yyjson_mut_obj_with_str | ( | yyjson_mut_doc * | doc, |
| const char ** | keys, | ||
| const char ** | vals, | ||
| size_t | count ) |
Creates and returns a mutable object with keys and values, returns NULL on error. The keys and values are not copied. They should be null-terminated UTF-8 strings.
Example
| yyjson_api yyjson_mut_val * yyjson_mut_patch | ( | yyjson_mut_doc * | doc, |
| const yyjson_mut_val * | orig, | ||
| const yyjson_mut_val * | patch, | ||
| yyjson_patch_err * | err ) |
Creates and returns a patched JSON value (RFC 6902). The memory of the returned value is allocated by the doc. The err is used to receive error information, pass NULL if not needed. Returns NULL if the patch could not be applied.
Definition at line 11147 of file yyjson.c.
References constcast, PATCH_OP_ADD, PATCH_OP_COPY, patch_op_get(), PATCH_OP_MOVE, PATCH_OP_REMOVE, PATCH_OP_REPLACE, PATCH_OP_TEST, ptr_add, ptr_get, ptr_remove, ptr_replace, return_err, return_err_copy, return_err_key, return_err_val, unlikely, unsafe_yyjson_get_len(), unsafe_yyjson_is_obj(), yyjson_mut_arr_iter_init(), yyjson_mut_arr_iter_next(), yyjson_mut_equals(), yyjson_mut_is_arr(), yyjson_mut_is_str(), yyjson_mut_obj_get(), and yyjson_mut_val_mut_copy().
| yyjson_api_inline bool yyjson_mut_ptr_add | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_mut_doc * | doc ) |
Add (insert) value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8 with null-terminator). |
| doc | Only used to create new values when needed. |
| new_val | The value to be added. |
| yyjson_api_inline bool yyjson_mut_ptr_addn | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_mut_doc * | doc ) |
Add (insert) value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| doc | Only used to create new values when needed. |
| new_val | The value to be added. |
| yyjson_api_inline bool yyjson_mut_ptr_addx | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_mut_doc * | doc, | ||
| bool | create_parent, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Add (insert) value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| doc | Only used to create new values when needed. |
| new_val | The value to be added. |
| create_parent | Whether to create parent nodes if they do not exist. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_get | ( | const yyjson_mut_val * | val, |
| const char * | ptr ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_getn | ( | const yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_getx | ( | const yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Get value by a JSON Pointer.
| val | The JSON value to be queried. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_remove | ( | yyjson_mut_val * | val, |
| const char * | ptr ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_removen | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_removex | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Remove value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_replace | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| yyjson_mut_val * | new_val ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_replacen | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val ) |
Replace value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The new value to replace the old one. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_ptr_replacex | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Replace value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The new value to replace the old one. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline bool yyjson_mut_ptr_set | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_mut_doc * | doc ) |
Set value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8 with null-terminator). |
| new_val | The value to be set, pass NULL to remove. |
| doc | Only used to create new values when needed. |
| yyjson_api_inline bool yyjson_mut_ptr_setn | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_mut_doc * | doc ) |
Set value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The value to be set, pass NULL to remove. |
| doc | Only used to create new values when needed. |
| yyjson_api_inline bool yyjson_mut_ptr_setx | ( | yyjson_mut_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_mut_val * | new_val, | ||
| yyjson_mut_doc * | doc, | ||
| bool | create_parent, | ||
| yyjson_ptr_ctx * | ctx, | ||
| yyjson_ptr_err * | err ) |
Set value by a JSON pointer.
| val | The target JSON value. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| new_val | The value to be set, pass NULL to remove. |
| doc | Only used to create new values when needed. |
| create_parent | Whether to create parent nodes if they do not exist. |
| ctx | A pointer to store the result context, or NULL if not needed. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_raw | ( | yyjson_mut_doc * | doc, |
| const char * | str ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_rawcpy | ( | yyjson_mut_doc * | doc, |
| const char * | str ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_rawn | ( | yyjson_mut_doc * | doc, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_rawncpy | ( | yyjson_mut_doc * | doc, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline const char * yyjson_mut_read_number | ( | const char * | dat, |
| yyjson_mut_val * | val, | ||
| yyjson_read_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_read_err * | err ) |
Same as yyjson_read_number().
Definition at line 1221 of file yyjson.h.
References yyjson_incr_state::alc, yyjson_incr_state::flg, yyjson_incr_state::val, yyjson_api_inline, and yyjson_read_number().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_real | ( | yyjson_mut_doc * | doc, |
| double | num ) |
| yyjson_api_inline bool yyjson_mut_set_arr | ( | yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_set_bool | ( | yyjson_mut_val * | val, |
| bool | num ) |
| yyjson_api_inline bool yyjson_mut_set_double | ( | yyjson_mut_val * | val, |
| double | num ) |
| yyjson_api_inline bool yyjson_mut_set_float | ( | yyjson_mut_val * | val, |
| float | num ) |
| yyjson_api_inline bool yyjson_mut_set_fp_to_fixed | ( | yyjson_mut_val * | val, |
| int | prec ) |
Set the floating-point number's output format to fixed-point notation. Returns false if val is NULL or is not real type.
| yyjson_api_inline bool yyjson_mut_set_fp_to_float | ( | yyjson_mut_val * | val, |
| bool | flt ) |
Set the floating-point number's output format to single-precision. Returns false if val is NULL or is not real type.
| yyjson_api_inline bool yyjson_mut_set_int | ( | yyjson_mut_val * | val, |
| int64_t | num ) |
| yyjson_api_inline bool yyjson_mut_set_null | ( | yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_set_obj | ( | yyjson_mut_val * | val | ) |
| yyjson_api_inline bool yyjson_mut_set_raw | ( | yyjson_mut_val * | val, |
| const char * | raw, | ||
| size_t | len ) |
| yyjson_api_inline bool yyjson_mut_set_real | ( | yyjson_mut_val * | val, |
| double | num ) |
| yyjson_api_inline bool yyjson_mut_set_sint | ( | yyjson_mut_val * | val, |
| int64_t | num ) |
| yyjson_api_inline bool yyjson_mut_set_str | ( | yyjson_mut_val * | val, |
| const char * | str ) |
| yyjson_api_inline bool yyjson_mut_set_str_noesc | ( | yyjson_mut_val * | val, |
| bool | noesc ) |
Marks this string as not needing to be escaped during JSON writing. This can be used to avoid the overhead of escaping if the string contains only characters that do not require escaping. Returns false if val is NULL or is not string.
| yyjson_api_inline bool yyjson_mut_set_strn | ( | yyjson_mut_val * | val, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline bool yyjson_mut_set_uint | ( | yyjson_mut_val * | val, |
| uint64_t | num ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_sint | ( | yyjson_mut_doc * | doc, |
| int64_t | num ) |
Creates and returns a signed integer value, returns NULL on error.
Definition at line 6246 of file yyjson.h.
Referenced by handle_action_route().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_str | ( | yyjson_mut_doc * | doc, |
| const char * | str ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_strcpy | ( | yyjson_mut_doc * | doc, |
| const char * | str ) |
Creates and returns a string value, returns NULL on error. The str should be a null-terminated UTF-8 string. The input string is copied and held by the document.
Definition at line 6282 of file yyjson.h.
Referenced by add_json_string_or_null_runtime(), append_rate_limit_event_runtime_local(), build_artifact_local_app_manifest_json(), business_detail_admin_render_page_params_json_dup_runtime(), emit_business_admin_page_json_runtime(), emit_business_calendar_page_json_runtime(), emit_business_public_page_json_runtime(), emit_json_string_runtime(), emit_profile_page_json_runtime(), ensure_mut_array_field_runtime(), generated_surface_append_audit_event_mut_runtime(), generated_surface_normalize_order_mut_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_mutate_command(), handle_generated_surface_submitted_command(), handle_issue_business_invite_action_runtime(), handle_object_build_command(), handle_object_merge_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), issue_browser_session_runtime(), merge_patch_into_mut_object_runtime(), revoke_session_by_cookie_runtime(), route_template_match_into_mut_obj_runtime(), surface_build_active_filters_runtime(), surface_build_sort_config_runtime(), write_business_availability_api_response(), and write_business_services_api_response().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_strn | ( | yyjson_mut_doc * | doc, |
| const char * | str, | ||
| size_t | len ) |
Creates and returns a string value, returns NULL on error. The str should be a UTF-8 string, null-terminator is not required.
Definition at line 6276 of file yyjson.h.
Referenced by ptr_new_key().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_strncpy | ( | yyjson_mut_doc * | doc, |
| const char * | str, | ||
| size_t | len ) |
Creates and returns a string value, returns NULL on error. The str should be a UTF-8 string, null-terminator is not required. The input string is copied and held by the document.
Definition at line 6295 of file yyjson.h.
Referenced by handle_object_relative_path_array_to_absolute_json_command(), and ptr_new_key().
| yyjson_api_inline yyjson_mut_val * yyjson_mut_true | ( | yyjson_mut_doc * | doc | ) |
| yyjson_api_inline yyjson_mut_val * yyjson_mut_uint | ( | yyjson_mut_doc * | doc, |
| uint64_t | num ) |
| yyjson_api yyjson_doc * yyjson_mut_val_imut_copy | ( | const yyjson_mut_val * | val, |
| const yyjson_alc * | alc ) |
Copies and returns a new immutable document from input, returns NULL on error. This makes a deep-copy on the mutable value. The returned document should be freed with yyjson_doc_free().
Definition at line 2904 of file yyjson.c.
References yyjson_doc::alc, yyjson_alc::ctx, yyjson_doc::dat_read, yyjson_alc::free, yyjson_alc::malloc, yyjson_doc::root, size_align_up(), yyjson_doc::str_pool, yyjson_doc::val_read, YYJSON_DEFAULT_ALC, yyjson_imut_copy(), and yyjson_mut_stat().
Referenced by yyjson_mut_doc_imut_copy().
| yyjson_api yyjson_mut_val * yyjson_mut_val_mut_copy | ( | yyjson_mut_doc * | doc, |
| const yyjson_mut_val * | val ) |
Copies and returns a new mutable value from input, returns NULL on error. This makes a deep-copy on the mutable value. The memory is managed by the mutable document.
Definition at line 2826 of file yyjson.c.
References unsafe_yyjson_mut_val_mut_copy().
Referenced by yyjson_mut_doc_mut_copy(), yyjson_mut_merge_patch(), yyjson_mut_patch(), and yyjson_patch().
| yyjson_api_inline char * yyjson_mut_val_write | ( | const yyjson_mut_val * | val, |
| yyjson_write_flag | flg, | ||
| size_t * | len ) |
Write a value to JSON string.
This function is thread-safe when: The val is not modified by other threads.
| val | The JSON root value. If val is NULL, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
Definition at line 1869 of file yyjson.h.
References len, yyjson_api_inline, and yyjson_mut_val_write_opts().
Referenced by emit_compact_json_mut_value_runtime(), emit_json_string_runtime(), handle_generated_surface_default_candidate_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), and handle_state_named_command().
| yyjson_api size_t yyjson_mut_val_write_buf | ( | char * | buf, |
| size_t | buf_len, | ||
| const yyjson_mut_val * | val, | ||
| yyjson_write_flag | flg, | ||
| yyjson_write_err * | err ) |
Write a value into a buffer.
This function does not allocate memory, but the buffer must be larger than the final JSON size to allow temporary space. See API.md for details.
| buf | The output buffer. If buf is NULL, returns 0. |
| buf_len | The buffer length. If buf_len is too small, returns 0. |
| val | The JSON root value. If val is NULL, returns 0. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10365 of file yyjson.c.
References yyjson_write_err::code, yyjson_write_err::msg, mut_write_root(), unlikely, YYJSON_NULL_ALC, and YYJSON_WRITE_ERROR_INVALID_PARAMETER.
Referenced by yyjson_mut_write_buf().
| yyjson_api bool yyjson_mut_val_write_file | ( | const char * | path, |
| const yyjson_mut_val * | val, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a value to JSON file with options.
This function is thread-safe when:
| path | The JSON file's path. This should be a null-terminated string using the system's native encoding. If path is NULL or invalid, returns false. If the file is not empty, its content is discarded. |
| val | The mutable JSON root value. If val is NULL, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10389 of file yyjson.c.
References yyjson_write_err::code, constcast, yyjson_alc::ctx, yyjson_alc::free, yyjson_write_err::msg, unlikely, write_dat_to_file(), YYJSON_DEFAULT_ALC, yyjson_mut_val_write_opts(), and YYJSON_WRITE_ERROR_INVALID_PARAMETER.
Referenced by yyjson_mut_write_file().
| yyjson_api bool yyjson_mut_val_write_fp | ( | FILE * | fp, |
| const yyjson_mut_val * | val, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a value to file pointer with options.
| fp | The file pointer. The data will be written to the current position of the file. If fp is NULL or invalid, returns false. |
| val | The mutable JSON root value. If val is NULL, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10415 of file yyjson.c.
References yyjson_write_err::code, constcast, yyjson_alc::ctx, yyjson_alc::free, yyjson_write_err::msg, unlikely, write_dat_to_fp(), YYJSON_DEFAULT_ALC, yyjson_mut_val_write_opts(), and YYJSON_WRITE_ERROR_INVALID_PARAMETER.
Referenced by yyjson_mut_write_fp().
| yyjson_api char * yyjson_mut_val_write_opts | ( | const yyjson_mut_val * | val, |
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| size_t * | len, | ||
| yyjson_write_err * | err ) |
Write a value to JSON string with options.
This function is thread-safe when:
| val | The mutable JSON root value. If val is NULL, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10339 of file yyjson.c.
References mut_write_root().
Referenced by yyjson_mut_val_write(), yyjson_mut_val_write_file(), and yyjson_mut_val_write_fp().
| yyjson_api_inline char * yyjson_mut_write | ( | const yyjson_mut_doc * | doc, |
| yyjson_write_flag | flg, | ||
| size_t * | len ) |
Write a document to JSON string.
This function is thread-safe when: The doc is not modified by other threads.
| doc | The JSON document. If doc is NULL or has no root, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
Definition at line 1604 of file yyjson.h.
References len, yyjson_api_inline, and yyjson_mut_write_opts().
Referenced by append_rate_limit_event_runtime_local(), appointments_render_page_params_json_dup_runtime(), build_artifact_local_app_manifest_json(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_compact_mutable_json_doc_runtime(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_issue_business_invite_action_runtime(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_template_layout_page_html_command(), issue_browser_session_runtime(), login_page_params_json_dup_runtime(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_home_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), render_business_fragment_from_doc_dup_runtime(), render_page_html_dup_runtime(), revoke_session_by_cookie_runtime(), runtime_page_params_write_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), and write_mutable_json_doc_runtime().
| yyjson_api size_t yyjson_mut_write_buf | ( | char * | buf, |
| size_t | buf_len, | ||
| const yyjson_mut_doc * | doc, | ||
| yyjson_write_flag | flg, | ||
| yyjson_write_err * | err ) |
Write a document into a buffer.
This function does not allocate memory, but the buffer must be larger than the final JSON size to allow temporary space. See API.md for details.
| buf | The output buffer. If buf is NULL, returns 0. |
| buf_len | The buffer length. If buf_len is too small, returns 0. |
| doc | The JSON document. If doc is NULL or has no root, returns 0. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10379 of file yyjson.c.
References yyjson_mut_doc::root, and yyjson_mut_val_write_buf().
| yyjson_api bool yyjson_mut_write_file | ( | const char * | path, |
| const yyjson_mut_doc * | doc, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a document to JSON file with options.
This function is thread-safe when:
| path | The JSON file's path. This should be a null-terminated string using the system's native encoding. If path is NULL or invalid, returns false. If the file is not empty, its content is discarded. |
| doc | The mutable JSON document. If doc is NULL or has no root, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10441 of file yyjson.c.
References yyjson_mut_doc::root, and yyjson_mut_val_write_file().
| yyjson_api bool yyjson_mut_write_fp | ( | FILE * | fp, |
| const yyjson_mut_doc * | doc, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a document to file pointer with options.
| fp | The file pointer. The data will be written to the current position of the file. If fp is NULL or invalid, returns false. |
| doc | The mutable JSON document. If doc is NULL or has no root, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10450 of file yyjson.c.
References yyjson_mut_doc::root, and yyjson_mut_val_write_fp().
| yyjson_api_inline char * yyjson_mut_write_number | ( | const yyjson_mut_val * | val, |
| char * | buf ) |
Same as yyjson_write_number().
Definition at line 1898 of file yyjson.h.
References yyjson_api_inline, and yyjson_write_number().
| yyjson_api char * yyjson_mut_write_opts | ( | const yyjson_mut_doc * | doc, |
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| size_t * | len, | ||
| yyjson_write_err * | err ) |
Write a document to JSON string with options.
This function is thread-safe when:
| doc | The mutable JSON document. If doc is NULL or has no root, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 10347 of file yyjson.c.
References likely, mut_write_root(), yyjson_mut_doc::root, and yyjson_mut_doc_estimated_val_num().
Referenced by yyjson_mut_write().
| yyjson_api_inline yyjson_val * yyjson_obj_get | ( | const yyjson_val * | obj, |
| const char * | key ) |
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
The key should be a null-terminated UTF-8 string.
Definition at line 5693 of file yyjson.h.
Referenced by native_json_find_object_by_string_field(), native_json_obj_get(), and yyjson_patch().
| yyjson_api_inline yyjson_val * yyjson_obj_getn | ( | const yyjson_val * | obj, |
| const char * | key, | ||
| size_t | key_len ) |
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
The key should be a UTF-8 string, null-terminator is not required. The key_len should be the length of the key, in bytes.
Definition at line 5698 of file yyjson.h.
Referenced by yyjson_merge_patch().
| yyjson_api_inline yyjson_val * yyjson_obj_iter_get | ( | yyjson_obj_iter * | iter, |
| const char * | key ) |
Iterates to a specified key and returns the value.
This function does the same thing as yyjson_obj_get(), but is much faster if the ordering of the keys is known at compile-time and you are using the same order to look up the values. If the key exists in this object, then the iterator will stop at the next key, otherwise the iterator will not change and NULL is returned.
| iter | The object iterator, should not be NULL. |
| key | The key, should be a UTF-8 string with null-terminator. |
| yyjson_api_inline yyjson_val * yyjson_obj_iter_get_val | ( | yyjson_val * | key | ) |
Returns the value for key inside the iteration. If iter is NULL, returns NULL.
Definition at line 5751 of file yyjson.h.
Referenced by handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_object_merge_command(), and merge_patch_into_mut_object_runtime().
| yyjson_api_inline yyjson_val * yyjson_obj_iter_getn | ( | yyjson_obj_iter * | iter, |
| const char * | key, | ||
| size_t | key_len ) |
Iterates to a specified key and returns the value.
This function does the same thing as yyjson_obj_getn(), but is much faster if the ordering of the keys is known at compile-time and you are using the same order to look up the values. If the key exists in this object, then the iterator will stop at the next key, otherwise the iterator will not change and NULL is returned.
| iter | The object iterator, should not be NULL. |
| key | The key, should be a UTF-8 string, null-terminator is not required. |
| key_len | The length of key, in bytes. |
Definition at line 5760 of file yyjson.h.
Referenced by unsafe_yyjson_equals().
| yyjson_api_inline bool yyjson_obj_iter_has_next | ( | yyjson_obj_iter * | iter | ) |
| yyjson_api_inline bool yyjson_obj_iter_init | ( | const yyjson_val * | obj, |
| yyjson_obj_iter * | iter ) |
Initialize an iterator for this object.
| obj | The object to be iterated over. If obj is NULL or not an object, iter is cleared. |
| iter | The iterator to be initialized. If iter is NULL, returns false. |
Definition at line 5718 of file yyjson.h.
Referenced by handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_object_merge_command(), merge_patch_into_mut_object_runtime(), and unsafe_yyjson_equals().
| yyjson_api_inline yyjson_val * yyjson_obj_iter_next | ( | yyjson_obj_iter * | iter | ) |
Returns the next key in the iteration, or NULL on end. If iter is NULL, returns NULL.
Definition at line 5741 of file yyjson.h.
Referenced by handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_object_merge_command(), and merge_patch_into_mut_object_runtime().
| yyjson_api_inline yyjson_obj_iter yyjson_obj_iter_with | ( | const yyjson_val * | obj | ) |
Create an iterator with an object, same as yyjson_obj_iter_init().
| obj | The object to be iterated over. If obj is NULL or not an object, returns an empty iterator. |
| yyjson_api_inline size_t yyjson_obj_size | ( | const yyjson_val * | obj | ) |
| yyjson_api yyjson_mut_val * yyjson_patch | ( | yyjson_mut_doc * | doc, |
| const yyjson_val * | orig, | ||
| const yyjson_val * | patch, | ||
| yyjson_patch_err * | err ) |
Creates and returns a patched JSON value (RFC 6902). The memory of the returned value is allocated by the doc. The err is used to receive error information, pass NULL if not needed. Returns NULL if the patch could not be applied.
Definition at line 11026 of file yyjson.c.
References PATCH_OP_ADD, PATCH_OP_COPY, patch_op_get(), PATCH_OP_MOVE, PATCH_OP_REMOVE, PATCH_OP_REPLACE, PATCH_OP_TEST, ptr_add, ptr_get, ptr_remove, ptr_replace, return_err, return_err_copy, return_err_key, return_err_val, unlikely, unsafe_yyjson_get_len(), unsafe_yyjson_is_obj(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_is_arr(), yyjson_is_str(), yyjson_mut_equals(), yyjson_mut_val_mut_copy(), yyjson_obj_get(), and yyjson_val_mut_copy().
| yyjson_api_inline bool yyjson_ptr_ctx_append | ( | yyjson_ptr_ctx * | ctx, |
| yyjson_mut_val * | key, | ||
| yyjson_mut_val * | val ) |
| yyjson_api_inline bool yyjson_ptr_ctx_remove | ( | yyjson_ptr_ctx * | ctx | ) |
Remove value by JSON pointer context.
| ctx | The context from the yyjson_mut_ptr_xxx() calls. |
Definition at line 8212 of file yyjson.h.
Referenced by unsafe_yyjson_mut_ptr_removex().
| yyjson_api_inline bool yyjson_ptr_ctx_replace | ( | yyjson_ptr_ctx * | ctx, |
| yyjson_mut_val * | val ) |
Replace value by JSON pointer context.
| ctx | The context from the yyjson_mut_ptr_xxx() calls. |
| val | New value to be replaced. |
Definition at line 8180 of file yyjson.h.
Referenced by unsafe_yyjson_mut_ptr_replacex().
| yyjson_api_inline yyjson_val * yyjson_ptr_get | ( | const yyjson_val * | val, |
| const char * | ptr ) |
| yyjson_api_inline bool yyjson_ptr_get_bool | ( | const yyjson_val * | root, |
| const char * | ptr, | ||
| bool * | value ) |
| yyjson_api_inline bool yyjson_ptr_get_num | ( | const yyjson_val * | root, |
| const char * | ptr, | ||
| double * | value ) |
| yyjson_api_inline bool yyjson_ptr_get_real | ( | const yyjson_val * | root, |
| const char * | ptr, | ||
| double * | value ) |
| yyjson_api_inline bool yyjson_ptr_get_sint | ( | const yyjson_val * | root, |
| const char * | ptr, | ||
| int64_t * | value ) |
| yyjson_api_inline bool yyjson_ptr_get_str | ( | const yyjson_val * | root, |
| const char * | ptr, | ||
| const char ** | value ) |
| yyjson_api_inline bool yyjson_ptr_get_uint | ( | const yyjson_val * | root, |
| const char * | ptr, | ||
| uint64_t * | value ) |
| yyjson_api_inline yyjson_val * yyjson_ptr_getn | ( | const yyjson_val * | val, |
| const char * | ptr, | ||
| size_t | len ) |
| yyjson_api_inline yyjson_val * yyjson_ptr_getx | ( | const yyjson_val * | val, |
| const char * | ptr, | ||
| size_t | len, | ||
| yyjson_ptr_err * | err ) |
Get value by a JSON Pointer.
| val | The JSON value to be queried. |
| ptr | The JSON pointer string (UTF-8, null-terminator is not required). |
| len | The length of ptr in bytes. |
| err | A pointer to store the error information, or NULL if not needed. |
| yyjson_api_inline yyjson_doc * yyjson_read | ( | const char * | dat, |
| size_t | len, | ||
| yyjson_read_flag | flg ) |
Read a JSON string.
This function is thread-safe.
| dat | The JSON data (UTF-8 without BOM), null-terminator is not required. If dat is NULL, returns NULL. |
| len | The length of JSON data in bytes. If len is 0, returns NULL. |
| flg | The JSON read options. Multiple options can be combined with | operator. 0 means no options. |
Definition at line 1066 of file yyjson.h.
References len, yyjson_api_inline, YYJSON_READ_INSITU, and yyjson_read_opts().
Referenced by native_json_doc_load_text().
| yyjson_api yyjson_doc * yyjson_read_file | ( | const char * | path, |
| yyjson_read_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_read_err * | err ) |
Read a JSON file.
This function is thread-safe when:
| path | The JSON file's path. This should be a null-terminated string using the system's native encoding. If path is NULL or invalid, returns NULL. |
| flg | The JSON read options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON reader. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 6341 of file yyjson.c.
References fopen_readonly(), MSG_FREAD, return_err, unlikely, and yyjson_read_fp().
| yyjson_api yyjson_doc * yyjson_read_fp | ( | FILE * | fp, |
| yyjson_read_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_read_err * | err ) |
Read JSON from a file pointer.
| fp | The file pointer. The data will be read from the current position of the FILE to the end. If fp is NULL or invalid, returns NULL. |
| flg | The JSON read options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON reader. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 6369 of file yyjson.c.
References yyjson_alc::ctx, fread_safe(), yyjson_alc::free, yyjson_alc::malloc, MSG_FREAD, MSG_MALLOC, yyjson_alc::realloc, return_err, yyjson_doc::str_pool, unlikely, YYJSON_DEFAULT_ALC, YYJSON_PADDING_SIZE, YYJSON_READ_INSITU, and yyjson_read_opts().
Referenced by yyjson_read_file().
| yyjson_api_inline size_t yyjson_read_max_memory_usage | ( | size_t | len, |
| yyjson_read_flag | flg ) |
Returns the maximum memory usage to read a JSON document.
You may use this value to avoid malloc() or calloc() call inside the reader to get better performance, or read multiple JSON with one piece of memory.
| len | The length of JSON data in bytes. |
| flg | The JSON read options. |
Example
Definition at line 1173 of file yyjson.h.
References yyjson_incr_state::flg, len, yyjson_api_inline, YYJSON_READ_INSITU, and YYJSON_READ_STOP_WHEN_DONE.
| yyjson_api const char * yyjson_read_number | ( | const char * | dat, |
| yyjson_val * | val, | ||
| yyjson_read_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_read_err * | err ) |
Read a JSON number.
This function is thread-safe when data is not modified by other threads.
| dat | The JSON data (UTF-8 without BOM), null-terminator is required. If dat is NULL, returns NULL. |
| val | The output value where result is stored. If val is NULL, returns NULL. The value will hold either UINT or SINT or REAL number; |
| flg | The JSON read options. Multiple options can be combined with | operator. 0 means no options. Supports YYJSON_READ_NUMBER_AS_RAW and YYJSON_READ_ALLOW_INF_AND_NAN. |
| alc | The memory allocator used for long number. It is only used when the built-in floating point reader is disabled. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 6469 of file yyjson.c.
References constcast, yyjson_alc::ctx, yyjson_alc::free, yyjson_alc::malloc, MSG_MALLOC, read_num(), return_err, yyjson_val_uni::str, yyjson_val::uni, unlikely, YYJSON_DEFAULT_ALC, and yyjson_is_raw().
Referenced by yyjson_mut_read_number().
| yyjson_api yyjson_doc * yyjson_read_opts | ( | char * | dat, |
| size_t | len, | ||
| yyjson_read_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_read_err * | err ) |
Read JSON with options.
This function is thread-safe when:
| dat | The JSON data (UTF-8 without BOM), null-terminator is not required. If dat is NULL, returns NULL. The dat will not be modified without the flag YYJSON_READ_INSITU, so you can pass a const char * string and cast it to char * if you don't use the YYJSON_READ_INSITU flag. |
| len | The length of JSON data in bytes. If len is 0, returns NULL. |
| flg | The JSON read options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON reader. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 6251 of file yyjson.c.
References char_is_ctn(), char_is_space(), char_is_trivia(), yyjson_read_err::code, yyjson_alc::ctx, yyjson_alc::free, has_allow, has_flg, is_utf16_bom(), is_utf32_bom(), is_utf8_bom(), len, likely, yyjson_alc::malloc, yyjson_read_err::msg, MSG_COMMENT, MSG_ERR_BOM, MSG_ERR_UTF16, MSG_ERR_UTF32, MSG_MALLOC, yyjson_read_err::pos, read_root_minify(), read_root_pretty(), read_root_single(), return_err, skip_trivia(), unlikely, USIZE_MAX, YYJSON_DEFAULT_ALC, YYJSON_PADDING_SIZE, and YYJSON_READ_ERROR_MEMORY_ALLOCATION.
Referenced by yyjson_read(), and yyjson_read_fp().
| yyjson_api_inline bool yyjson_set_bool | ( | yyjson_val * | val, |
| bool | num ) |
| yyjson_api_inline bool yyjson_set_double | ( | yyjson_val * | val, |
| double | num ) |
| yyjson_api_inline bool yyjson_set_float | ( | yyjson_val * | val, |
| float | num ) |
| yyjson_api_inline bool yyjson_set_fp_to_fixed | ( | yyjson_val * | val, |
| int | prec ) |
Set the floating-point number's output format to fixed-point notation. Returns false if val is NULL or is not real type.
| yyjson_api_inline bool yyjson_set_fp_to_float | ( | yyjson_val * | val, |
| bool | flt ) |
Set the floating-point number's output format to single-precision. Returns false if val is NULL or is not real type.
| yyjson_api_inline bool yyjson_set_int | ( | yyjson_val * | val, |
| int64_t | num ) |
| yyjson_api_inline bool yyjson_set_null | ( | yyjson_val * | val | ) |
| yyjson_api_inline bool yyjson_set_raw | ( | yyjson_val * | val, |
| const char * | raw, | ||
| size_t | len ) |
| yyjson_api_inline bool yyjson_set_real | ( | yyjson_val * | val, |
| double | num ) |
| yyjson_api_inline bool yyjson_set_sint | ( | yyjson_val * | val, |
| int64_t | num ) |
| yyjson_api_inline bool yyjson_set_str | ( | yyjson_val * | val, |
| const char * | str ) |
| yyjson_api_inline bool yyjson_set_str_noesc | ( | yyjson_val * | val, |
| bool | noesc ) |
Marks this string as not needing to be escaped during JSON writing. This can be used to avoid the overhead of escaping if the string contains only characters that do not require escaping. Returns false if val is NULL or is not string.
| yyjson_api_inline bool yyjson_set_strn | ( | yyjson_val * | val, |
| const char * | str, | ||
| size_t | len ) |
| yyjson_api_inline bool yyjson_set_uint | ( | yyjson_val * | val, |
| uint64_t | num ) |
| yyjson_api yyjson_mut_val * yyjson_val_mut_copy | ( | yyjson_mut_doc * | doc, |
| const yyjson_val * | val ) |
Copies and returns a new mutable value from input, returns NULL on error. This makes a deep-copy on the immutable value. The memory is managed by the mutable document.
Definition at line 2714 of file yyjson.c.
References constcast, len, yyjson_mut_val::next, yyjson_val_uni::ptr, yyjson_val_uni::str, yyjson_mut_val::tag, yyjson_val::tag, yyjson_val_uni::u64, yyjson_mut_val::uni, yyjson_val::uni, unsafe_yyjson_get_len(), unsafe_yyjson_get_next(), unsafe_yyjson_get_type(), unsafe_yyjson_mut_strncpy(), unsafe_yyjson_mut_val(), YYJSON_TYPE_ARR, YYJSON_TYPE_OBJ, YYJSON_TYPE_RAW, and YYJSON_TYPE_STR.
Referenced by generated_surface_append_audit_event_mut_runtime(), handle_action_route(), handle_file_generated_surface_match_command(), handle_generated_surface_coerce_candidate_command(), handle_generated_surface_context_command(), handle_generated_surface_default_candidate_command(), handle_generated_surface_list_result_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_mutate_command(), handle_generated_surface_submitted_command(), handle_object_build_command(), handle_object_merge_command(), handle_state_event_stream_row_json_lines_command(), handle_state_named_command(), merge_patch_into_mut_object_runtime(), normalized_payload_object_mut_runtime(), surface_build_active_filters_runtime(), surface_build_sort_config_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), yyjson_doc_mut_copy(), yyjson_merge_patch(), and yyjson_patch().
| yyjson_api_inline char * yyjson_val_write | ( | const yyjson_val * | val, |
| yyjson_write_flag | flg, | ||
| size_t * | len ) |
Write a value to JSON string.
This function is thread-safe.
| val | The JSON root value. If val is NULL, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
Definition at line 1738 of file yyjson.h.
References len, yyjson_api_inline, and yyjson_val_write_opts().
Referenced by native_json_serialize_compact_dup().
| yyjson_api size_t yyjson_val_write_buf | ( | char * | buf, |
| size_t | buf_len, | ||
| const yyjson_val * | val, | ||
| yyjson_write_flag | flg, | ||
| yyjson_write_err * | err ) |
Write a value into a buffer.
This function does not allocate memory, but the buffer must be larger than the final JSON size to allow temporary space. See API.md for details.
| buf | The output buffer. If buf is NULL, returns 0. |
| buf_len | The buffer length. If buf_len is too small, returns 0. |
| val | The JSON root value. If val is NULL, returns 0. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9807 of file yyjson.c.
References yyjson_write_err::code, yyjson_write_err::msg, unlikely, write_root(), YYJSON_NULL_ALC, and YYJSON_WRITE_ERROR_INVALID_PARAMETER.
Referenced by yyjson_write_buf().
| yyjson_api bool yyjson_val_write_file | ( | const char * | path, |
| const yyjson_val * | val, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a value to JSON file with options.
This function is thread-safe when:
| path | The JSON file's path. This should be a null-terminated string using the system's native encoding. If path is NULL or invalid, returns false. If the file is not empty, its content is discarded. |
| val | The JSON root value. If val is NULL, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9735 of file yyjson.c.
References yyjson_write_err::code, constcast, yyjson_alc::ctx, yyjson_alc::free, yyjson_write_err::msg, unlikely, write_dat_to_file(), write_root(), YYJSON_DEFAULT_ALC, and YYJSON_READ_ERROR_INVALID_PARAMETER.
Referenced by yyjson_write_file().
| yyjson_api bool yyjson_val_write_fp | ( | FILE * | fp, |
| const yyjson_val * | val, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a value to file pointer with options.
| fp | The file pointer. The data will be written to the current position of the file. If fp is NULL or invalid, returns false. |
| val | The JSON root value. If val is NULL, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9761 of file yyjson.c.
References yyjson_write_err::code, constcast, yyjson_alc::ctx, yyjson_alc::free, yyjson_write_err::msg, unlikely, write_dat_to_fp(), write_root(), YYJSON_DEFAULT_ALC, and YYJSON_READ_ERROR_INVALID_PARAMETER.
Referenced by yyjson_write_fp().
| yyjson_api char * yyjson_val_write_opts | ( | const yyjson_val * | val, |
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| size_t * | len, | ||
| yyjson_write_err * | err ) |
Write a value to JSON string with options.
This function is thread-safe when: The alc is thread-safe or NULL.
| val | The JSON root value. If val is NULL, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9716 of file yyjson.c.
References write_root().
Referenced by yyjson_val_write().
| yyjson_api uint32_t yyjson_version | ( | void | ) |
The version of yyjson in hex, same as YYJSON_VERSION_HEX.
Definition at line 58 of file yyjson.c.
References YYJSON_VERSION_HEX.
| yyjson_api_inline char * yyjson_write | ( | const yyjson_doc * | doc, |
| yyjson_write_flag | flg, | ||
| size_t * | len ) |
Write a document to JSON string.
This function is thread-safe.
| doc | The JSON document. If doc is NULL or has no root, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
Definition at line 1471 of file yyjson.h.
References len, yyjson_api_inline, and yyjson_write_opts().
Referenced by native_dynamic_runtime_handle_request(), and write_proof_state_api_response().
| yyjson_api size_t yyjson_write_buf | ( | char * | buf, |
| size_t | buf_len, | ||
| const yyjson_doc * | doc, | ||
| yyjson_write_flag | flg, | ||
| yyjson_write_err * | err ) |
Write a document into a buffer.
This function does not allocate memory, but the buffer must be larger than the final JSON size to allow temporary space. See API.md for details.
| buf | The output buffer. If buf is NULL, returns 0. |
| buf_len | The buffer length. If buf_len is too small, returns 0. |
| doc | The JSON document. If doc is NULL or has no root, returns 0. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9821 of file yyjson.c.
References yyjson_doc::root, and yyjson_val_write_buf().
| yyjson_api bool yyjson_write_file | ( | const char * | path, |
| const yyjson_doc * | doc, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a document to JSON file with options.
This function is thread-safe when:
| path | The JSON file's path. This should be a null-terminated string using the system's native encoding. If path is NULL or invalid, returns false. If the file is not empty, its content is discarded. |
| doc | The JSON document. If doc is NULL or has no root, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9787 of file yyjson.c.
References yyjson_doc::root, and yyjson_val_write_file().
| yyjson_api bool yyjson_write_fp | ( | FILE * | fp, |
| const yyjson_doc * | doc, | ||
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| yyjson_write_err * | err ) |
Write a document to file pointer with options.
| fp | The file pointer. The data will be written to the current position of the file. If fp is NULL or invalid, returns false. |
| doc | The JSON document. If doc is NULL or has no root, returns false. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9796 of file yyjson.c.
References yyjson_doc::root, and yyjson_val_write_fp().
| yyjson_api char * yyjson_write_number | ( | const yyjson_val * | val, |
| char * | buf ) |
Write a JSON number.
| val | A JSON number value to be converted to a string. If val is invalid, returns NULL. |
| buf | A buffer to store the resulting null-terminated string. If buf is NULL, returns NULL. For integer values, the buffer must be at least 21 bytes. For floating-point values, the buffer must be at least 40 bytes. |
Definition at line 8427 of file yyjson.c.
References likely, yyjson_val::tag, yyjson_val_uni::u64, yyjson_val::uni, unlikely, write_f32_raw(), write_f64_raw(), write_f64_raw_fixed(), write_u64(), YYJSON_SUBTYPE_REAL, YYJSON_SUBTYPE_SINT, YYJSON_SUBTYPE_UINT, YYJSON_TAG_MASK, YYJSON_TYPE_NUM, YYJSON_WRITE_ALLOW_INF_AND_NAN, YYJSON_WRITE_FP_FLAG_BITS, YYJSON_WRITE_FP_PREC_BITS, and YYJSON_WRITE_FP_TO_FLOAT.
Referenced by yyjson_mut_write_number().
| yyjson_api char * yyjson_write_opts | ( | const yyjson_doc * | doc, |
| yyjson_write_flag | flg, | ||
| const yyjson_alc * | alc, | ||
| size_t * | len, | ||
| yyjson_write_err * | err ) |
Write a document to JSON string with options.
This function is thread-safe when: The alc is thread-safe or NULL.
| doc | The JSON document. If doc is NULL or has no root, returns NULL. |
| flg | The JSON write options. Multiple options can be combined with | operator. 0 means no options. |
| alc | The memory allocator used by JSON writer. Pass NULL to use the libc's default allocator. |
| len | A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don't need length information. |
| err | A pointer to receive error information. Pass NULL if you don't need error information. |
Definition at line 9724 of file yyjson.c.
References yyjson_doc::root, and write_root().
Referenced by yyjson_write().
| const char size_t len |
Definition at line 8364 of file yyjson.h.
Referenced by app_artifact_dir_from_build_dir_native(), buffer_append(), bytes_to_hex_runtime(), digits_only_runtime(), dup_range(), generated_surface_label_from_field_runtime(), handle_bundle_manifest_slice_order_command(), handle_object_relative_path_array_to_absolute_json_command(), handle_request_lines_to_booking_options_json_command(), is_truncated_end(), is_truncated_str(), is_truncated_utf8(), json_extract_array_in_section(), multipart_dup_range(), native_connection_printf(), native_connection_read(), native_connection_write(), native_dynamic_url_decode(), native_json_doc_load_text(), native_json_string_array_lines_dup(), native_json_string_dup(), native_request_path_without_query(), normalize_base_path_native(), ptr_arr_get(), ptr_mut_arr_get(), ptr_mut_obj_get(), ptr_new_key(), ptr_next_token(), ptr_obj_get(), ptr_token_eq(), ptr_token_to_idx(), runtime_apps_fingerprint_native(), send_all(), serve_dynamic_home_page(), sha256_update_runtime(), shell_quote_runtime_stack_native(), skip_trivia(), stbi_info_from_memory(), stbi_is_16_bit_from_memory(), stbi_is_hdr_from_memory(), stbi_load_16_from_memory(), stbi_load_from_memory(), stbi_load_gif_from_memory(), stbi_loadf_from_memory(), stbi_zlib_decode_malloc(), stbi_zlib_decode_malloc_guesssize(), stbi_zlib_decode_malloc_guesssize_headerflag(), stbi_zlib_decode_noheader_malloc(), trim_ascii_whitespace_range_runtime(), unsafe_yyjson_equals(), unsafe_yyjson_is_str_noesc(), unsafe_yyjson_mut_equals(), unsafe_yyjson_mut_ptr_getx(), unsafe_yyjson_mut_ptr_removex(), unsafe_yyjson_mut_ptr_replacex(), unsafe_yyjson_ptr_getx(), unsafe_yyjson_str_equals(), unsafe_yyjson_str_pool_grow(), url_decode_dup_runtime(), write_dat_to_file(), write_dat_to_fp(), write_f32_raw(), write_f64_raw(), write_f64_raw_fixed(), write_fp_reformat(), yyjson_imut_copy(), yyjson_incr_read(), yyjson_locate_pos(), yyjson_mut_doc_set_str_pool_size(), yyjson_mut_stat(), yyjson_mut_val_write(), yyjson_mut_write(), yyjson_read(), yyjson_read_max_memory_usage(), yyjson_read_opts(), yyjson_val_mut_copy(), yyjson_val_write(), and yyjson_write().
| const char * ptr |
Definition at line 8356 of file yyjson.h.
Referenced by default_free(), default_realloc(), dyn_free(), dyn_realloc(), null_free(), null_realloc(), pool_free(), pool_realloc(), ptr_next_token(), read_false(), read_inf(), read_inf_or_nan(), read_nan(), read_null(), read_num(), read_num_hex(), read_num_raw(), read_str(), read_str_con(), read_str_id(), read_str_opt(), read_str_sq(), read_true(), skip_trivia(), unsafe_yyjson_mut_ptr_getx(), unsafe_yyjson_mut_ptr_putx(), unsafe_yyjson_mut_ptr_removex(), unsafe_yyjson_mut_ptr_replacex(), and unsafe_yyjson_ptr_getx().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Allow UTF-8 BOM and skip it before parsing if any (non-standard).
Definition at line 856 of file yyjson.h.
Referenced by yyjson_incr_new().
|
static |
|
static |
Allow extended escape sequences in strings (non-standard):
|
static |
|
static |
|
static |
|
static |
Allow reading invalid unicode when parsing string values (non-standard). Invalid characters will be allowed to appear in the string values, but invalid escape sequences will still be reported as errors. This flag does not affect the performance of correctly encoded strings.
Definition at line 847 of file yyjson.h.
Referenced by yyjson_incr_new().
|
static |
|
static |
|
static |
|
static |
Read big numbers as raw strings. These big numbers include integers that cannot be represented by int64_t and uint64_t, and floating-point numbers that cannot be represented by finite double. The flag will be overridden by YYJSON_READ_NUMBER_AS_RAW flag.
|
static |
|
static |
|
static |
|
static |
|
static |
Invalid comment, deprecated, use UNEXPECTED_END for unclosed comment.
Definition at line 934 of file yyjson.h.
Referenced by is_truncated_end().
|
static |
Invalid number, such as 123.e12, 000.
Definition at line 937 of file yyjson.h.
Referenced by is_truncated_end().
|
static |
Invalid parameter, such as NULL input string or 0 input length.
Definition at line 913 of file yyjson.h.
Referenced by write_root(), yyjson_val_write_file(), and yyjson_val_write_fp().
|
static |
Invalid string, such as invalid escaped character inside a string.
Definition at line 940 of file yyjson.h.
Referenced by is_truncated_end().
|
static |
|
static |
Invalid JSON literal, such as truu.
Definition at line 943 of file yyjson.h.
Referenced by is_truncated_end().
|
static |
Memory allocation failed.
Definition at line 916 of file yyjson.h.
Referenced by yyjson_read_opts().
|
static |
Incomplete input during incremental parsing; parsing state is preserved.
Definition at line 952 of file yyjson.h.
Referenced by yyjson_incr_read().
|
static |
Unexpected character inside the document, such as [abc].
Definition at line 928 of file yyjson.h.
Referenced by is_truncated_end().
|
static |
Unexpected content after document, such as [123]abc.
Definition at line 922 of file yyjson.h.
Referenced by is_truncated_end().
|
static |
Unexpected end of input, the parsed part is valid, such as [123.
Definition at line 925 of file yyjson.h.
Referenced by yyjson_incr_read().
|
static |
Read the input data in-situ. This option allows the reader to modify and use input data to store string values, which can increase reading speed slightly. The caller should hold the input data before freeing the document. The input data must be padded by at least YYJSON_PADDING_SIZE bytes. For example: [1,2] should be [1,2]\0\0\0\0, input length should be 5.
Definition at line 817 of file yyjson.h.
Referenced by yyjson_incr_free(), yyjson_read(), yyjson_read_fp(), and yyjson_read_max_memory_usage().
|
static |
Allow JSON5 format, see: [https://json5.org]. This flag supports all JSON5 features with some additional extensions:
Definition at line 894 of file yyjson.h.
Referenced by yyjson_incr_new().
|
static |
Default option (RFC 8259 compliant):
Definition at line 809 of file yyjson.h.
Referenced by native_json_doc_load_text().
|
static |
Read all numbers as raw strings (value with YYJSON_TYPE_RAW type), inf/nan literal is also read as raw with ALLOW_INF_AND_NAN flag.
|
static |
Stop when done instead of issuing an error if there's additional content after a JSON document. This option may be used to parse small pieces of JSON in larger data, such as NDJSON.
Definition at line 822 of file yyjson.h.
Referenced by yyjson_read_max_memory_usage().
|
static |
|
static |
Write inf and nan number as 'Infinity' and 'NaN' literal (non-standard).
Definition at line 1257 of file yyjson.h.
Referenced by yyjson_write_number().
|
static |
Allow invalid unicode when encoding string values (non-standard). Invalid characters in string value will be copied byte by byte. If YYJSON_WRITE_ESCAPE_UNICODE flag is also set, invalid character will be escaped as U+FFFD (replacement character). This flag does not affect the performance of correctly encoded strings.
|
static |
|
static |
|
static |
Invalid parameter, such as NULL document.
Definition at line 1313 of file yyjson.h.
Referenced by mut_write_root(), yyjson_mut_val_write_buf(), yyjson_mut_val_write_file(), yyjson_mut_val_write_fp(), and yyjson_val_write_buf().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Escape unicode as uXXXX, make the output ASCII only.
Definition at line 1251 of file yyjson.h.
Referenced by build_artifact_local_app_manifest_json().
|
static |
Write inf and nan number as null literal. This flag will override YYJSON_WRITE_ALLOW_INF_AND_NAN flag.
|
static |
Use lowercase hex digits in \uXXXX escape sequences instead of the default uppercase. Only effective when YYJSON_WRITE_ESCAPE_UNICODE is also set.
|
static |
|
static |
Default option:
Definition at line 1245 of file yyjson.h.
Referenced by append_rate_limit_event_runtime_local(), appointments_render_page_params_json_dup_runtime(), business_availability_edit_page_params_json_dup_runtime(), business_calendar_render_page_params_json_dup_runtime(), business_dashboard_render_page_params_json_dup_runtime(), business_detail_admin_render_page_params_json_dup_runtime(), business_edit_page_params_json_dup_runtime(), business_landing_render_page_params_json_dup_runtime(), diagnostics_render_page_params_json_dup_runtime(), emit_compact_json_mut_value_runtime(), emit_compact_mutable_json_doc_runtime(), emit_json_string_runtime(), explore_render_page_params_json_dup_runtime(), generated_admin_manage_page_params_json_dup_runtime(), handle_accept_invite_action_runtime(), handle_action_route(), handle_generated_surface_default_candidate_command(), handle_generated_surface_manage_page_json_command(), handle_generated_surface_manage_table_json_command(), handle_issue_business_invite_action_runtime(), handle_password_reset_complete_action_runtime(), handle_password_reset_request_action_runtime(), handle_state_named_command(), handle_template_layout_page_html_command(), issue_browser_session_runtime(), login_page_params_json_dup_runtime(), native_dynamic_runtime_handle_request(), native_json_serialize_compact_dup(), profile_page_params_json_dup_runtime_local(), profile_render_page_params_json_dup_runtime(), proof_home_page_params_json_dup_runtime(), register_page_params_json_dup_runtime(), render_business_fragment_from_doc_dup_runtime(), render_page_html_dup_runtime(), revoke_session_by_cookie_runtime(), runtime_page_params_write_runtime(), service_book_form_page_params_json_dup_runtime(), service_edit_page_params_json_dup_runtime(), write_business_availability_api_response(), write_business_services_api_response(), write_generated_surface_schema_response(), write_mutable_json_doc_runtime(), and write_proof_state_api_response().
|
static |
Write JSON pretty with 4 space indent.
Definition at line 1248 of file yyjson.h.
Referenced by build_artifact_local_app_manifest_json(), mut_write_root(), and write_root().
|
static |
Write JSON pretty with 2 space indent. This flag will override YYJSON_WRITE_PRETTY flag.
Definition at line 1272 of file yyjson.h.
Referenced by mut_write_root(), and write_root().
|
static |
Success, no error.
Definition at line 1310 of file yyjson.h.
Referenced by mut_write_root_minify(), and mut_write_root_pretty().