INI Parsing
Load INI files from disk or from an in-memory string. Sections and options are auto-detected โ no schema required.
A pure Fortran 2003+ OOP library for reading and writing INI configuration files.
Parse an INI source string and retrieve a multi-value option:
use finer
use penf, only: R4P, I4P
type(file_ini) :: fini
character(len=:), allocatable :: source
real(R4P), allocatable :: array(:)
integer(I4P) :: error
source = '[section-1]'//new_line('A')// &
'option-1 = one'//new_line('A')// &
'option-2 = 2.'//new_line('A')// &
' 3.'//new_line('A')// &
'[section-2]'//new_line('A')// &
'option-1 = foo'
call fini%load(source=source)
allocate(array(1:fini%count_values(section='section-1', option='option-2')))
call fini%get(section='section-1', option='option-2', val=array, error=error)
if (error == 0) print *, array ! 2.0 3.0Contributions are welcome โ see the Contributing page.
FiNeR is distributed under a multi-licensing system:
| Use case | License |
|---|---|
| FOSS projects | GPL v3 |
| Closed source / commercial | BSD 2-Clause |
| Closed source / commercial | BSD 3-Clause |
| Closed source / commercial | MIT |
Anyone interested in using, developing, or contributing to FiNeR is welcome โ pick the license that best fits your needs.