Returns true if the name strings name1
is equal to name2
, using
the specified settings for case sensitivity and trailing whitespace.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
character(kind=CK,len=*), | intent(in) | :: | name1 | the name to check |
||
character(kind=CK,len=*), | intent(in) | :: | name2 | the name to check |
true if the string are lexically equal
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
function name_strings_equal(json,name1,name2) result(is_equal)
implicit none
class(json_core),intent(inout) :: json
character(kind=CK,len=*),intent(in) :: name1 !! the name to check
character(kind=CK,len=*),intent(in) :: name2 !! the name to check
logical(LK) :: is_equal !! true if the string are
!! lexically equal
!must be the same length if we are treating
!trailing spaces as significant, so do a
!quick test of this first:
if (json%trailing_spaces_significant) then
is_equal = len(name1) == len(name2)
if (.not. is_equal) return
end if
if (json%case_sensitive_keys) then
is_equal = name1 == name2
else
is_equal = lowercase_string(name1) == lowercase_string(name2)
end if
end function name_strings_equal