Runnable samples
The repository ships runnable, self-contained sample projects for Bodu.Text.Formats under
samples/Text.Formats/.
Both samples are offline and deterministic - they run against small committed Data/
files plus inline snippets of deliberately dirty input - and are members of bodu.slnx,
built and executed by CI. Each README documents every scenario individually: its intent, what
the code does, the output to expect, and the APIs demonstrated.
Run either sample from the repository root:
dotnet run --project samples/Text.Formats/<SampleName>
The samples
Bodu.Text.Formats.Samples.DelimitedData
RFC 4180 CSV/TSV via Bodu.Text.Delimited: parse a committed trades file into a
DelimitedDocument and read fields by header name, bind
the whole file onto typed records with DelimitedSerializer and the
snake_case naming policy; the policy knobs for dirty input -
DelimitedFieldCountBehavior (Strict throws, Ragged admits
short/long rows) and DelimitedMalformedRecordBehavior
(Throw reports text after a closing quote at the offending byte, SkipRecord skips the
malformed record whole); the mutable DelimitedNode DOM round-tripping with
selective quoting plus writer-options CSV→TSV dialect conversion; and a constant-memory
Utf8DelimitedReader →
Utf8DelimitedWriter token filter pipeline that never
materializes a document. Package: Bodu.Text.Formats (umbrella).
Bodu.Text.Formats.Samples.ConfigFiles
The two config-file formats: INI (Bodu.Text.Ini) - global keys hoisted onto the root and
sections as nested objects via the read-only IniDocument, typed
binding through IniSerializer, and the mutate + write edit loop on the
comment-preserving IniNode DOM, which keeps the sample file's
comments and canonicalizes its layout; and DotEnv (Bodu.Text.DotEnv) - export prefixes, quoting, inline comments,
empty-vs-absent values, the deliberate no-interpolation contract (values are literal;
${VAR} expansion is the consumer's explicit decision), typed settings via
DotEnvSerializer, and the streaming
Utf8DotEnvReader with per-entry line numbers, composed into a
miniature secrets lint pass. Package: Bodu.Text.Formats (umbrella).
Related
- Formats guides - the full Delimited, INI, and DotEnv documentation.
- Text.Configuration samples - the richer
.boduconfigcascade format, for when INI-style files need profiles and path-targeted resolution.