json_string_utilities Module

module~~json_string_utilities~~UsesGraph module~json_string_utilities json_string_utilities module~json_kinds json_kinds module~json_kinds->module~json_string_utilities module~json_parameters json_parameters module~json_kinds->module~json_parameters module~json_parameters->module~json_string_utilities iso_fortran_env iso_fortran_env iso_fortran_env->module~json_kinds
Help

JSON-Fortran support module for string manipulation.

License

  • JSON-Fortran is released under a BSD-style license. See the LICENSE file for details.

Used By

module~~json_string_utilities~~UsedByGraph module~json_string_utilities json_string_utilities module~json_file_module json_file_module module~json_string_utilities->module~json_file_module module~json_value_module json_value_module module~json_string_utilities->module~json_value_module module~json_module json_module module~json_file_module->module~json_module module~json_value_module->module~json_file_module module~json_value_module->module~json_module module~jf_test_1_mod jf_test_1_mod module~json_module->module~jf_test_1_mod module~jf_test_15_mod jf_test_15_mod module~json_module->module~jf_test_15_mod module~jf_test_9_mod jf_test_9_mod module~json_module->module~jf_test_9_mod module~jf_test_17_mod jf_test_17_mod module~json_module->module~jf_test_17_mod module~jf_test_7_mod jf_test_7_mod module~json_module->module~jf_test_7_mod module~jf_test_13_mod jf_test_13_mod module~json_module->module~jf_test_13_mod module~jf_test_14_mod jf_test_14_mod module~json_module->module~jf_test_14_mod module~jf_test_4_mod jf_test_4_mod module~json_module->module~jf_test_4_mod module~jf_test_18_mod jf_test_18_mod module~json_module->module~jf_test_18_mod module~jf_test_3_mod jf_test_3_mod module~json_module->module~jf_test_3_mod module~jf_test_11_mod jf_test_11_mod module~json_module->module~jf_test_11_mod module~jf_test_16_mod jf_test_16_mod module~json_module->module~jf_test_16_mod module~jf_test_8_mod jf_test_8_mod module~json_module->module~jf_test_8_mod module~jf_test_19_mod jf_test_19_mod module~json_module->module~jf_test_19_mod module~jf_test_6_mod jf_test_6_mod module~json_module->module~jf_test_6_mod module~jf_test_10_mod jf_test_10_mod module~json_module->module~jf_test_10_mod module~jf_test_12_mod jf_test_12_mod module~json_module->module~jf_test_12_mod module~jf_test_5_mod jf_test_5_mod module~json_module->module~jf_test_5_mod module~jf_test_2_mod jf_test_2_mod module~json_module->module~jf_test_2_mod module~jf_test_20_mod jf_test_20_mod module~json_module->module~jf_test_20_mod program~jf_test_1 jf_test_1 module~jf_test_1_mod->program~jf_test_1 program~jf_test_15 jf_test_15 module~jf_test_15_mod->program~jf_test_15 program~jf_test_9 jf_test_9 module~jf_test_9_mod->program~jf_test_9 program~jf_test_17 jf_test_17 module~jf_test_17_mod->program~jf_test_17 program~jf_test_7 jf_test_7 module~jf_test_7_mod->program~jf_test_7 program~jf_test_13 jf_test_13 module~jf_test_13_mod->program~jf_test_13 program~jf_test_14 jf_test_14 module~jf_test_14_mod->program~jf_test_14 program~jf_test_4 jf_test_4 module~jf_test_4_mod->program~jf_test_4 program~jf_test_18 jf_test_18 module~jf_test_18_mod->program~jf_test_18 program~jf_test_3 jf_test_3 module~jf_test_3_mod->program~jf_test_3 program~jf_test_11 jf_test_11 module~jf_test_11_mod->program~jf_test_11 program~jf_test_16 jf_test_16 module~jf_test_16_mod->program~jf_test_16 program~jf_test_8 jf_test_8 module~jf_test_8_mod->program~jf_test_8 program~jf_test_19 jf_test_19 module~jf_test_19_mod->program~jf_test_19 program~jf_test_6 jf_test_6 module~jf_test_6_mod->program~jf_test_6 program~jf_test_10 jf_test_10 module~jf_test_10_mod->program~jf_test_10 program~jf_test_12 jf_test_12 module~jf_test_12_mod->program~jf_test_12 program~jf_test_5 jf_test_5 module~jf_test_5_mod->program~jf_test_5 program~jf_test_2 jf_test_2 module~jf_test_2_mod->program~jf_test_2 program~jf_test_20 jf_test_20 module~jf_test_20_mod->program~jf_test_20
Help


Interfaces

public interface to_unicode

Convert a 'DEFAULT' kind character input to 'ISO_10646' kind and return it

  • private pure function to_uni(str)

    Author
    Izaak Beekman

    Convert string to unicode (CDK to CK).

    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)

    Author
    Izaak Beekman

    Convert array of strings to unicode (CDK to CK).

    Arguments

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

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


Functions

private pure elemental function default_comp_ucs4(def_str, ucs4_str) result(res)

Author
Izaak Beekman

CDK==CK operator.

Arguments

Type IntentOptional AttributesName
character(kind=CDK,len=*), intent(in) :: def_str
character(kind=CK,len=*), intent(in) :: ucs4_str

Return Value logical(kind=LK)

private pure function default_join_ucs4(def_str, ucs4_str) result(res)

Author
Izaak Beekman

CDK//CK operator.

Arguments

Type IntentOptional AttributesName
character(kind=CDK,len=*), intent(in) :: def_str
character(kind=CK,len=*), intent(in) :: ucs4_str

Return Value character(kind=CK,len=(len(def_str)+len(ucs4_str)))

private pure elemental function default_neq_ucs4(def_str, ucs4_str) result(res)

Author
Jacob Williams

CDK/=CK operator.

Arguments

Type IntentOptional AttributesName
character(kind=CDK,len=*), intent(in) :: def_str
character(kind=CK,len=*), intent(in) :: ucs4_str

Return Value logical(kind=LK)

private pure elemental function lowercase_character(c) result(c_lower)

Author
Jacob Williams

Return the lowercase version of the CK character.

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=1), intent(in) :: c

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

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

Author
Jacob Williams

Returns lowercase version of the CK string.

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

private pure function to_uni(str)

Author
Izaak Beekman

Convert string to unicode (CDK to CK).

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)

Author
Izaak Beekman

Convert array of strings to unicode (CDK to CK).

Arguments

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

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

private pure elemental function ucs4_comp_default(ucs4_str, def_str) result(res)

Author
Izaak Beekman

CK==CDK operator.

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=*), intent(in) :: ucs4_str
character(kind=CDK,len=*), intent(in) :: def_str

Return Value logical(kind=LK)

private pure function ucs4_join_default(ucs4_str, def_str) result(res)

Author
Izaak Beekman

CK//CDK operator.

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=*), intent(in) :: ucs4_str
character(kind=CDK,len=*), intent(in) :: def_str

Return Value character(kind=CK,len=(len(ucs4_str)+len(def_str)))

private pure elemental function ucs4_neq_default(ucs4_str, def_str) result(res)

Author
Jacob Williams

CK/=CDK operator.

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=*), intent(in) :: ucs4_str
character(kind=CDK,len=*), intent(in) :: def_str

Return Value logical(kind=LK)

public pure function valid_json_hex(str) result(valid)

Author
Jacob Williams
Date
6/14/2014

Returns true if the string is a valid 4-digit hex string.

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


Subroutines

private subroutine compact_real_string(str)

Author
Izaak Beekman
Date
02/24/2015

Compact a string representing a real number, so that the same value is displayed with fewer characters.

Arguments

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

string representation of a real number.

public subroutine escape_string(str_in, str_out)

Author
Jacob Williams
Date
1/21/2014

Add the escape characters to a string for adding to JSON.

Arguments

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

public pure subroutine integer_to_string(ival, int_fmt, str)

Author
Jacob Williams
Date
12/4/2013

Convert an integer to a string.

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.

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

Author
Jacob Williams
Date
12/4/2013

Convert a real value to a string.

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.

public subroutine unescape_string(str_in, str_out, error_message)

Remove the escape characters from a JSON string and return it.

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