toml_get_list_strings Subroutine

private subroutine toml_get_list_strings(table, key, list)

Read a TOML string list into an allocatable string_t array.

Arguments

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

Calls

proc~~toml_get_list_strings~~CallsGraph proc~toml_get_list_strings toml_get_list_strings get_list get_list proc~toml_get_list_strings->get_list

Called by

proc~~toml_get_list_strings~~CalledByGraph proc~toml_get_list_strings toml_get_list_strings proc~apply_watch_from_manifest apply_watch_from_manifest proc~apply_watch_from_manifest->proc~toml_get_list_strings proc~parse_cli parse_cli proc~parse_cli->proc~apply_watch_from_manifest proc~parse_cli_config parse_cli_config proc~parse_cli_config->proc~parse_cli

Source Code

   subroutine toml_get_list_strings(table, key, list)
      type(toml_table), intent(inout) :: table
      character(len=*), intent(in) :: key
      type(string_t), allocatable, intent(inout) :: list(:)
      type(error_t), allocatable :: err
      type(string_t), allocatable :: tmp(:)

      if (.not. allocated(list)) allocate(list(0))

      call get_list(table, key, tmp, err)
      if (allocated(err)) then
         if (allocated(tmp)) deallocate(tmp)
         return
      end if
      if (.not. allocated(tmp)) return

      call move_alloc(tmp, list)
   end subroutine toml_get_list_strings