package core.encoding.json
Value_Type :: enum {
Null :: 0
Bool :: 1
Integer :: 2
Float :: 3
String :: 4
Array :: 5
Object :: 6
}Decode_Error :: #distinct &_Decode_ErrorMethods
Value :: #distinct &_ValueMethods
as_any :: macro (value: Value, $T: type_expr) -> Tas_any :: macro (value: Value, out: &$T) -> voidas_any :: (value: Value, type: type_expr, out: rawptr) -> voiddecode :: (data: [] u8, allocator: Allocator, print_errors: bool) -> JsonUnsafely decodes a strings into a json object, returning an invalid Json value if it failed to parse.
This procedure is not very useful and should be considered deprecated.
decode_into :: (data: str, out: &$T) -> ErrorDecodes a string into any Onyx type.
Internally uses decode_with_result and as_any.
decode_with_error :: (data: [] u8, allocator: Allocator) -> (Json, Decode_Error) Decodes a string into a Json object, and returns the Json object and and a Decode_Error that is non-null if an error occured.
This procedure should be considered deprecated in favor of decode_with_result.
decode_with_result :: (data: [] u8, allocator: Allocator) -> Result(Json, Error)Decodes a string into a possible Json object. If parsing fails, an error is returned instead.
encode :: (w: &Writer, v: i32) -> Encoding_Errorencode :: (w: &Writer, v: i64) -> Encoding_Errorencode :: (w: &Writer, v: f32) -> Encoding_Errorencode :: (w: &Writer, v: f64) -> Encoding_Errorencode :: (w: &Writer, v: [] u8) -> Encoding_Errorencode :: (w: &io.Writer, v: [] $T) -> Encoding_Errorencode :: (w: &io.Writer, v: [..] $T) -> Encoding_Errorencode :: (w: &io.Writer, v: Map(str, $T)) -> Encoding_Errorencode :: (w: &Writer, v: Value) -> Encoding_Errorencode :: (w: &Writer, data: any) -> Encoding_Errorfree_value :: (v: Value, allocator: Allocator) -> voidFrees a single Value, non-recursively.
from_any :: macro (v: &$T, allocator) -> Valuefrom_any :: macro (v: $T, allocator) -> Valuefrom_any :: (type: type_expr, input: rawptr, allocator: Allocator) -> Valueset :: macro (v: Value, key: [] u8, value: Value, dont_copy_key: bool) -> voidset :: macro (v: Value, key: [] u8, value: [] u8, dont_copy_key: bool, dont_copy_value: bool) -> i32