TomlParserOptions Class

Configures the behavior of TomlParser.

public sealed class TomlParserOptions : IEquatable<TomlParserOptions>
Implements

Constructors

NameDescription
TomlParserOptions()

TomlParserOptions()

public TomlParserOptions()

No documentation is available.

Properties

NameDescription
CaptureTriviaGets or sets a value indicating whether the parser captures comment trivia.
DecodeScalarsGets or sets a value indicating whether the parser eagerly decodes scalar string literals. When false (default), string values are decoded on demand (for example via TomlParser.GetString).
EagerStringValuesGets or sets a value indicating whether the parser should eagerly materialize simple string values (single-line basic strings without escape sequences) even when TomlParserOptions.DecodeScalars is false.
ModeGets or sets how the parser handles syntax errors.

Gets or sets a value indicating whether the parser captures comment trivia.

public bool CaptureTrivia { get; init; }

Property value

bool

Remarks

When enabled, the parser records comment trivia around property names and scalar values so that higher-level layers can populate ITomlMetadataStore instances.

Gets or sets a value indicating whether the parser eagerly decodes scalar string literals. When false (default), string values are decoded on demand (for example via TomlParser.GetString).

public bool DecodeScalars { get; init; }

Property value

bool

EagerStringValues

TomlParserOptions.cs

Gets or sets a value indicating whether the parser should eagerly materialize simple string values (single-line basic strings without escape sequences) even when TomlParserOptions.DecodeScalars is false.

public bool EagerStringValues { get; init; }

Property value

bool

Remarks

This option can improve performance for deserialization scenarios that always consume string values (for example, via TomlReader.GetString), while still avoiding eager decoding for complex strings that contain escape sequences.

Gets or sets how the parser handles syntax errors.

public TomlParserMode Mode { get; init; }

Property value

TomlParserMode

Exceptions

ArgumentOutOfRangeException
Value is not a defined TomlParserMode.

Methods

NameDescription
Equals(TomlParserOptions?)
Equals(object?)
GetHashCode()
ToString()

Equals overloads

Equals(TomlParserOptions?)

public bool Equals(TomlParserOptions? other)
Parameters
other TomlParserOptions?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(TomlParserOptions?, TomlParserOptions?)
operator !=(TomlParserOptions?, TomlParserOptions?)

operator ==(TomlParserOptions?, TomlParserOptions?)

public static bool operator ==(TomlParserOptions? left, TomlParserOptions? right)

Parameters

left TomlParserOptions?
right TomlParserOptions?

Returns

bool

No documentation is available.

operator !=(TomlParserOptions?, TomlParserOptions?)

public static bool operator !=(TomlParserOptions? left, TomlParserOptions? right)

Parameters

left TomlParserOptions?
right TomlParserOptions?

Returns

bool

No documentation is available.