Passer au contenu principal
Version: bleeding-edge 🩸

TOML

Bibliothèque TOML.

🗿Static Class🧑‍💻API Source

🎒 Examples

(TOML.Dump) Stringifies a Lua table
local encoded_value = TOML.Dump({ 1, 2, 3, { x = 10, y = Vector(1, 2, 3) }, "he" })
-- Outputs "[ 1, 2, 3, { y = "Vector(1.000000, 2.000000, 3.000000)", x = 10 }, "he" ]"
(TOML.Parse) Parses a TOML string into a Lua table
local decoded_value = TOML.Parse("my_table = [ 1, 2, 3 ]")
-- Outputs "the table { ["my_table"] = { [1] = 1, [2] = 2, [3] = 3 } }"

🗿 Static Functions

ReturnsNameDescription
stringDumpRenvoie une chaîne représentant la valeur encodée en TOML
anyParseRenvoie une valeur représentant la chaîne TOML décodée

Dump

Renvoie une chaîne représentant la valeur encodée en TOML
local ret = TOML.Dump(value)

Parameters

TypeParameterDefaultDescription
tablevalue Required parameter La table qui sera convertie en TOML

Returns

TypeDescription
stringLa table au format TOML
TOML.Dump Examples
Stringifies a Lua table
local encoded_value = TOML.Dump({ 1, 2, 3, { x = 10, y = Vector(1, 2, 3) }, "he" })
-- Outputs "[ 1, 2, 3, { y = "Vector(1.000000, 2.000000, 3.000000)", x = 10 }, "he" ]"

Parse

Renvoie une valeur représentant la chaîne TOML décodée
local ret = TOML.Parse(value)

Parameters

TypeParameterDefaultDescription
stringvalue Required parameter Le TOML qui sera converti en table

Returns

TypeDescription
anyLe TOML sous forme de table
TOML.Parse Examples
Parses a TOML string into a Lua table
local decoded_value = TOML.Parse("my_table = [ 1, 2, 3 ]")
-- Outputs "the table { ["my_table"] = { [1] = 1, [2] = 2, [3] = 3 } }"