json_file_get_object Subroutine

private subroutine json_file_get_object(me, path, p, found)

Get a json_value pointer to an object from a JSON file.

If the hash table has been enabled, then it will use that to get the pointer. Note that this only will work for the top-level variables, since the hash table only stores those. Otherwise, it will fall back to the normal method of getting the pointer.

Type Bound

json_file

Arguments

Type IntentOptional Attributes Name
class(json_file), intent(inout) :: me
character(kind=CK, len=*), intent(in) :: path

the path to the variable

type(json_value), intent(out), pointer :: p

pointer to the variable

logical(kind=LK), intent(out), optional :: found

if it was really found


Calls

proc~~json_file_get_object~~CallsGraph proc~json_file_get_object json_file%json_file_get_object proc~hash_table_get json_hash_table%hash_table_get proc~json_file_get_object->proc~hash_table_get proc~hash_table_hash json_hash_table%hash_table_hash proc~hash_table_get->proc~hash_table_hash proc~keys_equal json_hash_table%keys_equal proc~hash_table_get->proc~keys_equal proc~preprocess_key json_hash_table%preprocess_key proc~hash_table_get->proc~preprocess_key proc~lowercase_string lowercase_string proc~preprocess_key->proc~lowercase_string

Called by

proc~~json_file_get_object~~CalledByGraph proc~json_file_get_object json_file%json_file_get_object none~get json_file%get none~get->proc~json_file_get_object proc~json_file_get_alloc_string_vec json_file%json_file_get_alloc_string_vec none~get->proc~json_file_get_alloc_string_vec proc~json_file_get_integer json_file%json_file_get_integer none~get->proc~json_file_get_integer proc~json_file_get_integer_vec json_file%json_file_get_integer_vec none~get->proc~json_file_get_integer_vec proc~json_file_get_logical json_file%json_file_get_logical none~get->proc~json_file_get_logical proc~json_file_get_logical_vec json_file%json_file_get_logical_vec none~get->proc~json_file_get_logical_vec proc~json_file_get_real json_file%json_file_get_real none~get->proc~json_file_get_real proc~json_file_get_real32 json_file%json_file_get_real32 none~get->proc~json_file_get_real32 proc~json_file_get_real32_vec json_file%json_file_get_real32_vec none~get->proc~json_file_get_real32_vec proc~json_file_get_real_vec json_file%json_file_get_real_vec none~get->proc~json_file_get_real_vec proc~json_file_get_string json_file%json_file_get_string none~get->proc~json_file_get_string proc~json_file_get_string_vec json_file%json_file_get_string_vec none~get->proc~json_file_get_string_vec proc~wrap_json_file_get_alloc_string_vec json_file%wrap_json_file_get_alloc_string_vec none~get->proc~wrap_json_file_get_alloc_string_vec proc~wrap_json_file_get_integer json_file%wrap_json_file_get_integer none~get->proc~wrap_json_file_get_integer proc~wrap_json_file_get_integer_vec json_file%wrap_json_file_get_integer_vec none~get->proc~wrap_json_file_get_integer_vec proc~wrap_json_file_get_logical json_file%wrap_json_file_get_logical none~get->proc~wrap_json_file_get_logical proc~wrap_json_file_get_logical_vec json_file%wrap_json_file_get_logical_vec none~get->proc~wrap_json_file_get_logical_vec proc~wrap_json_file_get_object json_file%wrap_json_file_get_object none~get->proc~wrap_json_file_get_object proc~wrap_json_file_get_real json_file%wrap_json_file_get_real none~get->proc~wrap_json_file_get_real proc~wrap_json_file_get_real32 json_file%wrap_json_file_get_real32 none~get->proc~wrap_json_file_get_real32 proc~wrap_json_file_get_real32_vec json_file%wrap_json_file_get_real32_vec none~get->proc~wrap_json_file_get_real32_vec proc~wrap_json_file_get_real_vec json_file%wrap_json_file_get_real_vec none~get->proc~wrap_json_file_get_real_vec proc~wrap_json_file_get_string json_file%wrap_json_file_get_string none~get->proc~wrap_json_file_get_string proc~wrap_json_file_get_string_vec json_file%wrap_json_file_get_string_vec none~get->proc~wrap_json_file_get_string_vec proc~initialize_hash json_file%initialize_hash proc~initialize_hash->none~get proc~json_file_get_alloc_string_vec->none~get proc~json_file_get_integer->none~get proc~json_file_get_integer_vec->none~get proc~json_file_get_logical->none~get proc~json_file_get_logical_vec->none~get proc~json_file_get_real->none~get proc~json_file_get_real32->none~get proc~json_file_get_real32_vec->none~get proc~json_file_get_real_vec->none~get proc~json_file_get_string->none~get proc~json_file_get_string_vec->none~get proc~wrap_json_file_get_alloc_string_vec->none~get proc~wrap_json_file_get_integer->none~get proc~wrap_json_file_get_integer_vec->none~get proc~wrap_json_file_get_logical->none~get proc~wrap_json_file_get_logical_vec->none~get proc~wrap_json_file_get_object->none~get proc~wrap_json_file_get_real->none~get proc~wrap_json_file_get_real32->none~get proc~wrap_json_file_get_real32_vec->none~get proc~wrap_json_file_get_real_vec->none~get proc~wrap_json_file_get_string->none~get proc~wrap_json_file_get_string_vec->none~get

Source Code

    subroutine json_file_get_object(me, path, p, found)

    implicit none

    class(json_file),intent(inout)       :: me
    character(kind=CK,len=*),intent(in)  :: path   !! the path to the variable
    type(json_value),pointer,intent(out) :: p      !! pointer to the variable
    logical(LK),intent(out),optional     :: found  !! if it was really found

    if (me%hash_enabled) then
        call me%hash%get(path, p, found)
        ! if p is associated, then we know it was found (see hash_table_get)
        if (associated(p)) return
    end if

    ! if not using the hash table, or the key was not found,
    ! fall back to the normal method:
    call me%core%get(me%p, path, p, found)

    end subroutine json_file_get_object