Table of Contents

DotEnvReaderOptions Struct

Definition

Namespace
Bodu.Text.DotEnv.Reader
Assembly
Bodu.Text.DotEnv.dll
Package
Bodu.Text.DotEnv 1.0.0
Source
DotEnvReaderOptions.cs

Provides configuration for a Utf8DotEnvReader, controlling how the reader interprets optional DotEnv syntax conventions.

public readonly struct DotEnvReaderOptions
Inherited Members
Extension Methods

Remarks

The options are an immutable value type; assign the init-only properties through an object initializer and read Default for the standard behaviour.

Properties

Default

Gets the default reader options: the export prefix, inline comments, and comment preservation are all enabled.

public static DotEnvReaderOptions Default { get; }

Property Value

DotEnvReaderOptions

The default options.

DisallowExportPrefix

Gets a value indicating whether a leading export keyword before a key is recognized and stripped.

public bool DisallowExportPrefix { get; init; }

Property Value

bool

true to accept the export prefix; otherwise false.

Remarks

The property is inverted so the parameterless Default enables the prefix.

DisallowInlineComments

Gets a value indicating whether a # preceded by whitespace terminates an unquoted value as an inline comment.

public bool DisallowInlineComments { get; init; }

Property Value

bool

true to disable inline comments; otherwise false.

Remarks

The property is inverted so the parameterless Default enables inline comments.

SkipComments

Gets a value indicating whether comment lines are surfaced as Comment tokens.

public bool SkipComments { get; init; }

Property Value

bool

true to skip comment tokens; otherwise false.

Remarks

The property is inverted so the parameterless Default preserves comments.

Applies to

ProductVersions
.NET8, 10