10 #define __AFW_JSON_H__
32 #define AFW_JSON_Q_CONTENT_TYPE "application/json"
33 #define AFW_JSON_S_CONTENT_TYPE afw_s_a_application_json
34 #define AFW_JSON_Q_CONTENT_TYPE_SHORT "json"
35 #define AFW_JSON_S_CONTENT_TYPE_SHORT afw_s_json
38 #define AFW_JSON_PN_JSON_PRIMITIVE AFW_Q_jsonPrimitive
39 #define AFW_JSON_PN_s_JSON_PRIMITIVE afw_s_jsonPrimitive
40 #define AFW_JSON_Q_PRIMITIVE_OBJECT AFW_Q_object
41 #define AFW_JSON_S_PRIMITIVE_OBJECT afw_s_object
42 #define AFW_JSON_Q_PRIMITIVE_ARRAY AFW_Q_array
43 #define AFW_JSON_S_PRIMITIVE_ARRAY afw_s_array
44 #define AFW_JSON_Q_PRIMITIVE_NUMBER AFW_Q_number
45 #define AFW_JSON_S_PRIMITIVE_NUMBER afw_s_number
46 #define AFW_JSON_Q_PRIMITIVE_STRING AFW_Q_string
47 #define AFW_JSON_S_PRIMITIVE_STRING afw_s_string
48 #define AFW_JSON_Q_PRIMITIVE_BOOLEAN AFW_Q_boolean
49 #define AFW_JSON_S_PRIMITIVE_BOOLEAN afw_s_boolean
50 #define AFW_JSON_Q_PRIMITIVE_NULL AFW_Q_null
51 #define AFW_JSON_S_PRIMITIVE_NULL afw_s_null
52 #define AFW_JSON_Q_PRIMITIVE_BOOLEAN_TRUE AFW_Q_true
53 #define AFW_JSON_S_PRIMITIVE_BOOLEAN_TRUE afw_s_true
54 #define AFW_JSON_Q_PRIMITIVE_BOOLEAN_FALSE AFW_Q_false
55 #define AFW_JSON_S_PRIMITIVE_BOOLEAN_FALSE afw_s_false
57 #define AFW_JSON_Q_INFINITY "Infinity"
58 #define AFW_JSON_Q_MINUS_INFINITY "-Infinity"
59 #define AFW_JSON_Q_NAN "NaN"
60 #define AFW_JSON_Q_MINUS_NAN "-NaN"
77 #define AFW_JSON_Q_PN_META AFW_OBJECT_Q_PN_META
78 #define AFW_JSON_Q_PN_ID AFW_OBJECT_Q_PN_ID
79 #define AFW_JSON_Q_PN_PATH AFW_OBJECT_Q_PN_PATH
80 #define AFW_JSON_Q_PN_OBJECT_TYPE AFW_OBJECT_Q_PN_OBJECT_TYPE
81 #define AFW_JSON_Q_PN_PARENT_PATH AFW_OBJECT_Q_PN_PARENT_PATH
128 #define afw_json_to_value(json, source_location, p, xctx) \
129 afw_compile_to_value(json, source_location, \
130 afw_compile_type_relaxed_json, \
142 #define afw_json_to_object(string, cede_p, p, xctx) \
143 afw_compile_to_object(string, NULL, NULL, NULL, NULL, \
167 #define afw_json_to_object_with_meta(string, source_location, \
168 adaptor_id, object_type_id, object_id, \
170 afw_compile_to_object(string, source_location, \
171 adaptor_id, object_type_id, object_id, \
AFW_DEFINE(const afw_object_t *)
#define AFW_DECLARE(type)
Declare a public afw function.
Adaptive Framework Minimal Header.
afw_json_utf8_string_create(const afw_utf8_t *string, const afw_pool_t *p, afw_xctx_t *xctx)
Create a json encoded quoted string.
void afw_json_write_encoded_string(const afw_utf8_t *string, const afw_writer_t *writer, afw_xctx_t *xctx)
Write string as json encoded string.
void afw_json_register(afw_xctx_t *xctx)
Register JSON support.
const afw_utf8_t * afw_json_from_value(const afw_value_t *value, const afw_object_options_t *options, const afw_pool_t *p, afw_xctx_t *xctx)
Convert an adaptive value to JSON.
const afw_content_type_t * afw_json_content_type_get()
Get the content type instance for json.
Interface afw_content_type public struct.
Struct for object processing options.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_value public struct.
Interface afw_writer public struct.
Interface afw_xctx public struct.