Happy !
TorstenBergmann / INIFile
About INIFile
IMPORTANT
- This repo is obsolete and moved to https://github.com/astares/Pharo-INIFile
Overview
- Parser for .INI files (usually used on Windows)
- can be loaded from ConfigurationBrowser within Pharo
Usage
The project includes a class INIFile that represent an INI file. An INI file is typically stored as a file with an *.ini extension and holds initialization values for an application in the following format:
Examples
Writing to an INI file
|file section stream|
file := INIFile new.
section := file section: 'First section'.
section at: 'key1' put: 'val1'.
section at: 'key2' put: 'val2'.
stream := 'test.ini' asFileReference writeStream.
[file writeOn: stream ]
ensure: [ stream close ]
The resulting ini file will be:
[First section]
key1=val1
key2=val2
Reading from an INI File
|file section stream|
stream := 'test.ini' asFileReference readStream.
file := INIFile readFrom: stream.
section := file section: 'First section'.
(section at: 'key1') inspect.
stream close.
