DelimitedObject Class
Definition
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
keystringThe column name.
Property Value
- DelimitedNode
The field value node.
Exceptions
- ArgumentNullException
Thrown when
keyor the assigned value is null.- KeyNotFoundException
Thrown by the getter when
keyis 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
keystringThe column name.
Returns
Exceptions
- ArgumentNullException
Thrown when
keyis 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
keystringThe column name.
Returns
Exceptions
- ArgumentNullException
Thrown when
keyis null.
TryGetValue(string, out DelimitedNode?)
Attempts to get the field value for the specified column.
public bool TryGetValue(string key, out DelimitedNode? value)
Parameters
keystringThe column name.
valueDelimitedNodeWhen this method returns true, the field value; otherwise null.
Returns
Exceptions
- ArgumentNullException
Thrown when
keyis null.
WriteTo(ref Utf8DelimitedWriter)
Writes this node's delimited representation to the supplied writer.
public override void WriteTo(ref Utf8DelimitedWriter writer)
Parameters
writerUtf8DelimitedWriterThe writer that receives the delimited bytes.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |