encode_rfc6901 Function

public pure function encode_rfc6901(str) result(str_out)

Encode a string into the “JSON Pointer” RFC 6901 format.

It replaces ~ with ~0 and / with ~1.

Arguments

Type IntentOptional Attributes Name
character(kind=CK, len=*), intent(in) :: str

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


Calls

proc~~encode_rfc6901~~CallsGraph proc~encode_rfc6901 json_string_utilities::encode_rfc6901 proc~replace_string json_string_utilities::replace_string proc~encode_rfc6901->proc~replace_string

Called by

proc~~encode_rfc6901~~CalledByGraph proc~encode_rfc6901 json_string_utilities::encode_rfc6901 proc~json_get_path json_value_module::json_core%json_get_path proc~json_get_path->proc~encode_rfc6901 none~get_path json_value_module::json_core%get_path none~get_path->proc~json_get_path proc~wrap_json_get_path json_value_module::json_core%wrap_json_get_path none~get_path->proc~wrap_json_get_path proc~json_check_children_for_duplicate_keys json_value_module::json_core%json_check_children_for_duplicate_keys proc~json_check_children_for_duplicate_keys->none~get_path proc~wrap_json_get_path->none~get_path

Source Code

    pure function encode_rfc6901(str) result(str_out)

    implicit none

    character(kind=CK,len=*),intent(in) :: str
    character(kind=CK,len=:),allocatable :: str_out

    str_out = str

    call replace_string(str_out,tilde,tilde//CK_'0')
    call replace_string(str_out,slash,tilde//CK_'1')

    end function encode_rfc6901