Table of Contents

DelimitedObject Class

Definition

Namespace
Bodu.Text.Delimited.Nodes
Assembly
Bodu.Text.Delimited.dll
Package
Bodu.Text.Delimited 1.0.0
Source
DelimitedObject.cs

Represents a header-keyed record object in a mutable delimited document tree: an insertion-ordered map of column names to DelimitedNode field values.

public sealed class DelimitedObject : DelimitedNode
Inheritance
DelimitedObject
Inherited Members
Extension Methods

Constructors

DelimitedObject()

Initializes a new instance of the DelimitedObject class.

public DelimitedObject()

Properties

Count

Gets the number of fields in this record.

public int Count { get; }

Property Value

int

The field count.

this[string]

Gets or sets the field value for the specified column, adding the column at the end when it is new.

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

Parameters

key string

The column name.

Property Value

DelimitedNode

The field value node.

Exceptions

ArgumentNullException

Thrown when key or the assigned value is null.

KeyNotFoundException

Thrown by the getter when key is not present.

Keys

Gets the column names in insertion order.

public IReadOnlyList<string> Keys { get; }

Property Value

IReadOnlyList<string>

The ordered column names.

ValueKind

Gets the value kind of this node.

public override DelimitedValueKind ValueKind { get; }

Property Value

DelimitedValueKind

The node's DelimitedValueKind.

Methods

ContainsKey(string)

Determines whether this record contains the specified column.

public bool ContainsKey(string key)

Parameters

key string

The column name.

Returns

bool

true when the column is present; otherwise false.

Exceptions

ArgumentNullException

Thrown when key is null.

DeepClone()

Creates a deep copy of this node.

public override DelimitedNode DeepClone()

Returns

DelimitedNode

The cloned node.

Remove(string)

Removes the field with the specified column name.

public bool Remove(string key)

Parameters

key string

The column name.

Returns

bool

true when a field was removed; otherwise false.

Exceptions

ArgumentNullException

Thrown when key is null.

TryGetValue(string, out DelimitedNode?)

Attempts to get the field value for the specified column.

public bool TryGetValue(string key, out DelimitedNode? value)

Parameters

key string

The column name.

value DelimitedNode

When this method returns true, the field value; otherwise null.

Returns

bool

true when the column is present; otherwise false.

Exceptions

ArgumentNullException

Thrown when key is null.

WriteTo(ref Utf8DelimitedWriter)

Writes this node's delimited representation to the supplied writer.

public override void WriteTo(ref Utf8DelimitedWriter writer)

Parameters

writer Utf8DelimitedWriter

The writer that receives the delimited bytes.

Applies to

ProductVersions
.NET8, 10