DelimitedNode Class
Definition
Represents a node in a mutable delimited (CSV/TSV) document tree. A delimited document is an array of records, so the tree has three concrete shapes: a DelimitedArray (the document, or a positional record), a DelimitedObject (a header-keyed record), and a DelimitedValue string field.
public abstract class DelimitedNode
- Inheritance
-
DelimitedNode
- Derived
- Inherited Members
- Extension Methods
Properties
ValueKind
Gets the value kind of this node.
public abstract DelimitedValueKind ValueKind { get; }
Property Value
- DelimitedValueKind
The node's DelimitedValueKind.
Methods
AsArray()
Returns this node as a DelimitedArray.
public DelimitedArray AsArray()
Returns
- DelimitedArray
This node cast to DelimitedArray.
Exceptions
- InvalidOperationException
Thrown when this node is not an array.
AsObject()
Returns this node as a DelimitedObject.
public DelimitedObject AsObject()
Returns
- DelimitedObject
This node cast to DelimitedObject.
Exceptions
- InvalidOperationException
Thrown when this node is not an object.
AsValue()
Returns this node as a DelimitedValue.
public DelimitedValue AsValue()
Returns
- DelimitedValue
This node cast to DelimitedValue.
Exceptions
- InvalidOperationException
Thrown when this node is not a value.
DeepClone()
Creates a deep copy of this node.
public abstract DelimitedNode DeepClone()
Returns
- DelimitedNode
The cloned node.
Parse(ReadOnlySpan<byte>)
Parses the supplied UTF-8 bytes into a mutable delimited document array.
public static DelimitedArray Parse(ReadOnlySpan<byte> utf8Delimited)
Parameters
utf8DelimitedReadOnlySpan<byte>The delimited source bytes.
Returns
- DelimitedArray
The parsed DelimitedArray document.
Exceptions
- DelimitedFormatException
Thrown when the bytes are not valid delimited text.
Parse(ReadOnlySpan<byte>, DelimitedReaderOptions)
Parses the supplied UTF-8 bytes into a mutable delimited document array using the supplied reader options.
public static DelimitedArray Parse(ReadOnlySpan<byte> utf8Delimited, DelimitedReaderOptions options)
Parameters
utf8DelimitedReadOnlySpan<byte>The delimited source bytes.
optionsDelimitedReaderOptionsThe reader options.
Returns
- DelimitedArray
The parsed DelimitedArray document.
Exceptions
- DelimitedFormatException
Thrown when the bytes are not valid delimited text.
ToString()
Serializes this node to delimited text.
public override string ToString()
Returns
- string
The delimited text.
ToUtf8Bytes()
Serializes this node to a new UTF-8 byte array.
public byte[] ToUtf8Bytes()
Returns
- byte[]
The delimited bytes.
WriteTo(ref Utf8DelimitedWriter)
Writes this node's delimited representation to the supplied writer.
public abstract void WriteTo(ref Utf8DelimitedWriter writer)
Parameters
writerUtf8DelimitedWriterThe writer that receives the delimited bytes.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |