Collection of the central datatypes to define TOML data structures
All TOML data types should inherit from an abstract value allowing to generate a generic interface to deal with all more specialized TOML data types, while the abstract value is interesting for developing algorithms in TOML-Fortran, the user of TOML-Fortran will usually only care about TOML tables and possibly arrays.
The TOML types defined here should implement the TOML data structures (mostly) without taking the actual implementation of the data structures into account. This is done by providing a bare minimum interface using type bound procedures to minimize the interdependencies between the datatypes.
To make the data types extendable a visitor pattern allows access to the TOML data types and can be used to implement further algorithms.
Interface to build new arrays
Create a new TOML array inside an existing table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key for the new array |
||
type(toml_array), | intent(out), | pointer | :: | ptr |
Pointer to the newly created array |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Create a new TOML array inside an existing table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key for the new array |
||
type(toml_array), | intent(out), | pointer | :: | ptr |
Pointer to the newly created array |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Create a new TOML array inside an existing array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
type(toml_array), | intent(out), | pointer | :: | ptr |
Pointer to the newly created array |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Interface to build new key-value pairs
Create a new key-value pair inside an existing table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key for the new key-value pair |
||
type(toml_keyval), | intent(out), | pointer | :: | ptr |
Pointer to the newly created key-value pair |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Create a new key-value pair inside an existing table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key for the new key-value pair |
||
type(toml_keyval), | intent(out), | pointer | :: | ptr |
Pointer to the newly created key-value pair |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Create a new key-value pair inside an existing array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
type(toml_keyval), | intent(out), | pointer | :: | ptr |
Pointer to the newly created key-value pair |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Interface to build new tables
Create a new TOML table inside an existing table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
character(kind=tfc, len=*), | intent(in) | :: | key |
Key for the new table |
||
type(toml_table), | intent(out), | pointer | :: | ptr |
Pointer to the newly created table |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Create a new TOML table inside an existing table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_table), | intent(inout) | :: | table |
Instance of the TOML table |
||
type(toml_key), | intent(in) | :: | key |
Key for the new table |
||
type(toml_table), | intent(out), | pointer | :: | ptr |
Pointer to the newly created table |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Create a new TOML table inside an existing array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
type(toml_table), | intent(out), | pointer | :: | ptr |
Pointer to the newly created table |
|
integer, | intent(out), | optional | :: | stat |
Status of operation |
Cast an abstract TOML value to a TOML array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_value), | intent(in), | target | :: | ptr |
TOML value to be casted |
TOML array view, nullified if the value is not an array
Cast an abstract TOML value to a TOML key-value pair
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_value), | intent(in), | target | :: | ptr |
TOML value to be casted |
TOML key-value view, nullified if the value is not a table
Cast an abstract TOML value to a TOML table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_value), | intent(in), | target | :: | ptr |
TOML value to be casted |
TOML table view, nullified if the value is not a table
Determine if array contains only tables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_array), | intent(inout) | :: | array |
TOML value to visit |
Array contains only tables