preprocess_key Function

private function preprocess_key(me, key) result(proc_key)

Preprocess key for saving in the hash table, as well as for insertion and lookup (handle trim and case-sensitivity).

Type Bound

json_hash_table

Arguments

Type IntentOptional Attributes Name
class(json_hash_table), intent(in) :: me
character(kind=CK, len=*), intent(in) :: key

the key to preprocess

Return Value character(kind=CK, len=:), allocatable

the preprocessed key to use for storage and comparison in the hash table.


Calls

proc~~preprocess_key~~CallsGraph proc~preprocess_key json_hash_table%preprocess_key proc~lowercase_string lowercase_string proc~preprocess_key->proc~lowercase_string

Called by

proc~~preprocess_key~~CalledByGraph proc~preprocess_key json_hash_table%preprocess_key proc~hash_table_get json_hash_table%hash_table_get proc~hash_table_get->proc~preprocess_key proc~hash_table_insert json_hash_table%hash_table_insert proc~hash_table_insert->proc~preprocess_key proc~hash_table_resize json_hash_table%hash_table_resize proc~hash_table_insert->proc~hash_table_resize proc~hash_table_create_from_value json_hash_table%hash_table_create_from_value proc~hash_table_create_from_value->proc~hash_table_insert proc~hash_table_resize->proc~hash_table_insert proc~json_file_get_object json_file%json_file_get_object proc~json_file_get_object->proc~hash_table_get 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->proc~hash_table_create_from_value 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

    function preprocess_key(me, key) result(proc_key)

    class(json_hash_table), intent(in) :: me
    character(kind=CK, len=*), intent(in) :: key !! the key to preprocess
    character(kind=CK, len=:), allocatable :: proc_key !! the preprocessed key to use for
                                                       !! storage and comparison in the hash table.

    ! if spaces are not significant, trim the key.
    if (me%trailing_spaces_significant) then
        proc_key = key
    else
        proc_key = trim(key)
    end if
    !if case-insensitive, lowercase the key.
    if (.not. me%case_sensitive_keys) proc_key = lowercase_string(proc_key)

    end function preprocess_key