Skip to content

System Functions

Dickson Law edited this page Apr 12, 2023 · 5 revisions

General Notes

  • thing can be any lightweight data structure or basic type (e.g. array, untyped struct, number, string, undefined).
  • Functions supporting encryption can optionally take a key parameter for the encryption key, and an encfunc method for the encryption function.

Plaintext Functions

  • lds_write(thing): Return a data string representing the contents of given value.
  • lds_read(datastr): Return the restored result of the given data string.
  • lds_save(thing, filename): Save the data string representing the contents of the given value into a file.
  • lds_load(filename): Return the restored result of the data string in the given file.

Ciphertext Functions

  • lds_encrypt(thing, [key], [encfunc]): Return an encrypted data string representing the contents of the given value.
  • lds_decrypt(datastr, [key], [decfunc]): Return the restored result of the given data string.
  • lds_save_encrypted(thing, filename, [key], [encfunc]): Save and encrypt the data string representing the contents of the given value into a file.
  • lds_load_encrypted(filename, [key], [decfunc]): Return the restored result of the encrypted data string in the given file.

Untyped Struct Functions

  • lds_reduce(thing): Return a representation of the given value in terms of GML basic types (array, untyped struct, number, string, undefined).
  • lds_expand(data): Restore the GML basic type representation and return the result.

Copying Functions

  • lds_copy(target, source): Shallow-copy data from the source array, untyped struct or lightweight data structure to the target.
  • lds_copy_deep(target, source): Recursively copy data from the source array, untyped struct or lightweight data structure to the target, making clones of all nested content if applicable.
  • lds_clone(thing): Return a shallow clone of the given array, untyped struct or lightweight data structure.
  • lds_clone_deep(thing): Return a deep clone of the given array, untyped struct or lightweight data structure, making full recursive clones of all nested content if applicable.

Clone this wiki locally