Toml Serializer¶
| Spice | |
|---|---|
TomlSerializer struct¶
Serializer for TOML output.
By default sub-tables are emitted as [table] sections and arrays that only contain tables as [[array of table]] sections, which is how TOML documents are usually written. With inlineTables enabled everything is emitted as key = value lines instead, using inline tables for nested structures.
Either way the result round-trips through parseToml from "std/text/toml-parser".
Constructors¶
ctor¶
| Spice | |
|---|---|
Construct a TOML serializer
Parameters
| Name | Type | Description |
|---|---|---|
inlineTables |
bool |
Emit nested tables inline instead of as separate sections (default: false) |
Methods¶
serialize¶
| Spice | |
|---|---|
Serializes a TOML table into a TOML document
Parameters
| Name | Type | Description |
|---|---|---|
root |
TomlValue& |
Root table to serialize |
Returns: String — TOML representation
serialize¶
| Spice | |
|---|---|
Serializes a TOML table into a TOML document
Parameters
| Name | Type | Description |
|---|---|---|
root |
TomlValue* |
Root table to serialize |
Returns: String — TOML representation
serializeValue¶
| Spice | |
|---|---|
Serializes a single TOML value in its inline form, as it would appear on the right hand side of a key = value pair
Parameters
| Name | Type | Description |
|---|---|---|
value |
TomlValue* |
Value to serialize |
Returns: String — TOML representation