tomlf_type_table Module

Implementation of the TOML table data type.

Every TOML document contains at least one (root) table which holds key-value pairs, arrays and other tables.



Interfaces

public interface initialized

Check whether data structure is initialized properly

  • private pure function table_initialized(self) result(okay)

    Check whether data structure is initialized properly

    Arguments

    Type IntentOptional Attributes Name
    type(toml_table), intent(in) :: self

    Instance of the TOML table

    Return Value logical

    Data structure is initialized

public interface new

Overloaded constructor for TOML values

  • public subroutine new_table(self)

    Constructor to create a new TOML table and allocate the internal storage

    Arguments

    Type IntentOptional Attributes Name
    type(toml_table), intent(out) :: self

    Instance of the TOML table

public interface toml_table

Create standard constructor

  • private function new_table_func() result(self)

    Default constructor for TOML table type

    Arguments

    None

    Return Value type(toml_table)

    Instance of the TOML table


Derived Types

type, public, extends(toml_value) ::  toml_table

TOML table

Components

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

Constructor

Create standard constructor

private function new_table_func ()

Default constructor for TOML table type

Type-Bound Procedures

procedure, public :: accept ../../

Accept a visitor to transverse the data structure

procedure, public :: delete ../../

Delete TOML value at a given key

procedure, public :: destroy ../../

Release allocation hold by TOML table

procedure, public :: get ../../

Get the TOML value associated with the respective key

procedure, public :: get_key ../../

Get escaped key to TOML value

procedure, public :: get_keys ../../

Get list of all keys in this table

procedure, public :: has_key ../../

Check if key is already present in this table instance

procedure, public :: match_key ../../

Compare raw key of TOML value to input key

procedure, public :: pop ../../

Remove TOML value at a given key and return it

procedure, public :: push_back ../../

Append value to table (checks automatically for key)


Subroutines

public subroutine new_table(self)

Constructor to create a new TOML table and allocate the internal storage

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(out) :: self

Instance of the TOML table