TomlArray Class

A mutable TOML array, written as [1, 2]. An array of tables written with [[header]] is a TomlTableArray.

Inheritance
TomlNode TomlArray
Implements

Constructors

NameDescription
TomlArray()Initializes a new empty array.
TomlArray(ReadOnlySpan<TomlNode>)Initializes a new array with elements.

TomlArray overloads

TomlArray()

TomlArray.cs

Initializes a new empty array.

public TomlArray()

TomlArray(ReadOnlySpan<TomlNode>)

TomlArray.cs

Initializes a new array with elements.

public TomlArray(params scoped ReadOnlySpan<TomlNode> items)
Parameters
items ReadOnlySpan<TomlNode>
The elements.

Properties

NameDescription
CountGets the number of elements.
System.Collections.Generic.ICollection<Meziantou.Framework.Toml.Nodes.TomlNode>.IsReadOnly

Gets the number of elements.

public int Count { get; }

Property value

int

System.Collections.Generic.ICollection<Meziantou.Framework.Toml.Nodes.TomlNode>.IsReadOnly

TomlArray.cs
bool ICollection<TomlNode>.IsReadOnly { get; }

Property value

bool

No documentation is available.

Indexers

NameDescription
this[int]Gets or sets the element at an index.

this[int]

TomlArray.cs

Gets or sets the element at an index.

public new TomlNode this[int index] { get; set; }

Parameters

index int

Property value

TomlNode

Methods

NameDescription
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.cs

Adds an element.

public void Add(TomlNode item)

Parameters

item TomlNode

Removes all the elements.

public void Clear()

Contains(TomlNode)

TomlArray.cs

Gets a value indicating whether the array contains a node.

public bool Contains(TomlNode item)

Parameters

item TomlNode

Returns

bool

CopyTo(TomlNode[], int)

TomlArray.cs

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

public void CopyTo(TomlNode[] array, int arrayIndex)

Parameters

array TomlNode[]
The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
arrayIndex int
The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException
array is null.
ArgumentOutOfRangeException
arrayIndex is less than 0.
ArgumentException
The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

DeepClone()

TomlArray.cs

Gets a copy of the node and its descendants, without a parent.

public override TomlNode DeepClone()

Returns

TomlNode

GetEnumerator()

TomlArray.cs

Gets an enumerator of the elements.

public List<TomlNode>.Enumerator GetEnumerator()

GetValueKind()

TomlArray.cs

Gets the kind of the value.

public override TomlValueKind GetValueKind()

IndexOf(TomlNode)

TomlArray.cs

Gets the index of a node in the array, or -1.

public int IndexOf(TomlNode item)

Parameters

item TomlNode

Returns

int

Insert(int, TomlNode)

TomlArray.cs

Inserts an element.

public void Insert(int index, TomlNode item)

Parameters

index int
item TomlNode

Remove(TomlNode)

TomlArray.cs

Removes a node.

public bool Remove(TomlNode item)

Parameters

item TomlNode

Returns

bool

RemoveAt(int)

TomlArray.cs

Removes the element at an index.

public void RemoveAt(int index)

Parameters

index int

System.Collections.Generic.IEnumerable<Meziantou.Framework.Toml.Nodes.TomlNode>.GetEnumerator()

TomlArray.cs

No documentation is available.

System.Collections.IEnumerable.GetEnumerator()

TomlArray.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.

WriteTo(Utf8TomlWriter)

TomlArray.cs

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.

public override void WriteTo(Utf8TomlWriter writer)

Parameters

writer Utf8TomlWriter
The writer.