Functions to build TOML tables
The build module defines a high level interface to work with TOML tables and construct them in a convenient way.
The getter functions allow to both retrieve and set values, to easily support default values when reading from a TOML data structure. Using the getter function with a default value specified will request the respective setter function to add it to the table if it was not found in the first place.
This allows to build a TOML table using only the getter functions, which represents the finally read values for the applications.
Note that neither setter nor getter functions can overwrite existing TOML values for safety reasons, request the deletion on the respective key from the TOML table and than set it. The deletion of a subtable or array will recursively destroy the contained data nodes.
Getter functions to manipulate TOML tables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_table), | intent(out), | pointer | :: | ptr |
Pointer to child table |
|
logical, | intent(in), | optional | :: | requested |
Child value must be present |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_array), | intent(out), | pointer | :: | ptr |
Pointer to child array |
|
logical, | intent(in), | optional | :: | requested |
Child value must be present |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_keyval), | intent(out), | pointer | :: | ptr |
Pointer to child value |
|
logical, | intent(in), | optional | :: | requested |
Child value must be present |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as single precision float (might lose accuracy)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_sp), | intent(out) | :: | val |
Real value |
||
real(kind=tf_sp), | intent(in), | optional | :: | default |
Default real value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as double precision float
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_dp), | intent(out) | :: | val |
Real value |
||
real(kind=tf_dp), | intent(in), | optional | :: | default |
Default real value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as one byte integer (might loose precision)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i1), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i1), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as two byte integer (might loose precision)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i2), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i2), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as four byte integer (might loose precision)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i4), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i4), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as eight byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i8), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i8), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
logical, | intent(out) | :: | val |
Boolean value |
||
logical, | intent(in), | optional | :: | default |
Default boolean value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as datetime
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_datetime), | intent(out) | :: | val |
Datetime value |
||
type(toml_datetime), | intent(in), | optional | :: | default |
Default datetime value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as deferred-length character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
character(kind=tfc, len=:), | intent(out), | allocatable | :: | val |
String value |
|
character(kind=tfc, len=*), | intent(in), | optional | :: | default |
Default string value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_table), | intent(out), | pointer | :: | ptr |
Pointer to child table |
|
logical, | intent(in), | optional | :: | requested |
Child value must be present |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_array), | intent(out), | pointer | :: | ptr |
Pointer to child array |
|
logical, | intent(in), | optional | :: | requested |
Child value must be present |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_keyval), | intent(out), | pointer | :: | ptr |
Pointer to child value |
|
logical, | intent(in), | optional | :: | requested |
Child value must be present |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as single precision float (might lose accuracy)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_sp), | intent(out) | :: | val |
Real value |
||
real(kind=tf_sp), | intent(in), | optional | :: | default |
Default real value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as double precision float
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_dp), | intent(out) | :: | val |
Real value |
||
real(kind=tf_dp), | intent(in), | optional | :: | default |
Default real value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as one byte integer (might loose precision)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i1), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i1), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as two byte integer (might loose precision)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i2), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i2), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as four byte integer (might loose precision)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i4), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i4), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as eight byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i8), | intent(out) | :: | val |
Integer value |
||
integer(kind=tf_i8), | intent(in), | optional | :: | default |
Default integer value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
logical, | intent(out) | :: | val |
Boolean value |
||
logical, | intent(in), | optional | :: | default |
Default boolean value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as datetime
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_datetime), | intent(out) | :: | val |
Datetime value |
||
type(toml_datetime), | intent(in), | optional | :: | default |
Default datetime value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as deferred-length character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
character(kind=tfc, len=:), | intent(out), | allocatable | :: | val |
String value |
|
character(kind=tfc, len=*), | intent(in), | optional | :: | default |
Default string value |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Setter functions to manipulate TOML tables
Set TOML value to single precision float
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_sp), | intent(in) | :: | val |
Real value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to double precision float
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_dp), | intent(in) | :: | val |
Real value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to one byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i1), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to two byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i2), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to four byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i4), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to eight byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i8), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
logical, | intent(in) | :: | val |
Boolean value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to datetime
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_datetime), | intent(in) | :: | val |
Datetime value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to deferred-length character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key in this TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | val |
String value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to single precision float
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_sp), | intent(in) | :: | val |
Real value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to double precision float
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
real(kind=tf_dp), | intent(in) | :: | val |
Real value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to one byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i1), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to two byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i2), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to four byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i4), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to eight byte integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
integer(kind=tf_i8), | intent(in) | :: | val |
Integer value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
logical, | intent(in) | :: | val |
Boolean value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to datetime
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
type(toml_datetime), | intent(in) | :: | val |
Datetime value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Set TOML value to deferred-length character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key in this TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | val |
String value |
||
integer, | intent(out), | optional | :: | stat |
Status of operation |
|
integer, | intent(out), | optional | :: | origin |
Origin in the data structure |