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
| Name | Description |
|---|---|
| IniParseOptions() |
IniParseOptions()
IniParseOptions.cspublic IniParseOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| AllowKeysWithoutValue | 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. |
| AllowMultilineValues | 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. |
| AllowQuotedValues | 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. |
| Default | Gets the options used when none are given. |
| InlineComments | Gets where ; and # start a comment other than at the beginning of a line. |
| NameComparer | Gets how section names and keys are compared to find duplicates. Defaults to StringComparer.OrdinalIgnoreCase. |
| ReportDuplicates | 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. |
AllowKeysWithoutValue
IniParseOptions.csAllowMultilineValues
IniParseOptions.csGets 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
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.csGets 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
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.
Default
IniParseOptions.csGets the options used when none are given.
public static IniParseOptions Default { get; }Property value
InlineComments
IniParseOptions.csGets where ; and # start a comment other than at the beginning of a line.
public IniInlineCommentMode InlineComments { get; init; }Property value
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.csGets how section names and keys are compared to find duplicates. Defaults to StringComparer.OrdinalIgnoreCase.
public StringComparer NameComparer { get; init; }ReportDuplicates
IniParseOptions.csGets 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
Methods
| Name | Description |
|---|---|
| Equals(IniParseOptions?) | |
| Equals(object?) | |
| GetHashCode() | |
| ToString() |
Equals overloads
Equals(IniParseOptions?)
public bool Equals(IniParseOptions? other)No documentation is available.
Equals(object?)
GetHashCode()
ToString()
Operators
| Name | Description |
|---|---|
| operator ==(IniParseOptions?, IniParseOptions?) | |
| operator !=(IniParseOptions?, IniParseOptions?) |
operator ==(IniParseOptions?, IniParseOptions?)
public static bool operator ==(IniParseOptions? left, IniParseOptions? right)No documentation is available.
operator !=(IniParseOptions?, IniParseOptions?)
public static bool operator !=(IniParseOptions? left, IniParseOptions? right)No documentation is available.