World Conquest Chronicles

World Conquest Chronicles

luaserialization, v1.1.0

The library that implements various auxiliary functions for serialization.

Support for serialization to JSON.

Disclaimer: this library was written directly on an Android smartphone with the QLua IDE.

Change Log

  • serialization to JSON:
    • json.to_json() function — this function calls the data.to_data() function and then transforms the data into the JSON;
    • json.from_json() function — this function transforms the text in the JSON to a data:
      • optionally, it can validate the data against a JSON Schema.

Features

  • data.to_data() function — this function recursively calls the __data() metamethod if it exists;
  • serialization to string:
    • string.to_string() function — this function calls the data.to_data() function and then applies library inspect.lua;
    • Stringifiable mixin — this mixin adds the __tostring() metamethod that calls the string.to_string() function;
  • serialization to JSON:
    • json.to_json() function — this function calls the data.to_data() function and then transforms the data into the JSON;
    • json.from_json() function — this function transforms the text in the JSON to a data:
      • optionally, it can validate the data against a JSON Schema.

Repository

Link: https://github.com/thewizardplusplus/luaserialization/tree/v1.1.0.

Content: code.

License: MIT.