# Ini
<span class="source-link">[[Source]](src/ini/ini.md#L-0-140)</span>

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.


```pony
primitive val Ini
```

## Constructors

### create
<span class="source-link">[[Source]](src/ini/ini.md#L-0-140)</span>


```pony
new val create()
: Ini val^
```

#### Returns

* [Ini](ini-Ini.md) val^

---

## Public Functions

### apply
<span class="source-link">[[Source]](src/ini/ini.md#L-0-151)</span>


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.


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

*   lines: [Iterator](builtin-Iterator.md)\[[String](builtin-String.md) box\] ref
*   f: [IniNotify](ini-IniNotify.md) ref

#### Returns

* [Bool](builtin-Bool.md) val

---

### eq
<span class="source-link">[[Source]](src/ini/ini.md#L-0-151)</span>


```pony
fun box eq(
  that: Ini val)
: Bool val
```
#### Parameters

*   that: [Ini](ini-Ini.md) val

#### Returns

* [Bool](builtin-Bool.md) val

---

### ne
<span class="source-link">[[Source]](src/ini/ini.md#L-0-151)</span>


```pony
fun box ne(
  that: Ini val)
: Bool val
```
#### Parameters

*   that: [Ini](ini-Ini.md) val

#### Returns

* [Bool](builtin-Bool.md) val

---

