cast_to_keyval Function

public function cast_to_keyval(ptr) result(kval)

Cast an abstract TOML value to a TOML key-value pair

Arguments

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

TOML value to be casted

Return Value type(toml_keyval), pointer

TOML key-value view, nullified if the value is not a table


Source Code

function cast_to_keyval(ptr) result(kval)
   !> TOML value to be casted
   class(toml_value), intent(in), target :: ptr
   !> TOML key-value view, nullified if the value is not a table
   type(toml_keyval), pointer :: kval

   nullify(kval)
   select type(ptr)
   type is(toml_keyval)
      kval => ptr
   end select
end function cast_to_keyval