Table of Contents

Class TomlKey

Namespace
RStein.TOML
Assembly
RStein.TOML.dll

Represents a TOML key

public class TomlKey : TomlToken, IEnumerable<TomlToken>, IEnumerable, IEquatable<TomlKey>
Inheritance
TomlKey
Implements
Inherited Members

Constructors

TomlKey(string, TomlKeyType)

Initializes a new instance of the TomlKey class with the specified raw key string.

public TomlKey(string rawKey, TomlKeyType type = TomlKeyType.Unknown)

Parameters

rawKey string

The raw key string.

type TomlKeyType

The key type. If Unknown, the type is automatically determined based on the key content.

Exceptions

ArgumentNullException

Thrown when rawKey is null.

Properties

IsDottedKey

Gets a value indicating whether this is a dotted key.

public bool IsDottedKey { get; }

Property Value

bool

IsQuotedBasicStringKey

Gets a value indicating whether this key uses basic string quotation (with escape sequences).

public bool IsQuotedBasicStringKey { get; }

Property Value

bool

IsQuotedKey

Gets a value indicating whether this key uses quoted syntax (either basic or literal string).

public bool IsQuotedKey { get; }

Property Value

bool

IsQuotedLiteralStringKey

Gets a value indicating whether this key uses literal string quotation (no escape sequences).

public bool IsQuotedLiteralStringKey { get; }

Property Value

bool

IsUnquotedKey

Gets a value indicating whether this key is unquoted.

public bool IsUnquotedKey { get; }

Property Value

bool

LastKeyPart

Gets the last key part in this dotted key sequence.

public TomlKey LastKeyPart { get; }

Property Value

TomlKey

NextKeyPart

Gets or sets the next part of this key.

public TomlKey? NextKeyPart { get; set; }

Property Value

TomlKey

RawKey

Gets the raw key string as specified when the key was created.

public string RawKey { get; }

Property Value

string

Type

Gets the key type (unquoted or quoted with specific string syntax).

public TomlKeyType Type { get; }

Property Value

TomlKeyType

Methods

Clone()

Creates a deep copy of this key.

public TomlKey Clone()

Returns

TomlKey

A new TomlKey instance that is a copy of this key.

Equals(TomlKey?)

Determines whether this key is equal to another key.

public bool Equals(TomlKey? other)

Parameters

other TomlKey

The key to compare with.

Returns

bool

true if the keys are equal; otherwise, false.

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string