toml_value Derived Type

type, public, abstract :: toml_value

Abstract base value for TOML data types


Components

Type Visibility Attributes Name Initial
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


Type-Bound Procedures

procedure, public :: accept

Accept a visitor to transverse the data structure

  • private recursive subroutine accept(self, visitor)

    Accept a visitor to transverse the data structure

    Arguments

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

    Instance of the TOML value

    class(toml_visitor), intent(inout) :: visitor

    Visitor for this value

procedure(destroy), public, deferred :: destroy

Release allocation hold by TOML value

  • subroutine destroy(self) Prototype

    Deconstructor to cleanup allocations (optional)

    Arguments

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

    Instance of the TOML value

procedure, public :: get_key

Get escaped key to TOML value

  • private subroutine get_key(self, key)

    Get escaped key to TOML value

    Arguments

    Type IntentOptional Attributes Name
    class(toml_value), intent(in) :: self

    TOML value instance.

    character(kind=tfc, len=:), allocatable :: key

    Contains valid TOML key on exit

procedure, public :: match_key

Compare raw key of TOML value to input key

  • private pure function match_key(self, key) result(match)

    Compare raw key of TOML value to input key

    Arguments

    Type IntentOptional Attributes Name
    class(toml_value), intent(in) :: self

    TOML value instance.

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

    TOML raw key to compare to

    Return Value logical

Source Code

   type, abstract :: toml_value

      !> Raw representation of the key to the TOML value
      character(kind=tfc, len=:), allocatable :: key

      !> Original source of the value
      integer :: origin = 0

   contains

      !> Accept a visitor to transverse the data structure
      procedure :: accept

      !> Get escaped key to TOML value
      procedure :: get_key

      !> Compare raw key of TOML value to input key
      procedure :: match_key

      !> Release allocation hold by TOML value
      procedure(destroy), deferred :: destroy

   end type toml_value