TomlArray Class
A mutable TOML array, written as [1, 2]. An array of tables written with [[header]] is a TomlTableArray.
public sealed class TomlArray : TomlNode, ICollection<TomlNode>, IEnumerable<TomlNode>, IList<TomlNode>, IEnumerable- Inheritance
TomlNodeTomlArray- Implements
Constructors
| Name | Description |
|---|---|
| TomlArray() | Initializes a new empty array. |
| TomlArray(ReadOnlySpan<TomlNode>) | Initializes a new array with elements. |
TomlArray overloads
TomlArray()
TomlArray.csInitializes a new empty array.
public TomlArray()TomlArray(ReadOnlySpan<TomlNode>)
TomlArray.csInitializes a new array with elements.
public TomlArray(params scoped ReadOnlySpan<TomlNode> items)Parameters
itemsReadOnlySpan<TomlNode>- The elements.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of elements. |
| System.Collections.Generic.ICollection<Meziantou.Framework.Toml.Nodes.TomlNode>.IsReadOnly |
Count
TomlArray.csSystem.Collections.Generic.ICollection<Meziantou.Framework.Toml.Nodes.TomlNode>.IsReadOnly
TomlArray.csIndexers
| Name | Description |
|---|---|
| this[int] | Gets or sets the element at an index. |
this[int]
TomlArray.csMethods
| Name | Description |
|---|---|
| Add(TomlNode) | Adds an element. |
| Clear() | Removes all the elements. |
| Contains(TomlNode) | Gets a value indicating whether the array contains a node. |
| CopyTo(TomlNode[], int) | Copies the elements of the ICollection<T> to an Array, starting at a particular Array index. |
| DeepClone() | Gets a copy of the node and its descendants, without a parent. |
| GetEnumerator() | Gets an enumerator of the elements. |
| GetValueKind() | Gets the kind of the value. |
| IndexOf(TomlNode) | Gets the index of a node in the array, or -1. |
| Insert(int, TomlNode) | Inserts an element. |
| Remove(TomlNode) | Removes a node. |
| RemoveAt(int) | Removes the element at an index. |
| System.Collections.Generic.IEnumerable<Meziantou.Framework.Toml.Nodes.TomlNode>.GetEnumerator() | |
| System.Collections.IEnumerable.GetEnumerator() | |
| WriteTo(Utf8TomlWriter) | Writes 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. |
Add(TomlNode)
TomlArray.csClear()
TomlArray.csRemoves all the elements.
public void Clear()Contains(TomlNode)
TomlArray.csCopyTo(TomlNode[], int)
TomlArray.csCopies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Parameters
arrayTomlNode[]- The one-dimensional
Arraythat is the destination of the elements copied fromICollection<T>. TheArraymust have zero-based indexing. arrayIndexint- The zero-based index in
arrayat which copying begins.
Exceptions
ArgumentNullExceptionarrayisnull.ArgumentOutOfRangeExceptionarrayIndexis less than 0.ArgumentException- The number of elements in the source
ICollection<T>is greater than the available space fromarrayIndexto the end of the destinationarray.
DeepClone()
TomlArray.csGetEnumerator()
TomlArray.csGetValueKind()
TomlArray.csIndexOf(TomlNode)
TomlArray.csInsert(int, TomlNode)
TomlArray.csRemove(TomlNode)
TomlArray.csRemoveAt(int)
TomlArray.csSystem.Collections.Generic.IEnumerable<Meziantou.Framework.Toml.Nodes.TomlNode>.GetEnumerator()
TomlArray.csSystem.Collections.IEnumerable.GetEnumerator()
TomlArray.csWriteTo(Utf8TomlWriter)
TomlArray.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.