TomlTable Class
A mutable TOML table: the root table of a document, a table defined by a header, or an inline table. The keys keep the order they are added in.
public sealed class TomlTable : TomlNode, ICollection<KeyValuePair<string, TomlNode>>, IDictionary<string, TomlNode>, IEnumerable<KeyValuePair<string, TomlNode>>, IReadOnlyCollection<KeyValuePair<string, TomlNode>>, IReadOnlyDictionary<string, TomlNode>, IEnumerable- Inheritance
TomlNodeTomlTable- Implements
Nested types
| Name | Description |
|---|---|
| TomlTable.Enumerator | Enumerates the keys and values of a table. |
Constructors
| Name | Description |
|---|---|
| TomlTable() | Initializes a new empty table. |
| TomlTable(bool) | Initializes a new empty table. |
| TomlTable(IEnumerable<KeyValuePair<string, TomlNode>>) | Initializes a new table with keys and values. |
TomlTable overloads
TomlTable()
TomlTable.csInitializes a new empty table.
public TomlTable()TomlTable(bool)
TomlTable.csTomlTable(IEnumerable<KeyValuePair<string, TomlNode>>)
TomlTable.csInitializes a new table with keys and values.
public TomlTable(IEnumerable<KeyValuePair<string, TomlNode>> properties)Parameters
propertiesIEnumerable<KeyValuePair<string, TomlNode>>- The keys and values.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of keys. |
| IsInline | Gets or sets a value indicating whether the table is written as an inline table, such as { a = 1 }. |
| Keys | Gets the keys, in order. |
| System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>>.IsReadOnly | |
| System.Collections.Generic.IReadOnlyDictionary<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>.Keys | |
| System.Collections.Generic.IReadOnlyDictionary<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>.Values | |
| Values | Gets the values, in the order of their keys. |
Count
TomlTable.csIsInline
TomlTable.csKeys
TomlTable.csSystem.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>>.IsReadOnly
TomlTable.csbool ICollection<KeyValuePair<string, TomlNode>>.IsReadOnly { get; }Property value
No documentation is available.
System.Collections.Generic.IReadOnlyDictionary<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>.Keys
TomlTable.csIEnumerable<string> IReadOnlyDictionary<string, TomlNode>.Keys { get; }Property value
No documentation is available.
System.Collections.Generic.IReadOnlyDictionary<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>.Values
TomlTable.csIEnumerable<TomlNode> IReadOnlyDictionary<string, TomlNode>.Values { get; }Property value
No documentation is available.
Values
TomlTable.csGets the values, in the order of their keys.
public ICollection<TomlNode> Values { get; }Property value
Indexers
| Name | Description |
|---|---|
| this[string] | Gets or sets the value of a key. The getter returns null when the table has no such key. |
| this[string] | |
| this[string] |
this[string]
TomlTable.csGets or sets the value of a key. The getter returns null when the table has no such key.
this[string]
TomlTable.csthis[string]
TomlTable.csMethods
Add(string, TomlNode)
TomlTable.csClear()
TomlTable.csRemoves all the keys.
public void Clear()ContainsKey(string)
TomlTable.csDeepClone()
TomlTable.csGetEnumerator()
TomlTable.csGets an enumerator of the keys and values, in order.
public TomlTable.Enumerator GetEnumerator()Returns
GetValueKind()
TomlTable.csParse overloads
Parse(Stream, TomlDocumentOptions)
TomlTable.csParses a UTF-8 TOML document read from a stream.
public static TomlTable Parse(Stream utf8Toml, TomlDocumentOptions options = default)Parameters
utf8TomlStreamoptionsTomlDocumentOptions
Returns
Exceptions
TomlException- The document is not valid TOML.
Parse(ReadOnlyMemory<byte>, TomlDocumentOptions)
TomlTable.csParses a UTF-8 TOML document.
public static TomlTable Parse(ReadOnlyMemory<byte> utf8Toml, TomlDocumentOptions options = default)Parameters
utf8TomlReadOnlyMemory<byte>optionsTomlDocumentOptions
Returns
Exceptions
TomlException- The document is not valid TOML.
Parse(string, TomlDocumentOptions)
TomlTable.csParses a TOML document.
public static TomlTable Parse(string toml, TomlDocumentOptions options = default)Parameters
tomlstringoptionsTomlDocumentOptions
Returns
Exceptions
TomlException- The document is not valid TOML.
Remove(string)
TomlTable.csSystem.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>>.Add(KeyValuePair<string, TomlNode>)
TomlTable.csvoid ICollection<KeyValuePair<string, TomlNode>>.Add(KeyValuePair<string, TomlNode> item)Parameters
No documentation is available.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>>.Contains(KeyValuePair<string, TomlNode>)
TomlTable.csbool ICollection<KeyValuePair<string, TomlNode>>.Contains(KeyValuePair<string, TomlNode> item)No documentation is available.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>>.CopyTo(KeyValuePair<string, TomlNode>[], int)
TomlTable.csvoid ICollection<KeyValuePair<string, TomlNode>>.CopyTo(KeyValuePair<string, TomlNode>[] array, int arrayIndex)Parameters
arrayKeyValuePair<string, TomlNode>[]arrayIndexint
No documentation is available.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>>.Remove(KeyValuePair<string, TomlNode>)
TomlTable.csbool ICollection<KeyValuePair<string, TomlNode>>.Remove(KeyValuePair<string, TomlNode> item)No documentation is available.
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,Meziantou.Framework.Toml.Nodes.TomlNode>>.GetEnumerator()
TomlTable.csIEnumerator<KeyValuePair<string, TomlNode>> IEnumerable<KeyValuePair<string, TomlNode>>.GetEnumerator()No documentation is available.
System.Collections.IEnumerable.GetEnumerator()
TomlTable.csTryGetValue(string, TomlNode)
TomlTable.csWriteTo(Utf8TomlWriter)
TomlTable.csWrites the node with a writer: a table as key/value pairs and sub-tables where the writer expects a key, and as an inline table otherwise.
public override void WriteTo(Utf8TomlWriter writer)Parameters
writerUtf8TomlWriter- The writer.