json_core Derived Type

type, public :: json_core

Constructor

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)


Type-Bound Procedures

generic, public :: get_child => json_value_get_by_index, json_value_get_child, json_value_get_by_name_chars

  • private subroutine json_value_get_by_index(json, p, idx, child)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p

    object or array JSON data

    integer(kind=IK), intent(in) :: idx

    index of the child

    type(json_value), , pointer:: child

    pointer to the child

  • private subroutine json_value_get_child(json, p, child)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p

    object or array JSON data

    type(json_value), , pointer:: child

    pointer to the child

  • private subroutine json_value_get_by_name_chars(json, p, name, child)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    the name of a child of p

    type(json_value), , pointer:: child

    pointer to the child

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

  • private subroutine json_value_add_member(json, p, member)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    type(json_value), , pointer:: member

    the child member to add

  • private subroutine json_value_add_integer(json, p, name, val)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name
    integer(kind=IK), intent(in) :: val
  • private subroutine json_value_add_integer_vec(json, p, name, val)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    name of the variable

    integer(kind=IK), intent(in), dimension(:):: val

    value

  • private subroutine json_value_add_double(json, p, name, val)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    variable name

    real(kind=RK), intent(in) :: val

    real value

  • private subroutine json_value_add_double_vec(json, p, name, val)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name
    real(kind=RK), intent(in), dimension(:):: val
  • private subroutine json_value_add_logical(json, p, name, val)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    name of the variable

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

    value

  • private subroutine json_value_add_logical_vec(json, p, name, val)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    name of the vector

    logical(kind=LK), intent(in), dimension(:):: val

    value

  • private subroutine json_value_add_string(json, p, name, val)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    name of the variable

    character(kind=CK,len=*), intent(in) :: val

    value

  • private subroutine json_value_add_string_vec(json, p, name, val, trim_str, adjustl_str)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    variable name

    character(kind=CK,len=*), intent(in), dimension(:):: val

    array of strings

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

    if TRIM() should be called for each element

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

    if ADJUSTL() should be called for each element

generic, public :: update => json_update_logical, json_update_double, json_update_integer, json_update_string

  • private subroutine json_update_logical(json, p, name, val, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name
    logical(kind=LK), intent(in) :: val
    logical(kind=LK), intent(out) :: found
  • private subroutine json_update_double(json, p, name, val, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name
    real(kind=RK), intent(in) :: val
    logical(kind=LK), intent(out) :: found
  • private subroutine json_update_integer(json, p, name, val, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name
    integer(kind=IK), intent(in) :: val
    logical(kind=LK), intent(out) :: found
  • private subroutine json_update_string(json, p, name, val, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name
    character(kind=CK,len=*), intent(in) :: val
    logical(kind=LK), intent(out) :: found

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

  • private subroutine json_get_by_path(json, me, path, p, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me

    a JSON linked list

    character(kind=CK,len=*), intent(in) :: path

    path to the variable

    type(json_value), intent(out), pointer:: p

    pointer to the variable specify by path

    logical(kind=LK), intent(out), optional :: found

    true if it was found

  • private subroutine json_get_integer(json, me, value)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    integer(kind=IK), intent(out) :: value
  • private subroutine json_get_integer_with_path(json, me, path, value, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    integer(kind=IK), intent(out) :: value
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_integer_vec(json, me, vec)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: me
    integer(kind=IK), intent(out), dimension(:), allocatable:: vec
  • private subroutine json_get_integer_vec_with_path(json, me, path, vec, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    integer(kind=IK), intent(out), dimension(:), allocatable:: vec
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_double(json, me, value)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: me
    real(kind=RK), intent(out) :: value
  • private subroutine json_get_double_with_path(json, me, path, value, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    real(kind=RK), intent(out) :: value
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_double_vec(json, me, vec)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: me
    real(kind=RK), intent(out), dimension(:), allocatable:: vec
  • private subroutine json_get_double_vec_with_path(json, me, path, vec, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    real(kind=RK), intent(out), dimension(:), allocatable:: vec
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_logical(json, me, value)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    logical(kind=LK) :: value
  • private subroutine json_get_logical_with_path(json, me, path, value, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    logical(kind=LK) :: value
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_logical_vec(json, me, vec)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    logical(kind=LK), intent(out), dimension(:), allocatable:: vec
  • private subroutine json_get_logical_vec_with_path(json, me, path, vec, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    logical(kind=LK), intent(out), dimension(:), allocatable:: vec
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_string(json, me, value)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=:), intent(out), allocatable:: value
  • private subroutine json_get_string_with_path(json, me, path, value, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    character(kind=CK,len=:), intent(out), allocatable:: value
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_string_vec(json, me, vec)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=*), intent(out), dimension(:), allocatable:: vec
  • private subroutine json_get_string_vec_with_path(json, me, path, vec, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    character(kind=CK,len=*), intent(out), dimension(:), allocatable:: vec
    logical(kind=LK), intent(out), optional :: found
  • private subroutine json_get_array(json, me, array_callback)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    procedure(array_callback_func) :: array_callback
  • private subroutine json_get_array_with_path(json, me, path, array_callback, found)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: me
    character(kind=CK,len=*), intent(in) :: path
    procedure(array_callback_func) :: array_callback
    logical(kind=LK), intent(out), optional :: found

procedure, public :: print_to_string => json_value_to_string

Print the json_value structure to an allocatable string

  • private subroutine json_value_to_string(json, p, str)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p
    character(kind=CK,len=:), intent(out), allocatable:: str

    prints structure to this string

generic, public :: print => json_print_1, json_print_2

  • private subroutine json_print_1(json, p, iunit)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p
    integer(kind=IK), intent(in) :: iunit

    the file unit (the file must already have been opened, can't be -1).

  • private subroutine json_print_2(json, p, filename)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p
    character(kind=CDK,len=*), intent(in) :: filename

    the filename to print to (should not already be open)

generic, public :: destroy => json_value_destroy, destroy_json_core

  • private recursive subroutine json_value_destroy(json, p, destroy_next)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p

    variable to destroy

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

    if true, then p%next is also destroyed (default is true)

  • private subroutine destroy_json_core(me)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(out) :: me

generic, public :: remove_if_present => json_value_remove_if_present

  • private subroutine json_value_remove_if_present(json, p, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

generic, public :: create_double => json_value_create_double

  • private subroutine json_value_create_double(json, p, val, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    real(kind=RK), intent(in) :: val
    character(kind=CK,len=*), intent(in) :: name

generic, public :: create_array => json_value_create_array

  • private subroutine json_value_create_array(json, p, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

generic, public :: create_object => json_value_create_object

  • private subroutine json_value_create_object(json, p, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

generic, public :: create_null => json_value_create_null

  • private subroutine json_value_create_null(json, p, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: name

generic, public :: create_string => json_value_create_string

  • private subroutine json_value_create_string(json, p, val, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    character(kind=CK,len=*), intent(in) :: val
    character(kind=CK,len=*), intent(in) :: name

generic, public :: create_integer => json_value_create_integer

  • private subroutine json_value_create_integer(json, p, val, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    integer(kind=IK), intent(in) :: val
    character(kind=CK,len=*), intent(in) :: name

generic, public :: create_logical => json_value_create_logical

  • private subroutine json_value_create_logical(json, p, val, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    logical(kind=LK), intent(in) :: val

    variable value

    character(kind=CK,len=*), intent(in) :: name

    variable name

generic, public :: parse => json_parse_file, json_parse_string

  • private subroutine json_parse_file(json, file, p, unit)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    character(kind=CDK,len=*), intent(in) :: file

    JSON file name

    type(json_value), , pointer:: p

    output structure

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

    file unit number (/= 0)

  • private subroutine json_parse_string(json, p, str)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p

    output structure

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

    string with JSON data

generic, public :: throw_exception => json_throw_exception

  • private subroutine json_throw_exception(json, msg)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    character(kind=CK,len=*), intent(in) :: msg

    the error message

generic, public :: rename => json_value_rename

  • private subroutine json_value_rename(json, p, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p
    character(kind=CK,len=*), intent(in) :: name

    new variable name

procedure, public :: remove => json_value_remove

Remove a json_value from a linked-list structure.

  • private subroutine json_value_remove(json, p, destroy)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    logical(kind=LK), intent(in), optional :: destroy

    If destroy is not present, it is also destroyed. If destroy is present and true, it is destroyed. If destroy is present and false, it is not destroyed.

procedure, public :: check_for_errors => json_check_for_errors

check for error and get error message

  • private subroutine json_check_for_errors(json, status_ok, error_msg)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    logical(kind=LK), intent(out) :: status_ok

    true if there were no errors

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

    the error message (if there were errors)

procedure, public :: clear_exceptions => json_clear_exceptions

clear exceptions

  • private pure subroutine json_clear_exceptions(json)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json

procedure, public :: count => json_count

count the number of children

  • private function json_count(json, p) result(count)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p

    Return Value integer(kind=IK)

    number of children

procedure, public :: clone => json_clone

clone a JSON structure (deep copy)

  • private subroutine json_clone(json, from, to)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: from

    this is the structure to clone

    type(json_value), , pointer:: to

    the clone is put here (it must not already be associated)

procedure, public :: failed => json_failed

check for error

  • private pure function json_failed(json) result(failed)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(in) :: json

    Return Value logical(kind=LK)

    will be true if an exception has been thrown.

procedure, public :: get_parent => json_get_parent

get pointer to json_value parent

  • private subroutine json_get_parent(json, p, parent)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p

    JSON object

    type(json_value), intent(out), pointer:: parent

    pointer to parent

procedure, public :: get_next => json_get_next

get pointer to json_value next

  • private subroutine json_get_next(json, p, next)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p

    JSON object

    type(json_value), intent(out), pointer:: next

    pointer to next

procedure, public :: get_previous => json_get_previous

get pointer to json_value previous

  • private subroutine json_get_previous(json, p, previous)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p

    JSON object

    type(json_value), intent(out), pointer:: previous

    pointer to previous

procedure, public :: get_tail => json_get_tail

get pointer to json_value tail

  • private subroutine json_get_tail(json, p, tail)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p

    JSON object

    type(json_value), intent(out), pointer:: tail

    pointer to tail

procedure, public :: info => json_info

get info about a json_value

  • private subroutine json_info(json, p, var_type, n_children, name)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p
    integer(kind=IK), intent(out), optional :: var_type

    variable type

    integer(kind=IK), intent(out), optional :: n_children

    number of children

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

    variable name

procedure, public :: initialize => json_initialize

to initialize some parsing parameters

  • private subroutine json_initialize(json, verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    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.

procedure, public :: traverse => json_traverse

to traverse all elements of a JSON structure

  • private subroutine json_traverse(json, p, traverse_callback)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p
    procedure(traverse_callback_func) :: traverse_callback

procedure, public :: print_error_message => json_print_error_message

simply routine to print error messages

  • private subroutine json_print_error_message(json, io_unit)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    integer, intent(in), optional :: io_unit

procedure, public :: swap => json_value_swap

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

  • private subroutine json_value_swap(json, p1, p2)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p1
    type(json_value), , pointer:: p2

procedure, public :: is_child_of => json_value_is_child_of

Check if a json_value is a child of another.

  • private function json_value_is_child_of(json, p1, p2) result(is_child_of)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), , pointer:: p1
    type(json_value), , pointer:: p2

    Return Value logical(kind=LK)

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.

  • private subroutine json_value_validate(json, p, is_valid, error_msg)

    Arguments

    Type IntentOptional AttributesName
    class(json_core), intent(inout) :: json
    type(json_value), intent(in), pointer:: p
    logical(kind=LK), intent(out) :: is_valid

    True if the structure is valid.

    character(kind=CK,len=:), , allocatable:: error_msg

    if not valid, this will contain a description of the problem