INI File Parser and Writer
(define myeval (make-base-eval ’(require simple-ini roos)))
(require simple-ini) | package: simple-ini |
1 Creating and Parsing INI Files
procedure
file : path-string?
The parser supports:
Sections (e.g., [section-name])
Key-value pairs (e.g., key=value)
Comments (lines starting with ;)
Empty lines
Numbers, if the value matches a number pattern
Booleans, if the value is #t, true, #f, or false (case-insensitive)
Otherwise, as strings
procedure
(ini->file ini file) → void?
ini : mc-pair? file : path-string?
Section headers
Key-value pairs
Comments (prefixed with ;)
Empty lines
2 Accessing and Modifying Values
3 The ini Roos Class
(require simple-ini/roos) | package: simple-ini |
procedure
ini : roos-class* or/c : path-string?
If no file is provided, the object operates in-memory only. Subsequent set! operations will raise an error unless a file is later specified with (file!).
procedure
(file) → (or/c path-string? #f)
procedure
(file! f) → void?
f : path-string?
procedure
(fail) → boolean?
procedure
(reload) → void?
If a file is associated with the object, the structure is saved to disk immediately. If no file is set and fail is enabled, an error is raised. Returns the INI object itself.
Returns #f if no default is given and fail is disabled
Returns def-val if one is provided
Raises an error if fail is enabled and no default is given
file* — the filename (or #f)
content — the mutable INI structure