ends_with Function

private pure function ends_with(s, suffix) result(ok)

Arguments

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

Return Value logical


Called by

proc~~ends_with~~CalledByGraph proc~ends_with ends_with proc~contains_path_fragment contains_path_fragment proc~contains_path_fragment->proc~ends_with proc~is_ignored_path is_ignored_path proc~is_ignored_path->proc~contains_path_fragment proc~vec_push_unique vec_push_unique proc~vec_push_unique->proc~is_ignored_path 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 ends_with(s, suffix) result(ok)
      character(len=*), intent(in) :: s, suffix
      integer :: ns, n
      ns = len_trim(suffix)
      n = len_trim(s)
      if (ns <= 0) then
         ok = .true.
      else if (n < ns) then
         ok = .false.
      else
         ok = (s(n-ns+1:n) == suffix(1:ns))
      end if
   end function ends_with