readIniLike

Read ini-like file entries via the set of callbacks.

void
readIniLike
(
IniLikeReader
)
(
IniLikeReader reader
,
scope void delegate
(
string
)
onLeadingComment
,
scope ActionOnGroup delegate
(
string
)
onGroup
,
scope void delegate
(
string
,
string
,
string
)
onKeyValue
,
scope void delegate
(
string
,
string
)
onCommentInGroup
,
string fileName = null
)

Parameters

reader IniLikeReader

IniLikeReader object as returned by inilike.range.iniLikeReader or similar function.

onLeadingComment void delegate
(
string
)

Delegate to call after leading comment (i.e. the one before any group) is read. The parameter is either comment of empty line.

onGroup ActionOnGroup delegate
(
string
)

Delegate to call after group header is read. The parameter is group name (without brackets). Must return ActionOnGroup.

onKeyValue void delegate
(
string
,
string
,
string
)

Delegate to call after key-value entry is read and parsed. Parameters are key, value and group name.

onCommentInGroup void delegate
(
string
,
string
)

Delegate to call after comment or empty line is read inside group section. The parameter is either comment of empty line.

fileName string

Optional file name parameter to use in thrown exceptions.

Throws

inilike.exception.IniLikeReadException if error occured while parsing. Any exception thrown by callbacks will be transformed to inilike.exception.IniLikeReadException.

Meta