Module: encoding.ini
Source: ./encoding/ini.reef
Overview
encoding/ini - INI file parsing
Simple INI file format parser supporting:
- [section] headers
- key=value pairs
-
and ; comment lines
- Whitespace trimming
Usage: import encoding.ini if ini_is_section(line) let section = ini_get_section(line) elif ini_is_key_value(line) let key = ini_get_key(line) let value = ini_get_value(line)
Types
IniBuilder
Fields:
| Name | Type |
|---|---|
sb |
sb.StringBuilder |
in_section |
bool |
Functions
fn ini_is_ws(c: char): bool
fn ini_trim(s: string): string
Trim leading and trailing whitespace
fn ini_is_empty(line: string): bool
Check if line is empty or only whitespace
fn ini_is_comment(line: string): bool
Check if line is a comment (starts with # or ; after whitespace)
fn ini_is_section(line: string): bool
Check if line is a section header [name]
fn ini_is_key_value(line: string): bool
Check if line is a key=value pair
fn ini_get_section(line: string): string
Extract section name from [section] line
fn ini_get_key(line: string): string
Extract key from key=value line
fn ini_get_value(line: string): string
Extract value from key=value line
fn ini_builder(): IniBuilder
fn ini_serialize(b: IniBuilder): string
Procedures
proc ini_begin_section(b: IniBuilder, name: string)
proc ini_set(b: IniBuilder, key: string, value: string)
proc ini_set_int(b: IniBuilder, key: string, value: int)
proc ini_set_bool(b: IniBuilder, key: string, value: bool)
proc ini_comment(b: IniBuilder, text: string)
Generated by reefc doc