tomlf_build_array Module

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.



Interfaces

public interface get_value

Getter functions to manipulate TOML arrays

  • private subroutine get_elem_table(array, pos, ptr, stat, origin)

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_array(array, pos, ptr, stat, origin)

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_keyval(array, pos, ptr, stat, origin)

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_string(array, pos, val, stat, origin)

    Retrieve TOML value as deferred-length character

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_float_sp(array, pos, val, stat, origin)

    Retrieve TOML value as single precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_float_dp(array, pos, val, stat, origin)

    Retrieve TOML value as double precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_int_i1(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_int_i2(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_int_i4(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_int_i8(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_bool(array, pos, val, stat, origin)

    Retrieve TOML value as boolean

    Arguments

    Type IntentOptional 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

  • private subroutine get_elem_value_datetime(array, pos, val, stat, origin)

    Retrieve TOML value as datetime

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_float_sp(array, val, stat, origin)

    Retrieve TOML value as single precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_float_dp(array, val, stat, origin)

    Retrieve TOML value as double precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_int_i1(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_int_i2(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_int_i4(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_int_i8(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_bool(array, val, stat, origin)

    Retrieve TOML value as boolean

    Arguments

    Type IntentOptional 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

  • private subroutine get_array_value_datetime(array, val, stat, origin)

    Retrieve TOML value as datetime

    Arguments

    Type IntentOptional 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

public interface set_value

Setter functions to manipulate TOML arrays

  • private subroutine set_elem_value_string(array, pos, val, stat, origin)

    Retrieve TOML value as deferred-length character

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_float_sp(array, pos, val, stat, origin)

    Retrieve TOML value as single precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_float_dp(array, pos, val, stat, origin)

    Retrieve TOML value as double precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_int_i1(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_int_i2(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_int_i4(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_int_i8(array, pos, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_bool(array, pos, val, stat, origin)

    Retrieve TOML value as boolean value

    Arguments

    Type IntentOptional 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

  • private subroutine set_elem_value_datetime(array, pos, val, stat, origin)

    Retrieve TOML value as datetime value

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_float_sp(array, val, stat, origin)

    Retrieve TOML value as single precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_float_dp(array, val, stat, origin)

    Retrieve TOML value as double precision floating point number

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_int_i1(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_int_i2(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_int_i4(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_int_i8(array, val, stat, origin)

    Retrieve TOML value as integer value

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_bool(array, val, stat, origin)

    Retrieve TOML value as boolean value

    Arguments

    Type IntentOptional 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

  • private subroutine set_array_value_datetime(array, val, stat, origin)

    Retrieve TOML value as datetime value

    Arguments

    Type IntentOptional 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