Table of Contents

Class TomlSettings

Namespace
RStein.TOML
Assembly
RStein.TOML.dll

Configuration settings for TOML serialization and deserialization operations.

public class TomlSettings
Inheritance
TomlSettings
Inherited Members

Examples

// Use default settings (TOML 1.1.0)
var defaultSettings = TomlSettings.Default;

// Create settings for TOML 1.0.0
var toml10Settings = new TomlSettings(TomlVersion.Toml10);

// Use settings in deserialization
var table = await TomlSerializer.DeserializeAsync(tomlContent, toml10Settings);

Remarks

TomlSettings allows you to configure TOML version compliance and other parsing/serialization behaviors. Use the static Default property to get settings with TOML 1.1.0 specification. Create a new instance with a specific TomlVersion for version-specific behavior.

Constructors

TomlSettings()

Initializes a new instance of the TomlSettings class with default TOML 1.1.0 settings.

public TomlSettings()

TomlSettings(TomlVersion)

Initializes a new instance of the TomlSettings class with the specified TOML version.

public TomlSettings(TomlVersion tomlVersion)

Parameters

tomlVersion TomlVersion

The TOML specification version to use.

Fields

Default

Gets the default TOML settings using TOML 1.1.0 specification.

public static readonly TomlSettings Default

Field Value

TomlSettings

Properties

MaxNestingDepth

Gets or sets the maximum allowed nesting depth for arrays and inline tables during parsing.

public int MaxNestingDepth { get; set; }

Property Value

int

Remarks

Parsing is implemented as a recursive descent, so excessively deep nesting in untrusted input can exhaust the call stack. Exceeding this limit causes a TomlSerializerException to be thrown instead. The default is 200.

TomlVersion

Gets or sets the TOML specification version for parsing and serialization.

public TomlVersion TomlVersion { get; set; }

Property Value

TomlVersion

Remarks

The default is Toml11.