name_equal Function

private function name_equal(json, p, name) result(is_equal)

Returns true if name is equal to p%name, using the specified settings for case sensitivity and trailing whitespace.

History

Arguments

Type IntentOptional AttributesName
class(json_core), intent(inout) :: json
type(json_value), intent(in) :: p

the json object

character(kind=CK,len=*), intent(in) :: name

the name to check for

Return Value logical(kind=LK)

true if the string are lexically equal


Contents

Source Code


Source Code

    function name_equal(json,p,name) result(is_equal)

    implicit none

    class(json_core),intent(inout)      :: json
    type(json_value),intent(in)         :: p        !! the json object
    character(kind=CK,len=*),intent(in) :: name     !! the name to check for
    logical(LK)                         :: is_equal !! true if the string are
                                                    !! lexically equal

    if (allocated(p%name)) then
        ! call the low-level routines for the name strings:
        is_equal = json%name_strings_equal(p%name,name)
    else
        is_equal = name == CK_'' ! check a blank name
    end if

    end function name_equal