toml_get_string Subroutine

private subroutine toml_get_string(table, key, v)

Read a TOML string value if present.

Arguments

Type IntentOptional Attributes Name
type(toml_table), intent(inout) :: table
character(len=*), intent(in) :: key
character(len=:), intent(inout), allocatable :: v

Calls

proc~~toml_get_string~~CallsGraph proc~toml_get_string toml_get_string get_value get_value proc~toml_get_string->get_value

Called by

proc~~toml_get_string~~CalledByGraph proc~toml_get_string toml_get_string proc~get_restart_defaults get_restart_defaults proc~get_restart_defaults->proc~toml_get_string proc~parse_restart_flags parse_restart_flags proc~parse_restart_flags->proc~get_restart_defaults proc~maybe_supervise maybe_supervise proc~maybe_supervise->proc~parse_restart_flags

Source Code

   subroutine toml_get_string(table, key, v)
      type(toml_table), intent(inout) :: table
      character(len=*), intent(in) :: key
      character(len=:), allocatable, intent(inout) :: v
      character(len=:), allocatable :: tmp
      integer :: stat

      call get_value(table, key, tmp, stat=stat)
      if (stat == toml_stat%success) then
         if (allocated(tmp)) then
            v = tmp
         else
            v = ""
         end if
      end if
   end subroutine toml_get_string