Table of Contents

IniFormatException Class

Definition

Namespace
Bodu.Text.Ini
Assembly
Bodu.Text.Ini.dll
Package
Bodu.Text.Ini 1.3.0
Source
IniFormatException.cs

Represents an error that occurs when INI data is malformed, such as an unterminated section header, an empty section name, or an entry with no assignment.

public sealed class IniFormatException : FormatException, ISerializable
Inheritance
IniFormatException
Implements
Inherited Members
Extension Methods

Remarks

A duplicate section or key that the policies in IniDocumentOptions reject is reported at the offending section header or key: LineNumber is its line, and Offset the offset of the header's [ or of the key's first byte. A global key that collides with a section of the same name is reported at that section's header when IniNode parses the input, and with no position by IniDocument, IniDocumentReader and IniSerializer, which check for the collision once the whole input has been read.

Constructors

IniFormatException()

Initializes a new instance of the IniFormatException class.

public IniFormatException()

IniFormatException(string)

Initializes a new instance of the IniFormatException class.

public IniFormatException(string message)

Parameters

message string

The error message.

IniFormatException(string, Exception)

Initializes a new instance of the IniFormatException class.

public IniFormatException(string message, Exception innerException)

Parameters

message string

The error message.

innerException Exception

The inner exception.

IniFormatException(string, int, int)

Initializes a new instance of the IniFormatException class and records the source location at which the parse error was detected.

public IniFormatException(string message, int line, int offset)

Parameters

message string

The error message.

line int

The 1-based line number at which the error occurred.

offset int

The zero-based byte offset from the start of the source.

Properties

LineNumber

Gets the 1-based line number at which the parse error was detected, when available.

public int? LineNumber { get; }

Property Value

int?

The line number, or null when no line is associated with the error.

Offset

Gets the zero-based byte offset at which the parse error was detected, when available.

public int? Offset { get; }

Property Value

int?

The byte offset, or null when no position is associated with the error.

Applies to

ProductVersions
.NET8, 10