starts_with Function

public pure function starts_with(s, prefix) result(ok)

Check whether a string begins with a given prefix.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: s
character(len=*), intent(in) :: prefix

Return Value logical


Called by

proc~~starts_with~~CalledByGraph proc~starts_with starts_with proc~is_ignored_path is_ignored_path proc~is_ignored_path->proc~starts_with proc~is_in_dep_dirs is_in_dep_dirs proc~is_in_dep_dirs->proc~starts_with proc~vec_push_unique vec_push_unique proc~vec_push_unique->proc~is_ignored_path proc~vec_push_unique->proc~is_in_dep_dirs proc~gather_files_with_mask gather_files_with_mask proc~gather_files_with_mask->proc~vec_push_unique proc~push_file_with_mask push_file_with_mask proc~push_file_with_mask->proc~vec_push_unique proc~compute_watch_files_from_settings compute_watch_files_from_settings proc~compute_watch_files_from_settings->proc~gather_files_with_mask proc~compute_watch_files_from_settings->proc~push_file_with_mask proc~rebuild_watch_list rebuild_watch_list proc~rebuild_watch_list->proc~compute_watch_files_from_settings proc~handle_manifest_change handle_manifest_change proc~handle_manifest_change->proc~rebuild_watch_list proc~watcher_init watcher_t%watcher_init proc~watcher_init->proc~rebuild_watch_list proc~watcher_run watcher_t%watcher_run proc~watcher_run->proc~rebuild_watch_list proc~watcher_run->proc~handle_manifest_change

Source Code

   pure logical function starts_with(s, prefix) result(ok)
      character(len=*), intent(in) :: s, prefix
      integer :: n
      n = len_trim(prefix)
      if (n <= 0) then
         ok = .true.
      else if (len_trim(s) < n) then
         ok = .false.
      else
         ok = (s(1:n) == prefix(1:n))
      end if
   end function starts_with