Module system.serialization.toml¶
TOML configuration encoder/decoder
Index¶
API Reference¶
-
system.serialization.toml.encode(tbl:
table, opts?: {indent:boolean}): (result:string)¶ Encodes a table into TOML format. This table must only have integer or string keys in itself and each subtable, and cannot mix strings and ints.
- Parameters:
tbl (
table) – The table to encodeopts? ({indent:
boolean}) – Any options to specify while encoding
- Returns:
result (
string) – The encoded TOML data
-
system.serialization.toml.decode(str:
string, opts?: {binary_escapes:boolean|nil}): (result:table)¶ Parses TOML data into a table.
- Parameters:
str (
string) – The TOML data to decodeopts? ({binary_escapes:
boolean|nil}) – Options for decoding
- Returns:
result (
table) – A table representing the TOML data
-
system.serialization.toml.save(val:
table, path:string, opts?: {indent:boolean})¶ Saves a table to a TOML file.
- Parameters:
val (
table) – The value to savepath (
string) – The path to the file to saveopts? ({indent:
boolean}) – Any options to specify while encoding
-
system.serialization.toml.load(path:
string, opts?:table): (result:table)¶ Loads a TOML file into a table.
- Parameters:
path (
string) – The path to the file to loadopts? (
table) – Options (none available in this version)
- Returns:
result (
table) – The loaded value