toml_map_structure Derived Type

type, public, abstract :: toml_map_structure

Abstract data structure


Type-Bound Procedures

procedure(delete), public, deferred :: delete

Delete TOML value at a given key

  • subroutine delete(self, key) Prototype

    Delete TOML value at a given key

    Arguments

    Type IntentOptional Attributes Name
    class(toml_map_structure), intent(inout), target :: self

    Instance of the structure

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

    Key to the TOML value

procedure(destroy), public, deferred :: destroy

Destroy the data structure

  • subroutine destroy(self) Prototype

    Deconstructor for data structure

    Arguments

    Type IntentOptional Attributes Name
    class(toml_map_structure), intent(inout), target :: self

    Instance of the structure

procedure(get), public, deferred :: get

Get TOML value at a given key

  • subroutine get(self, key, ptr) Prototype

    Get TOML value at a given key

    Arguments

    Type IntentOptional Attributes Name
    class(toml_map_structure), intent(inout), target :: self

    Instance of the structure

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

    Key to the TOML value

    class(toml_value), intent(out), pointer :: ptr

    Pointer to the stored value at given key

procedure(get_keys), public, deferred :: get_keys

Get list of all keys in the structure

  • subroutine get_keys(self, list) Prototype

    Get list of all keys in the structure

    Arguments

    Type IntentOptional Attributes Name
    class(toml_map_structure), intent(inout), target :: self

    Instance of the structure

    type(toml_key), intent(out), allocatable :: list(:)

    List of all keys

procedure(pop), public, deferred :: pop

Remove TOML value at a given key and return it

  • subroutine pop(self, key, val) Prototype

    Remove TOML value at a given key and return it

    Arguments

    Type IntentOptional Attributes Name
    class(toml_map_structure), intent(inout), target :: self

    Instance of the structure

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

    Key to the TOML value

    class(toml_value), intent(out), allocatable :: val

    Removed TOML value

procedure(push_back), public, deferred :: push_back

Push back a TOML value to the structure

  • subroutine push_back(self, val) Prototype

    Push back a TOML value to the structure

    Arguments

    Type IntentOptional Attributes Name
    class(toml_map_structure), intent(inout), target :: self

    Instance of the structure

    class(toml_value), intent(inout), allocatable :: val

    TOML value to be stored

Source Code

   type, abstract :: toml_map_structure
   contains

      !> Get TOML value at a given key
      procedure(get), deferred :: get

      !> Push back a TOML value to the structure
      procedure(push_back), deferred :: push_back

      !> Get list of all keys in the structure
      procedure(get_keys), deferred :: get_keys

      !> Remove TOML value at a given key and return it
      procedure(pop), deferred :: pop

      !> Delete TOML value at a given key
      procedure(delete), deferred :: delete

      !> Destroy the data structure
      procedure(destroy), deferred :: destroy

   end type toml_map_structure