TOML
Bibliothèque TOML.
🗿Static Class
This is a Static Class. Access it's methods directly with
.. It's not possible to spawn new instances.🧑💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!
🎒 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
| Returns | Name | Description | |
|---|---|---|---|
| string | Dump | Renvoie une chaîne représentant la valeur encodée en TOML | |
| any | Parse | Renvoie 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
| Type | Parameter | Default | Description |
|---|---|---|---|
| table | value | Required parameter | La table qui sera convertie en TOML |
Returns
| Type | Description |
|---|---|
| string | La 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
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | value | Required parameter | Le TOML qui sera converti en table |
Returns
| Type | Description |
|---|---|
| any | Le 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 } }"