json_value_module Module


File encoding preprocessor macro.



This C preprocessor macro will take a procedure name as an input, and output either that same procedure name if the code is compiled without USE_UCS4 being defined or it will expand the procedure name to the original procedure name, followed by a comma and then the original procedure name with 'wrap_' prepended to it. This is suitable for creating overloaded interfaces that will accept UCS4 character actual arguments as well as DEFAULT/ASCII character arguments, based on whether or not ISO 10646 is supported and requested.



























































































































































































































































































Variables

TypeVisibility AttributesNameInitial
integer(kind=IK), public, parameter:: json_unknown =0

Unknown JSON data type (see [[json_file_variable_info]] and [[json_info]])

integer(kind=IK), public, parameter:: json_null =1

Null JSON data type (see [[json_file_variable_info]] and [[json_info]])

integer(kind=IK), public, parameter:: json_object =2

Object JSON data type (see [[json_file_variable_info]] and [[json_info]])

integer(kind=IK), public, parameter:: json_array =3

Array JSON data type (see [[json_file_variable_info]] and [[json_info]])

integer(kind=IK), public, parameter:: json_logical =4

Logical JSON data type (see [[json_file_variable_info]] and [[json_info]])

integer(kind=IK), public, parameter:: json_integer =5

Integer JSON data type (see [[json_file_variable_info]] and [[json_info]])

integer(kind=IK), public, parameter:: json_double =6

Double JSON data type (see [[json_file_variable_info]] and [[json_info]])

integer(kind=IK), public, parameter:: json_string =7

String JSON data type




Interfaces

public interface json_core

  • private function initialize_json_core(verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys) result(json_core_object)

    Arguments

    Type IntentOptional AttributesName
    logical(kind=LK), intent(in), optional :: verbose

    mainly useful for debugging (default is false)

    logical(kind=LK), intent(in), optional :: compact_reals

    to compact the real number strings for output (default is true)

    logical(kind=LK), intent(in), optional :: print_signs

    always print numeric sign (default is false)

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

    Real number format: 'E' [default], '*', 'G', 'EN', or 'ES'

    integer(kind=IK), intent(in), optional :: spaces_per_tab

    number of spaces per tab for indenting (default is 2)

    logical(kind=LK), intent(in), optional :: strict_type_checking

    if true, no integer, double, or logical type conversions are done for the get routines (default is false)

    logical(kind=LK), intent(in), optional :: trailing_spaces_significant

    for name and path comparisons, is trailing space to be considered significant.

    logical(kind=LK), intent(in), optional :: case_sensitive_keys

    for name and path comparisons, are they case sensitive.

    Return Value type(json_core)


Derived Types

type, public, sequence :: json_value

type, public :: json_core

Constructor

private function initialize_json_core(verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys)

Type-Bound Procedures

generic, public :: get_child => json_value_get_by_index, json_value_get_child, json_value_get_by_name_chars
generic, public :: add => json_value_add_member, json_value_add_integer, json_value_add_integer_vec, json_value_add_double, json_value_add_double_vec, json_value_add_logical, json_value_add_logical_vec, json_value_add_string, json_value_add_string_vec
generic, public :: update => json_update_logical, json_update_double, json_update_integer, json_update_string
generic, public :: get => json_get_by_path, json_get_integer, json_get_integer_with_path, json_get_integer_vec, json_get_integer_vec_with_path, json_get_double, json_get_double_with_path, json_get_double_vec, json_get_double_vec_with_path, json_get_logical, json_get_logical_with_path, json_get_logical_vec, json_get_logical_vec_with_path, json_get_string, json_get_string_with_path, json_get_string_vec, json_get_string_vec_with_path, json_get_array, json_get_array_with_path
procedure, public :: print_to_string => json_value_to_string

Print the json_value structure to an allocatable string

generic, public :: print => json_print_1, json_print_2
generic, public :: destroy => json_value_destroy, destroy_json_core
generic, public :: remove_if_present => json_value_remove_if_present
generic, public :: create_double => json_value_create_double
generic, public :: create_array => json_value_create_array
generic, public :: create_object => json_value_create_object
generic, public :: create_null => json_value_create_null
generic, public :: create_string => json_value_create_string
generic, public :: create_integer => json_value_create_integer
generic, public :: create_logical => json_value_create_logical
generic, public :: parse => json_parse_file, json_parse_string
generic, public :: throw_exception => json_throw_exception
generic, public :: rename => json_value_rename
procedure, public :: remove => json_value_remove

Remove a json_value from a linked-list structure.

procedure, public :: check_for_errors => json_check_for_errors

check for error and get error message

procedure, public :: clear_exceptions => json_clear_exceptions

clear exceptions

procedure, public :: count => json_count

count the number of children

procedure, public :: clone => json_clone

clone a JSON structure (deep copy)

procedure, public :: failed => json_failed

check for error

procedure, public :: get_parent => json_get_parent

get pointer to json_value parent

procedure, public :: get_next => json_get_next

get pointer to json_value next

procedure, public :: get_previous => json_get_previous

get pointer to json_value previous

procedure, public :: get_tail => json_get_tail

get pointer to json_value tail

procedure, public :: info => json_info

get info about a json_value

procedure, public :: initialize => json_initialize

to initialize some parsing parameters

procedure, public :: traverse => json_traverse

to traverse all elements of a JSON structure

procedure, public :: print_error_message => json_print_error_message

simply routine to print error messages

procedure, public :: swap => json_value_swap

Swap two json_value pointers in a structure (or two different structures).

procedure, public :: is_child_of => json_value_is_child_of

Check if a json_value is a child of another.

procedure, public :: validate => json_value_validate

Check that a json_value linked list is valid (i.e., is properly constructed). This may be useful if it has been constructed externally.