Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string1 | |||
character(len=*), | intent(in) | :: | string2 | |||
character(len=*), | intent(in) | :: | minusStringList(:) | |||
character(len=*), | intent(in) | :: | plusStringList(:) | |||
type(ESMF_KeywordEnforcer), | optional | :: | keywordEnforcer | |||
integer, | intent(out), | optional | :: | rc |
function ESMF_UtilStringDiffMatch(string1, string2, minusStringList, & plusStringList, keywordEnforcer, rc) ! !RETURN VALUE: logical :: ESMF_UtilStringDiffMatch ! !ARGUMENTS: character(len=*), intent(in) :: string1 character(len=*), intent(in) :: string2 character(len=*), intent(in) :: minusStringList(:) character(len=*), intent(in) :: plusStringList(:) type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below integer, intent(out), optional :: rc ! !DESCRIPTION: ! Match the list of differences between {\tt string1} and {\tt string2} ! against {\tt plus} and {\tt minus} string pairs. ! The generated differences are based on Myers diff algorithm implementation ! provided by \url{https://github.com/gritzko/myers-diff}. ! ! The arguments are: ! \begin{description} ! \item[string1] ! First string in the difference. ! \item[string2] ! Second string in the difference. ! \item[minusStringList] ! List of strings that are allowed to show up as "minus" in the difference. ! \item[plusStringList] ! List of strings that are allowed to show up as "plus" in the difference. ! \item[{[rc]}] ! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors. ! \end{description} ! !EOPI !----------------------------------------------------------------------------- ! local variables integer :: localrc integer :: matchCount type(ESMF_Logical) :: tf if (present(rc)) rc = ESMF_SUCCESS ESMF_UtilStringDiffMatch = .false. ! default return value matchCount = size(minusStringList) if (size(plusStringList) /= matchCount) then call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Number of strings in minus/plus string lists must match!`", & line=__LINE__, & file=ESMF_FILENAME, & rcToReturn=rc) return ! bail out endif call c_ESMC_StringDiffMatch(string1, string2, minusStringList, & plusStringList, matchCount, tf, localrc) if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, & ESMF_CONTEXT, rcToReturn=rc)) return ESMF_UtilStringDiffMatch = (tf == ESMF_TRUE) end function ESMF_UtilStringDiffMatch