TOML table
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | implicit | = | .false. |
Table was implictly created |
|
| logical, | public | :: | inline | = | .false. |
Is an inline table and is therefore non-extendable |
|
| character(kind=tfc, len=:), | public, | allocatable | :: | key |
Raw representation of the key to the TOML value |
||
| integer, | public | :: | origin | = | 0 |
Original source of the value |
Create standard constructor
Default constructor for TOML table type
Instance of the TOML table
Accept a visitor to transverse the data structure
Accept a visitor to transverse the data structure
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_value), | intent(inout) | :: | self |
Instance of the TOML value |
||
| class(toml_visitor), | intent(inout) | :: | visitor |
Visitor for this value |
Delete TOML value at a given key
Delete TOML value at a given key
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_table), | intent(inout) | :: | self |
Instance of the TOML table |
||
| character(kind=tfc, len=*), | intent(in) | :: | key |
Key to the TOML value |
Release allocation hold by TOML table
Deconstructor to cleanup allocations (optional)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_table), | intent(inout) | :: | self |
Instance of the TOML table |
Get the TOML value associated with the respective key
Get the TOML value associated with the respective key
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_table), | intent(inout) | :: | self |
Instance of the TOML table |
||
| character(kind=tfc, len=*), | intent(in) | :: | key |
Key to the TOML value |
||
| class(toml_value), | intent(out), | pointer | :: | ptr |
Pointer to the TOML value |
Get escaped key to TOML value
Get escaped key to TOML value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_value), | intent(in) | :: | self |
TOML value instance. |
||
| character(kind=tfc, len=:), | allocatable | :: | key |
Contains valid TOML key on exit |
Get list of all keys in this table
Get list of all keys in this table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_table), | intent(inout) | :: | self |
Instance of the TOML table |
||
| type(toml_key), | intent(out), | allocatable | :: | list(:) |
List of all keys |
Check if key is already present in this table instance
Check if a key is present in the table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_table), | intent(inout) | :: | self |
Instance of the TOML table |
||
| character(kind=tfc, len=*), | intent(in) | :: | key |
Key to the TOML value |
TOML value is present in table
Compare raw key of TOML value to input key
Compare raw key of TOML value to input key
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_value), | intent(in) | :: | self |
TOML value instance. |
||
| character(kind=tfc, len=*), | intent(in) | :: | key |
TOML raw key to compare to |
Remove TOML value at a given key and return it
Remove TOML value at a given key and return it
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_table), | intent(inout) | :: | self |
Instance of the TOML table |
||
| character(kind=tfc, len=*), | intent(in) | :: | key |
Key to the TOML value |
||
| class(toml_value), | intent(out), | allocatable | :: | val |
Removed TOML value to return |
Append value to table (checks automatically for key)
Push back a TOML value to the table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_table), | intent(inout) | :: | self |
Instance of the TOML table |
||
| class(toml_value), | intent(inout), | allocatable | :: | val |
TOML value to append to table |
|
| integer, | intent(out) | :: | stat |
Status of operation |
type, extends(toml_value) :: toml_table !> Table was implictly created logical :: implicit = .false. !> Is an inline table and is therefore non-extendable logical :: inline = .false. !> Storage unit for TOML values of this table class(toml_map_structure), allocatable, private :: map contains !> Get the TOML value associated with the respective key procedure :: get !> Get list of all keys in this table procedure :: get_keys !> Check if key is already present in this table instance procedure :: has_key !> Append value to table (checks automatically for key) procedure :: push_back !> Remove TOML value at a given key and return it procedure :: pop !> Delete TOML value at a given key procedure :: delete !> Release allocation hold by TOML table procedure :: destroy end type toml_table