Preprocess key for saving in the hash table, as well as for insertion and lookup (handle trim and case-sensitivity).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(json_hash_table), | intent(in) | :: | me | |||
| character(kind=CK, len=*), | intent(in) | :: | key |
the key to preprocess |
the preprocessed key to use for storage and comparison in the hash table.
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