Sitelet https://github.com/JujuAdams/SNAP/tree/48f4b41b738726b3a7499139ebb53f9c833557e8
Skip to content
JujuAdamsPublic

About

Data format converters for GameMaker LTS 2022

Topics

Resources

Stars

99 stars

Watchers

5 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SNAP: Struct N' Array Parser 2.0.0

Replacement for ds_map/ds_list-based JSON encoding/decoding

Download the .yymps here

 


 

snap_to_json_string(struct/array, [pretty], [alphabetizeStructs])

Turns struct and array nested data into a JSON string. The root data type can be either a struct or an array. Setting [pretty] to true will format the JSON string in a more pleasing human-readable way, whereas setting [alphabetizeStructs] to true will output the struct variables in ascending alphabetical order. Using pretty and/or alphabetized output does incur a performance penalty.

 

snap_from_json_string(string)

Decodes a JSON string into nested struct/array data. This function will happily ignore formatting whitespace and handles \\, \", \n, \r, and \t escaped characters. Also supports true, false, and null values.

 

snap_to_binary(struct/array)

Returns a buffer that holds binary encoded struct and array nested data. The root data type can be either a struct or an array. This is substantially faster than sna_to_json().

 

snap_from_binary(buffer, [offset], [size], [destroyBuffer])

Unpacks binary encoded struct/array data. An [offset] and total [size] for the data within the buffer can be specified which is helpful for working with composite buffers. Set [size] to -1 to use the entire size of the buffer. If [destroyBuffer] is set to true then the input buffer will be destroyed once the function has finished executing. This function is a lot faster than json_to_sna().

 

snap_deep_copy(struct/array)

Returns a copy of a struct or array, including a copy of any nested structs and arrays.

 

snap_difference(old, new)

Returns a data structure (itself made from structs and arrays) that describes the difference between two structs/arrays.

 

snap_difference_apply(struct/array, differenceStruct)

Applies a difference delta structure created by snap_difference() to a struct/array.

About

Data format converters for GameMaker LTS 2022

Topics

Resources

Stars

99 stars

Watchers

5 watching

Forks

Releases

Used by

Contributors

Languages