Table of Contents

Bodu.Text.Delimited.Reader Namespace

Package

Bodu.Text.Delimited.Reader

Purpose

Bodu.Text.Delimited.Reader is the lowest tier of Bodu.Text.Delimited: a forward-only, allocation-light token reader over UTF-8 delimited text (RFC 4180 CSV, TSV, and other single-character dialects). The DelimitedSerializer, the mutable DelimitedNode DOM, and the read-only DelimitedDocument DOM are all built over it, and its options struct is the single place the dialect and strictness policies are declared.

Key types

Example

using Bodu.Text.Delimited;
using Bodu.Text.Delimited.Reader;

var reader = new Utf8DelimitedReader("symbol,qty\nAAPL,10\n"u8);

while (reader.Read())
{
    if (reader.TokenType == DelimitedTokenType.PropertyName)
        Console.Write($"{reader.GetString()}=");
    else if (reader.TokenType == DelimitedTokenType.String)
        Console.WriteLine(reader.GetString());
}

Notes

  • Header-shaped tokens. With a header row (the default) each record is an object of PropertyName / String pairs keyed by the header; with NoHeader each record is a positional array of String tokens.
  • String-only wire. Every field surfaces as a String token; numeric or date conversion belongs to the serializer or the caller.
  • Malformed input throws DelimitedFormatException unless the relevant behavior policy relaxes it.
  • See also: the line-formats introduction and the delimited guide.

Structs

DelimitedReaderOptions

Provides configuration for a Utf8DelimitedReader, controlling the delimiter, quoting, header handling, and the field-count and duplicate-header policies.

Utf8DelimitedReader

Provides a high-performance, forward-only reader for delimited (RFC 4180 CSV/TSV) bytes. The reader is a ref struct, so it lives on the stack and cannot be boxed or captured.