tomlf_build_path Module

Support for retrieving and setting values using a key path.



Interfaces

public interface get_value

Getter functions to manipulate TOML tables

  • private subroutine get_path_table(table, path, ptr, requested, stat, origin)

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout), target :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    type(toml_table), intent(out), pointer :: ptr

    Pointer to child table

    logical, intent(in), optional :: requested

    Child value must be present

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_array(table, path, ptr, requested, stat, origin)

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    type(toml_array), intent(out), pointer :: ptr

    Pointer to child array

    logical, intent(in), optional :: requested

    Child value must be present

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_keyval(table, path, ptr, requested, stat, origin)

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    type(toml_keyval), intent(out), pointer :: ptr

    Pointer to child value

    logical, intent(in), optional :: requested

    Child value must be present

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_float_sp(table, path, val, default, stat, origin)

    Retrieve TOML value as single precision float (might lose accuracy)

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    real(kind=tf_sp), intent(out) :: val

    Real value

    real(kind=tf_sp), intent(in), optional :: default

    Default real value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_float_dp(table, path, val, default, stat, origin)

    Retrieve TOML value as double precision float

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    real(kind=tf_dp), intent(out) :: val

    Real value

    real(kind=tf_dp), intent(in), optional :: default

    Default real value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_integer_i1(table, path, val, default, stat, origin)

    Retrieve TOML value as one byte integer (might loose precision)

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    integer(kind=tf_i1), intent(out) :: val

    Integer value

    integer(kind=tf_i1), intent(in), optional :: default

    Default integer value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_integer_i2(table, path, val, default, stat, origin)

    Retrieve TOML value as two byte integer (might loose precision)

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    integer(kind=tf_i2), intent(out) :: val

    Integer value

    integer(kind=tf_i2), intent(in), optional :: default

    Default integer value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_integer_i4(table, path, val, default, stat, origin)

    Retrieve TOML value as four byte integer (might loose precision)

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    integer(kind=tf_i4), intent(out) :: val

    Integer value

    integer(kind=tf_i4), intent(in), optional :: default

    Default integer value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_integer_i8(table, path, val, default, stat, origin)

    Retrieve TOML value as eight byte integer

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    integer(kind=tf_i8), intent(out) :: val

    Integer value

    integer(kind=tf_i8), intent(in), optional :: default

    Default integer value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_bool(table, path, val, default, stat, origin)

    Retrieve TOML value as logical

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    logical, intent(out) :: val

    Boolean value

    logical, intent(in), optional :: default

    Default boolean value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_datetime(table, path, val, default, stat, origin)

    Retrieve TOML value as datetime

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    type(toml_datetime), intent(out) :: val

    Datetime value

    type(toml_datetime), intent(in), optional :: default

    Default datetime value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine get_path_value_string(table, path, val, default, stat, origin)

    Retrieve TOML value as deferred-length character

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    character(kind=tfc, len=:), intent(out), allocatable :: val

    String value

    character(kind=tfc, len=*), intent(in), optional :: default

    Default string 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 tables

  • private subroutine set_path_value_float_sp(table, path, val, stat, origin)

    Set TOML value to single precision float

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    real(kind=tf_sp), intent(in) :: val

    Real value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine set_path_value_float_dp(table, path, val, stat, origin)

    Set TOML value to double precision float

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    real(kind=tf_dp), intent(in) :: val

    Real value

    integer, intent(out), optional :: stat

    Status of operation

    integer, intent(out), optional :: origin

    Origin in the data structure

  • private subroutine set_path_value_integer_i1(table, path, val, stat, origin)

    Set TOML value to one byte integer

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    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_path_value_integer_i2(table, path, val, stat, origin)

    Set TOML value to two byte integer

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    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_path_value_integer_i4(table, path, val, stat, origin)

    Set TOML value to four byte integer

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    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_path_value_integer_i8(table, path, val, stat, origin)

    Set TOML value to eight byte integer

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    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_path_value_bool(table, path, val, stat, origin)

    Set TOML value to logical

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    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_path_value_datetime(table, path, val, stat, origin)

    Set TOML value to datetime

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    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_path_value_string(table, path, val, stat, origin)

    Set TOML value to deferred-length character

    Arguments

    Type IntentOptional Attributes Name
    class(toml_table), intent(inout) :: table

    Instance of the TOML table

    type(toml_path), intent(in) :: path

    Path in this TOML table

    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

public interface toml_path

Convenience constructors for building key paths from strings instead of keys

  • private pure function new_path2(key1, key2) result(path)

    Create a new path with two components

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key1

    First key to retrieve

    character(len=*), intent(in) :: key2

    Second key to retrieve

    Return Value type(toml_path)

    New path

  • private pure function new_path3(key1, key2, key3) result(path)

    Create a new path with three components

    Arguments

    Type IntentOptional Attributes Name
    character(kind=tfc, len=*), intent(in) :: key1

    First key to retrieve

    character(kind=tfc, len=*), intent(in) :: key2

    Second key to retrieve

    character(kind=tfc, len=*), intent(in) :: key3

    Third key to retrieve

    Return Value type(toml_path)

    New path

  • private pure function new_path4(key1, key2, key3, key4) result(path)

    Create a new path with three components

    Arguments

    Type IntentOptional Attributes Name
    character(kind=tfc, len=*), intent(in) :: key1

    First key to retrieve

    character(kind=tfc, len=*), intent(in) :: key2

    Second key to retrieve

    character(kind=tfc, len=*), intent(in) :: key3

    Third key to retrieve

    character(kind=tfc, len=*), intent(in) :: key4

    Forth key to retrieve

    Return Value type(toml_path)

    New path


Derived Types

type, public ::  toml_path

Wrapper for storing key paths

Components

Type Visibility Attributes Name Initial
type(toml_key), public, allocatable :: path(:)

Path components

Constructor

Convenience constructors for building key paths from strings instead of keys

private pure function new_path2 (key1, key2)

Create a new path with two components

private pure function new_path3 (key1, key2, key3)

Create a new path with three components

private pure function new_path4 (key1, key2, key3, key4)

Create a new path with three components