json_string_utilities Module





































Interfaces

public interface to_unicode

  • private pure function to_uni(str)

    Arguments

    Type IntentOptional AttributesName
    character(kind=CDK,len=*), intent(in) :: str

    Return Value character(kind=CK,len=len(str))

  • private pure function to_uni_vec(str)

    Arguments

    Type IntentOptional AttributesName
    character(kind=CDK,len=*), intent(in), dimension(:):: str

    Return Value character(kind=CK,len=len(str)), dimension(size(str))


Functions

public pure function valid_json_hex(str) result(valid)

Arguments

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

the string to check.

Return Value logical(kind=LK)

is str a value 4-digit hex string

Description

Author
Jacob Williams

public pure elemental function lowercase_string(str) result(s_lower)

Arguments

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

input string

Return Value character(kind=CK,len=(len(str)))

lowercase version of the string

Description

Author
Jacob Williams

Subroutines

public pure subroutine integer_to_string(ival, int_fmt, str)

Arguments

Type IntentOptional AttributesName
integer(kind=IK), intent(in) :: ival

integer value.

character(kind=CDK,len=*), intent(in) :: int_fmt

format for integers

character(kind=CK,len=*), intent(out) :: str

ival converted to a string.

Description

Author
Jacob Williams

public subroutine real_to_string(rval, real_fmt, compact_real, str)

Arguments

Type IntentOptional AttributesName
real(kind=RK), intent(in) :: rval

real value.

character(kind=CDK,len=*), intent(in) :: real_fmt

format for real numbers

logical(kind=LK), intent(in) :: compact_real

compact the string so that it is displayed with fewer characters

character(kind=CK,len=*), intent(out) :: str

rval converted to a string.

Description

Author
Jacob Williams

public subroutine escape_string(str_in, str_out)

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=*), intent(in) :: str_in
character(kind=CK,len=:), intent(out), allocatable:: str_out

Description

Author
Jacob Williams

public subroutine unescape_string(str_in, str_out, error_message)

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=*), intent(in) :: str_in

string as stored in a json_value

character(kind=CK,len=:), intent(out), allocatable:: str_out

decoded string

character(kind=CK,len=:), intent(out), allocatable:: error_message

will be allocated if there was an error