TOML array data type
A toml_array represents a TOML array, which is an ordered sequence of values. TOML arrays can contain values of any type, including nested arrays and tables (arrays of tables).
Use get_value from the build module to retrieve array elements by index, or the type-bound procedures for direct access. The intrinsic len function is overloaded to return the number of elements.
Check whether data structure is initialized properly
Check whether data structure is initialized properly
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(toml_array), | intent(in) | :: | self |
Instance of the TOML array |
Data structure is initialized
Overload len function
Get number of TOML values in the array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(in) | :: | self |
Instance of the TOML array |
Current length of the array
Overloaded constructor for TOML values
Constructor to create a new TOML array and allocate the internal storage
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(toml_array), | intent(out) | :: | self |
Instance of the TOML array |
Create standard constructor
Default constructor for TOML array type
Instance of the TOML array
TOML array
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | inline | = | .true. |
Is an inline array rather than an array of tables |
|
| 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
| private function new_array_func () | Default constructor for TOML array type |
| procedure, public :: accept | Accept a visitor to transverse the data structure |
| procedure, public :: destroy | Release allocation hold by TOML array |
| procedure, public :: get | Get the TOML value at a given index |
| procedure, public :: get_key | Get escaped key to TOML value |
| procedure, public :: match_key | Compare raw key of TOML value to input key |
| procedure, public :: pop | Remove the last element from the array |
| procedure, public :: push_back | Append value to array |
| procedure, public :: shift | Remove the first element from the array |
Constructor to create a new TOML array and allocate the internal storage
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(toml_array), | intent(out) | :: | self |
Instance of the TOML array |