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

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.


```pony
interface ref IniNotify
```

## Public Functions

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


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.


```pony
fun ref apply(
  section: String val,
  key: String val,
  value: String val)
: Bool val
```
#### Parameters

*   section: [String](builtin-String.md) val
*   key: [String](builtin-String.md) val
*   value: [String](builtin-String.md) val

#### Returns

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

---

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


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.


```pony
fun ref add_section(
  section: String val)
: Bool val
```
#### Parameters

*   section: [String](builtin-String.md) val

#### Returns

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

---

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


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.


```pony
fun ref errors(
  line: USize val,
  err: IniError)
: Bool val
```
#### Parameters

*   line: [USize](builtin-USize.md) val
*   err: [IniError](ini-IniError.md)

#### Returns

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

---

