Class TomlKey
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
rawKeystringThe raw key string.
typeTomlKeyTypeThe key type. If Unknown, the type is automatically determined based on the key content.
Exceptions
- ArgumentNullException
Thrown when
rawKeyisnull.
Properties
IsDottedKey
Gets a value indicating whether this is a dotted key.
public bool IsDottedKey { get; }
Property Value
IsQuotedBasicStringKey
Gets a value indicating whether this key uses basic string quotation (with escape sequences).
public bool IsQuotedBasicStringKey { get; }
Property Value
IsQuotedKey
Gets a value indicating whether this key uses quoted syntax (either basic or literal string).
public bool IsQuotedKey { get; }
Property Value
IsQuotedLiteralStringKey
Gets a value indicating whether this key uses literal string quotation (no escape sequences).
public bool IsQuotedLiteralStringKey { get; }
Property Value
IsUnquotedKey
Gets a value indicating whether this key is unquoted.
public bool IsUnquotedKey { get; }
Property Value
LastKeyPart
Gets the last key part in this dotted key sequence.
public TomlKey LastKeyPart { get; }
Property Value
NextKeyPart
Gets or sets the next part of this key.
public TomlKey? NextKeyPart { get; set; }
Property Value
RawKey
Gets the raw key string as specified when the key was created.
public string RawKey { get; }
Property Value
Type
Gets the key type (unquoted or quoted with specific string syntax).
public TomlKeyType Type { get; }
Property Value
Methods
Clone()
Creates a deep copy of this key.
public TomlKey Clone()
Returns
Equals(TomlKey?)
Determines whether this key is equal to another key.
public bool Equals(TomlKey? other)
Parameters
otherTomlKeyThe key to compare with.
Returns
- bool
trueif the keys are equal; otherwise,false.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()