Table of Contents

DelimitedDocument Class

Definition

Namespace
Bodu.Text.Delimited.Document
Assembly
Bodu.Text.Delimited.dll
Package
Bodu.Text.Delimited 1.0.0
Source
DelimitedDocument.cs

Provides a read-only, forward-parsed view over a delimited (CSV/TSV) document, shaped after System.Text.Json's JsonDocument. The document is an array of records.

public sealed class DelimitedDocument : IDisposable
Inheritance
DelimitedDocument
Implements
Inherited Members
Extension Methods

Remarks

The document owns a flat store of decoded rows and must be disposed when no longer needed; every DelimitedElement obtained from it becomes invalid once the document is disposed.

Properties

Headers

Gets the header column names, or an empty list in headerless mode.

public IReadOnlyList<string> Headers { get; }

Property Value

IReadOnlyList<string>

The header names.

RootElement

Gets the root element, which is always the document array of records.

public DelimitedElement RootElement { get; }

Property Value

DelimitedElement

The root DelimitedElement.

Exceptions

ObjectDisposedException

Thrown when the document has been disposed.

Methods

Dispose()

Releases the document's backing store.

public void Dispose()

Parse(ReadOnlySpan<byte>)

Parses the supplied UTF-8 bytes into a read-only delimited document.

public static DelimitedDocument Parse(ReadOnlySpan<byte> utf8Delimited)

Parameters

utf8Delimited ReadOnlySpan<byte>

The delimited source bytes.

Returns

DelimitedDocument

The parsed document.

Exceptions

DelimitedFormatException

Thrown when the bytes are not valid delimited text.

Parse(ReadOnlySpan<byte>, DelimitedReaderOptions)

Parses the supplied UTF-8 bytes into a read-only delimited document using the supplied reader options.

public static DelimitedDocument Parse(ReadOnlySpan<byte> utf8Delimited, DelimitedReaderOptions options)

Parameters

utf8Delimited ReadOnlySpan<byte>

The delimited source bytes.

options DelimitedReaderOptions

The reader options.

Returns

DelimitedDocument

The parsed document.

Exceptions

DelimitedFormatException

Thrown when the bytes are not valid delimited text.

Applies to

ProductVersions
.NET8, 10