TomlTable Class

Runtime representation of a TOML table

Remarks

This object keep the order of the inserted key=values

Inheritance
TomlObject TomlTable
Implements

Nested types

NameDescription
TomlTable.EnumeratorEnumerates the key-value pairs contained in a TomlTable.

Constructors

NameDescription
TomlTable()Creates an instance of a TomlTable
TomlTable(bool)Creates an instance of TomlTable.

TomlTable overloads

TomlTable()

TomlTable.cs

Creates an instance of a TomlTable

public TomlTable()

TomlTable(bool)

TomlTable.cs

Creates an instance of TomlTable.

public TomlTable(bool inline)
Parameters
inline bool

Properties

NameDescription
CountGets the number of elements contained in the ICollection<T>.
IsReadOnlyGets a value indicating whether the ICollection<T> is read-only.
KeysGets a read-only snapshot of the keys, in insertion order.
ValuesGets a read-only snapshot of the values, in insertion order.

Gets the number of elements contained in the ICollection<T>.

public int Count { get; }

Property value

int

IsReadOnly

TomlTable.cs

Gets a value indicating whether the ICollection<T> is read-only.

public bool IsReadOnly { get; }

Property value

bool

Gets a read-only snapshot of the keys, in insertion order.

public ICollection<string> Keys { get; }

Property value

ICollection<string>

Gets a read-only snapshot of the values, in insertion order.

public ICollection<object> Values { get; }

Property value

ICollection<object>

Indexers

NameDescription
this[string]Gets or sets the element with the specified key.

this[string]

TomlTable.cs

Gets or sets the element with the specified key.

public object this[string key] { get; set; }

Parameters

key string
The key of the element to get or set.

Property value

object

Exceptions

ArgumentNullException
key is null.
KeyNotFoundException
The property is retrieved and key is not found.
NotSupportedException
The property is set and the IDictionary<TKey, TValue> is read-only.

Methods

NameDescription
Add(string, object)Adds an element with the provided key and value to the IDictionary<TKey, TValue>.
Clear()Removes all items from the ICollection<T>.
ContainsKey(string)Determines whether the IDictionary<TKey, TValue> contains an element with the specified key.
GetEnumerator()Returns an enumerator that iterates through the table.
Remove(string)Removes the element with the specified key from the IDictionary<TKey, TValue>.
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(KeyValuePair<string, object>)
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(KeyValuePair<string, object>)
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(KeyValuePair<string, object>[], int)
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(KeyValuePair<string, object>)
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.GetEnumerator()
System.Collections.IEnumerable.GetEnumerator()
TryGetValue(string, object)Gets the value associated with the specified key.

Add(string, object)

TomlTable.cs

Adds an element with the provided key and value to the IDictionary<TKey, TValue>.

public void Add(string key, object value)

Parameters

key string
The object to use as the key of the element to add.
value object
The object to use as the value of the element to add.

Exceptions

ArgumentNullException
key is null.
ArgumentException
An element with the same key already exists in the IDictionary<TKey, TValue>.
NotSupportedException
The IDictionary<TKey, TValue> is read-only.

Removes all items from the ICollection<T>.

public void Clear()

Exceptions

NotSupportedException
The ICollection<T> is read-only.

ContainsKey(string)

TomlTable.cs

Determines whether the IDictionary<TKey, TValue> contains an element with the specified key.

public bool ContainsKey(string key)

Parameters

key string
The key to locate in the IDictionary<TKey, TValue>.

Returns

bool true if the IDictionary<TKey, TValue> contains an element with the key; otherwise, false.

Exceptions

ArgumentNullException
key is null.

GetEnumerator()

TomlTable.cs

Returns an enumerator that iterates through the table.

public TomlTable.Enumerator GetEnumerator()

Returns

TomlTable.Enumerator An enumerator for the table.

Remove(string)

TomlTable.cs

Removes the element with the specified key from the IDictionary<TKey, TValue>.

public bool Remove(string key)

Parameters

key string
The key of the element to remove.

Returns

bool true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<TKey, TValue>.

Exceptions

ArgumentNullException
key is null.
NotSupportedException
The IDictionary<TKey, TValue> is read-only.

System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(KeyValuePair<string, object>)

TomlTable.cs

No documentation is available.

System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(KeyValuePair<string, object>)

TomlTable.cs

Parameters

item KeyValuePair<string, object>

Returns

bool

No documentation is available.

System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(KeyValuePair<string, object>[], int)

TomlTable.cs

Parameters

array KeyValuePair<string, object>[]
arrayIndex int

No documentation is available.

System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(KeyValuePair<string, object>)

TomlTable.cs

Parameters

item KeyValuePair<string, object>

Returns

bool

No documentation is available.

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.GetEnumerator()

TomlTable.cs

System.Collections.IEnumerable.GetEnumerator()

TomlTable.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.

TryGetValue(string, object)

TomlTable.cs

Gets the value associated with the specified key.

public bool TryGetValue(string key, out object value)

Parameters

key string
The key whose value to get.
value object
When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns

bool true if the object that implements IDictionary<TKey, TValue> contains an element with the specified key; otherwise, false.

Exceptions

ArgumentNullException
key is null.