Passer au contenu principal
Version: latest - a1.65.x ⚖️

TOML

TOML library.

🗿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

ReturnsNameDescription
stringDumpReturns a string representing value encoded in TOML
anyParseReturns a value representing the decoded TOML string

Dump

Returns a string representing value encoded in TOML

— Returns string (the table in TOML).

local ret = TOML.Dump(value)
TypeParameterDefaultDescription
tablevalue Required parameter the table that will become 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

Returns a value representing the decoded TOML string

— Returns any (the TOML in table).

local ret = TOML.Parse(value)
TypeParameterDefaultDescription
stringvalue Required parameter the TOML that will become a 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 } }"