TOML parser implementation for data serialization and deserialization in Fortran.
Find us on…
Welcome to the API documentation for TOML Fortran (toml-f), a TOML parser implementation for data serialization and deserialization in Fortran.
To use TOML Fortran in your project, import the main module:
use tomlf
This provides access to all public types and procedures for parsing, manipulating, and serializing TOML data.
| Type | Description |
|---|---|
| toml_table | TOML table (key-value mapping) |
| toml_array | TOML array |
| toml_keyval | Single key-value pair |
| toml_value | Abstract base type for all TOML values |
| toml_datetime | TOML datetime representation |
| toml_error | Error information from parsing |
use tomlf
implicit none
type(toml_table), allocatable :: table
type(toml_error), allocatable :: error
character(len=:), allocatable :: title
call toml_load(table, "config.toml", error=error)
if (allocated(error)) then
print '(a)', error%message
stop 1
end if
call get_value(table, "title", title)
print '(a)', title