TOML parser implementation for data serialization and deserialization in Fortran.

Find us on…

GitHub The Web Download the Source

TOML-Fortran

Welcome to the API documentation for TOML Fortran (toml-f), a TOML parser implementation for data serialization and deserialization in Fortran.

Getting Started

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.

Core Functionality

Parsing TOML

Serialization

Data Access

  • get_value - Retrieve values from TOML tables and arrays
  • set_value - Set values in TOML tables and arrays

Data Types

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

Example

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

Further Resources

Developer Info

Sebastian Ehlert