Skip to content

Ini

[Source]

A streaming parser for INI formatted lines of text.

Lines are pulled from the iterator one at a time and dispatched to an IniNotify handler as section headers, key/value pairs, or errors. The current section name is the only piece of parsed input that persists across handler calls; everything else (the line number reported with errors, the running success/failure status returned at the end) is internal bookkeeping the handler does not see.

primitive val Ini

Constructors

create

[Source]

new val create()
: Ini val^

Returns


Public Functions

apply

[Source]

Parse lines and call f for each section header and key/value pair. Returns true when parsing finishes with no errors, false otherwise.

When the parser hits a malformed line it calls f.errors. If errors returns true parsing continues, but the final return value is still false. If errors returns false parsing stops immediately and apply returns false.

f.apply and f.add_section can also stop parsing early by returning false. In that case apply returns whatever the parse status was at the point of the stop: true if no errors had been seen, false if any had.

fun box apply(
  lines: Iterator[String box] ref,
  f: IniNotify ref)
: Bool val

Parameters

Returns


eq

[Source]

fun box eq(
  that: Ini val)
: Bool val

Parameters

  • that: Ini val

Returns


ne

[Source]

fun box ne(
  that: Ini val)
: Bool val

Parameters

  • that: Ini val

Returns