Functions to build TOML arrays.
This build module defines a high level interface to work with TOML arrays and construct them in a convenient way.
The access to the array elements happens by position in the array, the indexing is one based, following the language convention of Fortran. All functions will only allow access of elements within the bounds of the array, specifying indices out-of-bounds should be save, as it only sets the status of operation. The getter functions allow access to other tables and arrays as well as convenient wrappers to retrieve value data
The setter functions are somewhat weaker compared to the setter functions available for TOML tables. To limit the potential havoc this routines can cause they can only access the array within its bounds. Setting a value to another value will overwrite it, while setting a value to a table or an array will fail, for safety reasons.
To (re)build an array appending to it is the best choice, tables and arrays
should always be create by using the corresponding add_table and add_array
function. While this can become cumbersome for values, the setter routines
allow out-of-bound access to for the next element in an array and will indeed
just append a new value to it.
Getter functions to manipulate TOML arrays
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| type(toml_table), | intent(out), | pointer | :: | ptr |
Pointer to child table |
|
| 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_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| type(toml_array), | intent(out), | pointer | :: | ptr |
Pointer to child array |
|
| 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_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| type(toml_keyval), | intent(out), | pointer | :: | ptr |
Pointer to child 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_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| character(kind=tfc, len=:), | intent(out), | allocatable | :: | val |
String value |
|
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as single precision floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| real(kind=tf_sp), | intent(out) | :: | val |
Floating point 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 floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| real(kind=tf_dp), | intent(out) | :: | val |
Floating point value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| integer(kind=tf_i1), | intent(out) | :: | val |
Integer value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| integer(kind=tf_i2), | intent(out) | :: | val |
Integer value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| integer(kind=tf_i4), | intent(out) | :: | val |
Integer value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| integer(kind=tf_i8), | intent(out) | :: | val |
Integer value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as boolean
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| logical, | intent(out) | :: | val |
Integer 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_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| type(toml_datetime), | intent(out) | :: | val |
Integer value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as single precision floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| real(kind=tf_sp), | intent(out), | allocatable | :: | val(:) |
Floating point 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 floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| real(kind=tf_dp), | intent(out), | allocatable | :: | val(:) |
Floating point value |
|
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer(kind=tf_i1), | intent(out), | allocatable | :: | val(:) |
Integer value |
|
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer(kind=tf_i2), | intent(out), | allocatable | :: | val(:) |
Integer value |
|
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer(kind=tf_i4), | intent(out), | allocatable | :: | val(:) |
Integer value |
|
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer(kind=tf_i8), | intent(out), | allocatable | :: | val(:) |
Integer value |
|
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as boolean
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| logical, | intent(out), | allocatable | :: | val(:) |
Integer 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_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| type(toml_datetime), | intent(out), | allocatable | :: | val(:) |
Integer value |
|
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Setter functions to manipulate TOML arrays
Retrieve TOML value as deferred-length character
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| 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 |
Retrieve TOML value as single precision floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| real(kind=tf_sp), | intent(in) | :: | val |
Floating point 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 floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| real(kind=tf_dp), | intent(in) | :: | val |
Floating point value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| 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 |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| 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 |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| 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 |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| 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 |
Retrieve TOML value as boolean value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| logical, | intent(in) | :: | val |
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 value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| integer, | intent(in) | :: | pos |
Position in the array |
||
| 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 |
Retrieve TOML value as single precision floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| real(kind=tf_sp), | intent(in) | :: | val(:) |
Floating point 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 floating point number
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| real(kind=tf_dp), | intent(in) | :: | val(:) |
Floating point value |
||
| integer, | intent(out), | optional | :: | stat |
Status of operation |
|
| integer, | intent(out), | optional | :: | origin |
Origin in the data structure |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| 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 |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| 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 |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| 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 |
Retrieve TOML value as integer value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| 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 |
Retrieve TOML value as boolean value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| logical, | intent(in) | :: | val(:) |
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 value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(toml_array), | intent(inout) | :: | array |
Instance of the TOML array |
||
| 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 |