IniParseOptions Class

Configures how IniSyntaxTree parses text.

public sealed class IniParseOptions : IEquatable<IniParseOptions>

Remarks

INI has no specification, so these options select between the behaviors of the common dialects.

Implements

Constructors

NameDescription
IniParseOptions()

IniParseOptions()

IniParseOptions.cs
public IniParseOptions()

No documentation is available.

Properties

NameDescription
AllowKeysWithoutValueGets a value indicating whether a line holding only a key, such as skip-networking in a MySQL option file, is a property. When it is not allowed, the line is still read as a property, and INI0004 is reported.
AllowMultilineValuesGets a value indicating whether a value continues on the lines that follow it when they are indented more than its key, as Python's configparser reads them.
AllowQuotedValuesGets a value indicating whether a value wholly in double or single quotes, such as "a;b", is read without them, so that ; and # inside them never start a comment. Defaults to true.
DefaultGets the options used when none are given.
InlineCommentsGets where ; and # start a comment other than at the beginning of a line.
NameComparerGets how section names and keys are compared to find duplicates. Defaults to StringComparer.OrdinalIgnoreCase.
ReportDuplicatesGets a value indicating whether a section name used twice (INI0006) and a key used twice in the same section (INI0007) are reported as warnings. Names are compared with IniParseOptions.NameComparer.

AllowKeysWithoutValue

IniParseOptions.cs

Gets a value indicating whether a line holding only a key, such as skip-networking in a MySQL option file, is a property. When it is not allowed, the line is still read as a property, and INI0004 is reported.

public bool AllowKeysWithoutValue { get; init; }

Property value

bool

AllowMultilineValues

IniParseOptions.cs

Gets a value indicating whether a value continues on the lines that follow it when they are indented more than its key, as Python's configparser reads them.

public bool AllowMultilineValues { get; init; }

Property value

bool

Remarks

As in configparser, a comment line between the lines of a value is skipped, and a blank line between them is an empty line of the value. Each line is read like a one-line value, so its quotes and its comment are not part of it.

AllowQuotedValues

IniParseOptions.cs

Gets a value indicating whether a value wholly in double or single quotes, such as "a;b", is read without them, so that ; and # inside them never start a comment. Defaults to true.

public bool AllowQuotedValues { get; init; }

Property value

bool

Remarks

Set it to false for dialects where quotes are ordinary characters, such as Python's configparser: the value of key="a" is then "a", quotes included, and an edit never adds quotes to a value.

Gets the options used when none are given.

public static IniParseOptions Default { get; }

Property value

IniParseOptions

InlineComments

IniParseOptions.cs

Gets where ; and # start a comment other than at the beginning of a line.

public IniInlineCommentMode InlineComments { get; init; }

Property value

IniInlineCommentMode

Exceptions

ArgumentOutOfRangeException
The value is not one of IniInlineCommentMode.

Remarks

A value in quotes, such as "a;b", never contains a comment, whatever this says.

NameComparer

IniParseOptions.cs

Gets how section names and keys are compared to find duplicates. Defaults to StringComparer.OrdinalIgnoreCase.

public StringComparer NameComparer { get; init; }

Property value

StringComparer

Exceptions

ArgumentNullException
The value is null.

ReportDuplicates

IniParseOptions.cs

Gets a value indicating whether a section name used twice (INI0006) and a key used twice in the same section (INI0007) are reported as warnings. Names are compared with IniParseOptions.NameComparer.

public bool ReportDuplicates { get; init; }

Property value

bool

Methods

NameDescription
Equals(IniParseOptions?)
Equals(object?)
GetHashCode()
ToString()

Equals overloads

Equals(IniParseOptions?)

public bool Equals(IniParseOptions? other)
Parameters
other IniParseOptions?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(IniParseOptions?, IniParseOptions?)
operator !=(IniParseOptions?, IniParseOptions?)

operator ==(IniParseOptions?, IniParseOptions?)

public static bool operator ==(IniParseOptions? left, IniParseOptions? right)

Parameters

left IniParseOptions?
right IniParseOptions?

Returns

bool

No documentation is available.

operator !=(IniParseOptions?, IniParseOptions?)

public static bool operator !=(IniParseOptions? left, IniParseOptions? right)

Parameters

left IniParseOptions?
right IniParseOptions?

Returns

bool

No documentation is available.