Skip to content

IniNotify

[Source]

Handler interface for the streaming parser Ini. The parser calls these methods as it works through the input. Only apply must be implemented; add_section and errors ship default implementations that accept all sections and continue past errors.

interface ref IniNotify

Public Functions

apply

[Source]

Called for every key/value pair. Keys that appear before any section header are reported with section set to the empty string. Return false to halt processing.

fun ref apply(
  section: String val,
  key: String val,
  value: String val)
: Bool val

Parameters

Returns


add_section

[Source]

Called for every [section] header. The implicit empty-string section that holds keys appearing before any header does not trigger this callback; only a literal header line (including []) does. Return false to halt processing.

fun ref add_section(
  section: String val)
: Bool val

Parameters

Returns


errors

[Source]

Called for each malformed line. line is the 1-based line number where the error was detected. Return false to halt parsing immediately; true to keep going. Even when this returns true and parsing continues, Ini.apply will return false at the end.

fun ref errors(
  line: USize val,
  err: IniError)
: Bool val

Parameters

Returns