Higher-level json_file interface for the json_value type.
Structure constructor to initialize a json_file object with an existing json_value object or a JSON string, and either the json_core settings or a json_core instance.
Cast a json_value object as a json_file object.
It also calls the initialize()
method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | optional | pointer | :: | p |
|
|
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 |
|
logical(kind=LK), | intent(in), | optional | :: | trailing_spaces_significant | for name and path comparisons, is trailing space to be considered significant. (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | case_sensitive_keys | for name and path comparisons, are they case sensitive. (default is true) |
|
logical(kind=LK), | intent(in), | optional | :: | no_whitespace | if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | unescape_strings | If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped. |
|
character(kind=CK,len=*), | intent(in), | optional | :: | comment_char | If present, these characters are used
to denote comments in the JSON file,
which will be ignored if present.
Example: |
|
integer(kind=IK), | intent(in), | optional | :: | path_mode | How the path strings are interpreted in the
|
|
character(kind=CK,len=1), | intent(in), | optional | :: | path_separator | The |
|
logical(kind=LK), | intent(in), | optional | :: | compress_vectors | If true, then arrays of integers,
nulls, doubles, and logicals are
printed all on one line.
[Note: |
|
logical(kind=LK), | intent(in), | optional | :: | allow_duplicate_keys | ||
logical(kind=LK), | intent(in), | optional | :: | escape_solidus |
Note that this option does not affect parsing (both escaped and unescaped are still valid in all cases). |
|
logical(kind=LK), | intent(in), | optional | :: | stop_on_error | If an exception is raised, then immediately quit. (Default is False). |
|
integer(kind=IK), | intent(in), | optional | :: | null_to_real_mode | if
|
|
integer(kind=IK), | intent(in), | optional | :: | non_normal_mode | How to serialize NaN, Infinity, and -Infinity real values:
|
|
logical(kind=LK), | intent(in), | optional | :: | use_quiet_nan | ||
logical(kind=LK), | intent(in), | optional | :: | strict_integer_type_checking |
(default is true) |
Cast a json_value pointer and a json_core object as a json_file object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | intent(in), | pointer | :: | json_value_object | ||
type(json_core), | intent(in) | :: | json_core_object |
Cast a JSON string as a json_file object.
It also calls the initialize()
method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CK,len=*), | intent(in) | :: | str | string to load JSON data from |
||
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 |
|
logical(kind=LK), | intent(in), | optional | :: | trailing_spaces_significant | for name and path comparisons, is trailing space to be considered significant. (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | case_sensitive_keys | for name and path comparisons, are they case sensitive. (default is true) |
|
logical(kind=LK), | intent(in), | optional | :: | no_whitespace | if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | unescape_strings | If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped. |
|
character(kind=CK,len=*), | intent(in), | optional | :: | comment_char | If present, these characters are used
to denote comments in the JSON file,
which will be ignored if present.
Example: |
|
integer(kind=IK), | intent(in), | optional | :: | path_mode | How the path strings are interpreted in the
|
|
character(kind=CK,len=1), | intent(in), | optional | :: | path_separator | The |
|
logical(kind=LK), | intent(in), | optional | :: | compress_vectors | If true, then arrays of integers,
nulls, doubles, and logicals are
printed all on one line.
[Note: |
|
logical(kind=LK), | intent(in), | optional | :: | allow_duplicate_keys | ||
logical(kind=LK), | intent(in), | optional | :: | escape_solidus |
Note that this option does not affect parsing (both escaped and unescaped are still valid in all cases). |
|
logical(kind=LK), | intent(in), | optional | :: | stop_on_error | If an exception is raised, then immediately quit. (Default is False). |
|
integer(kind=IK), | intent(in), | optional | :: | null_to_real_mode | if
|
|
integer(kind=IK), | intent(in), | optional | :: | non_normal_mode | How to serialize NaN, Infinity, and -Infinity real values:
|
|
logical(kind=LK), | intent(in), | optional | :: | use_quiet_nan | ||
logical(kind=LK), | intent(in), | optional | :: | strict_integer_type_checking |
(default is true) |
Cast a JSON string and a json_core object as a json_file object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CK,len=*), | intent(in) | :: | str | string to load JSON data from |
||
type(json_core), | intent(in) | :: | json_core_object |
The json_file
is the main public class that is
used to open a file and get data from it.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(json_core), | public | :: | core | The instance of the json_core factory used for this file. |
|||
type(json_value), | public, | pointer | :: | p | => | null() | the JSON structure read from the file |
Structure constructor to initialize a json_file object with an existing json_value object or a JSON string, and either the json_core settings or a json_core instance.
private function initialize_json_file(p, verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys, no_whitespace, unescape_strings, comment_char, path_mode, path_separator, compress_vectors, allow_duplicate_keys, escape_solidus, stop_on_error, null_to_real_mode, non_normal_mode, use_quiet_nan, strict_integer_type_checking) | Cast a json_value object as a json_file object.
It also calls the |
private function initialize_json_file_v2(json_value_object, json_core_object) | Cast a json_value pointer and a json_core object as a json_file object. |
private function initialize_json_file_from_string(str, verbose, compact_reals, print_signs, real_format, spaces_per_tab, strict_type_checking, trailing_spaces_significant, case_sensitive_keys, no_whitespace, unescape_strings, comment_char, path_mode, path_separator, compress_vectors, allow_duplicate_keys, escape_solidus, stop_on_error, null_to_real_mode, non_normal_mode, use_quiet_nan, strict_integer_type_checking) | Cast a JSON string as a json_file object.
It also calls the |
private function initialize_json_file_from_string_v2(str, json_core_object) | Cast a JSON string and a json_core object as a json_file object. |
final :: finalize_json_file |
generic, public :: add => json_file_add, json_file_add_object, json_file_add_integer, json_file_add_real32, json_file_add_real, json_file_add_logical, json_file_add_string, json_file_add_integer_vec, json_file_add_real32_vec, json_file_add_real_vec, json_file_add_logical_vec, json_file_add_string_vec | Add a variable to a json_file, by specifying the path. |
procedure, public :: assign_json_file | |
procedure, public, pass(me) :: assign_json_file_to_string | |
procedure, public :: assign_string_to_json_file | |
generic, public :: assignment(=) => assign_json_file, assign_json_file_to_string, assign_string_to_json_file | |
procedure, public :: check_for_errors => json_file_check_for_errors | |
procedure, public :: clear_exceptions => json_file_clear_exceptions | |
generic, public :: deserialize => json_file_load_from_string | Load JSON from a string. |
procedure, public :: destroy => json_file_destroy | |
procedure, public :: failed => json_file_failed | |
generic, public :: get => json_file_get_object, json_file_get_integer, json_file_get_real32, json_file_get_real, json_file_get_logical, json_file_get_string, json_file_get_integer_vec, json_file_get_real32_vec, json_file_get_real_vec, json_file_get_logical_vec, json_file_get_string_vec, json_file_get_alloc_string_vec, json_file_get_root | Get a variable from a json_file, by specifying the path. |
procedure, public :: get_core => get_json_core_in_file | |
generic, public :: info => json_file_variable_info | |
generic, public :: initialize => initialize_json_core_in_file, set_json_core_in_file | |
procedure, public :: initialize_json_core_in_file | |
procedure, public :: json_file_add | |
procedure, public :: json_file_add_integer | |
procedure, public :: json_file_add_integer_vec | |
procedure, public :: json_file_add_logical | |
procedure, public :: json_file_add_logical_vec | |
procedure, public :: json_file_add_object | |
procedure, public :: json_file_add_real | |
procedure, public :: json_file_add_real32 | |
procedure, public :: json_file_add_real32_vec | |
procedure, public :: json_file_add_real_vec | |
procedure, public :: json_file_add_string | |
procedure, public :: json_file_add_string_vec | |
procedure, public :: json_file_get_alloc_string_vec | |
procedure, public :: json_file_get_integer | |
procedure, public :: json_file_get_integer_vec | |
procedure, public :: json_file_get_logical | |
procedure, public :: json_file_get_logical_vec | |
procedure, public :: json_file_get_object | |
procedure, public :: json_file_get_real | |
procedure, public :: json_file_get_real32 | |
procedure, public :: json_file_get_real32_vec | |
procedure, public :: json_file_get_real_vec | |
procedure, public :: json_file_get_root | |
procedure, public :: json_file_get_string | |
procedure, public :: json_file_get_string_vec | |
procedure, public :: json_file_load_from_string | |
procedure, public :: json_file_print_to_console | |
procedure, public :: json_file_print_to_filename | |
procedure, public :: json_file_print_to_unit | |
procedure, public :: json_file_remove | |
procedure, public :: json_file_rename | |
procedure, public :: json_file_update_integer | |
procedure, public :: json_file_update_logical | |
procedure, public :: json_file_update_real | |
procedure, public :: json_file_update_real32 | |
procedure, public :: json_file_update_string | |
procedure, public :: json_file_valid_path | |
procedure, public, pass(me) :: json_file_valid_path_op | |
procedure, public :: json_file_variable_info | |
procedure, public :: json_file_variable_matrix_info | |
procedure, public :: load => json_file_load | Load JSON from a file. |
procedure, public :: load_file => json_file_load | The same as |
generic, public :: load_from_string => json_file_load_from_string | The same as |
generic, public :: matrix_info => json_file_variable_matrix_info | |
procedure, public :: move => json_file_move_pointer | |
procedure, public :: nullify => json_file_nullify | |
generic, public :: operator(.in.) => json_file_valid_path_op | |
generic, public :: print => json_file_print_to_console, json_file_print_to_unit, json_file_print_to_filename | |
procedure, public :: print_error_message => json_file_print_error_message | |
generic, public :: print_file => json_file_print_to_console, json_file_print_to_unit, json_file_print_to_filename | The same as |
procedure, public :: print_to_string => json_file_print_to_string | The same as |
generic, public :: remove => json_file_remove | Remove a variable from a json_file by specifying the path. |
generic, public :: rename => json_file_rename | Rename a variable, specifying it by path |
procedure, public :: serialize => json_file_print_to_string | Print the json_value structure to an allocatable string |
procedure, public :: set_json_core_in_file | |
procedure, public :: traverse => json_file_traverse | |
generic, public :: update => json_file_update_integer, json_file_update_logical, json_file_update_real32, json_file_update_real, json_file_update_string | Update a scalar variable in a json_file, by specifying the path. |
generic, public :: valid_path => json_file_valid_path | Verify that a path is valid (i.e., a variable with this path exists in the file). |
Cast a json_value object as a json_file object.
It also calls the initialize()
method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | optional | pointer | :: | p |
|
|
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 |
|
logical(kind=LK), | intent(in), | optional | :: | trailing_spaces_significant | for name and path comparisons, is trailing space to be considered significant. (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | case_sensitive_keys | for name and path comparisons, are they case sensitive. (default is true) |
|
logical(kind=LK), | intent(in), | optional | :: | no_whitespace | if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | unescape_strings | If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped. |
|
character(kind=CK,len=*), | intent(in), | optional | :: | comment_char | If present, these characters are used
to denote comments in the JSON file,
which will be ignored if present.
Example: |
|
integer(kind=IK), | intent(in), | optional | :: | path_mode | How the path strings are interpreted in the
|
|
character(kind=CK,len=1), | intent(in), | optional | :: | path_separator | The |
|
logical(kind=LK), | intent(in), | optional | :: | compress_vectors | If true, then arrays of integers,
nulls, doubles, and logicals are
printed all on one line.
[Note: |
|
logical(kind=LK), | intent(in), | optional | :: | allow_duplicate_keys | ||
logical(kind=LK), | intent(in), | optional | :: | escape_solidus |
Note that this option does not affect parsing (both escaped and unescaped are still valid in all cases). |
|
logical(kind=LK), | intent(in), | optional | :: | stop_on_error | If an exception is raised, then immediately quit. (Default is False). |
|
integer(kind=IK), | intent(in), | optional | :: | null_to_real_mode | if
|
|
integer(kind=IK), | intent(in), | optional | :: | non_normal_mode | How to serialize NaN, Infinity, and -Infinity real values:
|
|
logical(kind=LK), | intent(in), | optional | :: | use_quiet_nan | ||
logical(kind=LK), | intent(in), | optional | :: | strict_integer_type_checking |
(default is true) |
Cast a JSON string as a json_file object.
It also calls the initialize()
method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CK,len=*), | intent(in) | :: | str | string to load JSON data from |
||
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 |
|
logical(kind=LK), | intent(in), | optional | :: | trailing_spaces_significant | for name and path comparisons, is trailing space to be considered significant. (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | case_sensitive_keys | for name and path comparisons, are they case sensitive. (default is true) |
|
logical(kind=LK), | intent(in), | optional | :: | no_whitespace | if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | unescape_strings | If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped. |
|
character(kind=CK,len=*), | intent(in), | optional | :: | comment_char | If present, these characters are used
to denote comments in the JSON file,
which will be ignored if present.
Example: |
|
integer(kind=IK), | intent(in), | optional | :: | path_mode | How the path strings are interpreted in the
|
|
character(kind=CK,len=1), | intent(in), | optional | :: | path_separator | The |
|
logical(kind=LK), | intent(in), | optional | :: | compress_vectors | If true, then arrays of integers,
nulls, doubles, and logicals are
printed all on one line.
[Note: |
|
logical(kind=LK), | intent(in), | optional | :: | allow_duplicate_keys | ||
logical(kind=LK), | intent(in), | optional | :: | escape_solidus |
Note that this option does not affect parsing (both escaped and unescaped are still valid in all cases). |
|
logical(kind=LK), | intent(in), | optional | :: | stop_on_error | If an exception is raised, then immediately quit. (Default is False). |
|
integer(kind=IK), | intent(in), | optional | :: | null_to_real_mode | if
|
|
integer(kind=IK), | intent(in), | optional | :: | non_normal_mode | How to serialize NaN, Infinity, and -Infinity real values:
|
|
logical(kind=LK), | intent(in), | optional | :: | use_quiet_nan | ||
logical(kind=LK), | intent(in), | optional | :: | strict_integer_type_checking |
(default is true) |
Cast a json_value pointer and a json_core object as a json_file object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_value), | intent(in), | pointer | :: | json_value_object | ||
type(json_core), | intent(in) | :: | json_core_object |
Check error status in the file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(in) | :: | me |
will be true if there has been an error.
Returns true if the path
is present in the JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
if the variable was found
A wrapper for json_file_valid_path for the .in.
operator
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
class(json_file), | intent(in) | :: | me | the JSON file |
if the variable was found
Alternate version of initialize_json_file_from_string, where “str” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CDK,len=*), | intent(in) | :: | str | string to load JSON data from |
||
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 |
|
logical(kind=LK), | intent(in), | optional | :: | trailing_spaces_significant | for name and path comparisons, is trailing space to be considered significant. (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | case_sensitive_keys | for name and path comparisons, are they case sensitive. (default is true) |
|
logical(kind=LK), | intent(in), | optional | :: | no_whitespace | if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | unescape_strings | If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped. |
|
character(kind=CK,len=*), | intent(in), | optional | :: | comment_char | If present, these characters are used
to denote comments in the JSON file,
which will be ignored if present.
Example: |
|
integer(kind=IK), | intent(in), | optional | :: | path_mode | How the path strings are interpreted in the
|
|
character(kind=CK,len=1), | intent(in), | optional | :: | path_separator | The |
|
logical(kind=LK), | intent(in), | optional | :: | compress_vectors | If true, then arrays of integers,
nulls, doubles, and logicals are
printed all on one line.
[Note: |
|
logical(kind=LK), | intent(in), | optional | :: | allow_duplicate_keys | ||
logical(kind=LK), | intent(in), | optional | :: | escape_solidus |
Note that this option does not affect parsing (both escaped and unescaped are still valid in all cases). |
|
logical(kind=LK), | intent(in), | optional | :: | stop_on_error | If an exception is raised, then immediately quit. (Default is False). |
|
integer(kind=IK), | intent(in), | optional | :: | null_to_real_mode | if
|
|
integer(kind=IK), | intent(in), | optional | :: | non_normal_mode | How to serialize NaN, Infinity, and -Infinity real values:
|
|
logical(kind=LK), | intent(in), | optional | :: | use_quiet_nan | ||
logical(kind=LK), | intent(in), | optional | :: | strict_integer_type_checking |
(default is true) |
Alternate version of initialize_json_file_from_string_v2, where “str” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CDK,len=*), | intent(in) | :: | str | string to load JSON data from |
||
type(json_core), | intent(in) | :: | json_core_object |
Alternate version of json_file_valid_path, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
if the variable was found
Alternate version of json_file_valid_path_op, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
class(json_file), | intent(in) | :: | me | the JSON file |
if the variable was found
Assignment operator for character = json_core. This is just a wrapper for the json_value_to_string routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=CK,len=:), | intent(out), | allocatable | :: | str | ||
class(json_file), | intent(in) | :: | me |
Assignment operator for json_core = character. This is just a wrapper for the json_file_load_from_string routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | str |
Finalizer for json_file class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_file), | intent(inout) | :: | me |
Initialize the json_core for this json_file. This is just a wrapper for json_initialize.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
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 |
|
logical(kind=LK), | intent(in), | optional | :: | trailing_spaces_significant | for name and path comparisons, is trailing space to be considered significant. (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | case_sensitive_keys | for name and path comparisons, are they case sensitive. (default is true) |
|
logical(kind=LK), | intent(in), | optional | :: | no_whitespace | if true, printing the JSON structure is done without adding any non-significant spaces or linebreaks (default is false) |
|
logical(kind=LK), | intent(in), | optional | :: | unescape_strings | If false, then the raw escaped string is returned from json_get_string and similar routines. If true [default], then the string is returned unescaped. |
|
character(kind=CK,len=*), | intent(in), | optional | :: | comment_char | If present, these characters are used
to denote comments in the JSON file,
which will be ignored if present.
Example: |
|
integer(kind=IK), | intent(in), | optional | :: | path_mode | How the path strings are interpreted in the
|
|
character(kind=CK,len=1), | intent(in), | optional | :: | path_separator | The |
|
logical(kind=LK), | intent(in), | optional | :: | compress_vectors | If true, then arrays of integers,
nulls, doubles, and logicals are
printed all on one line.
[Note: |
|
logical(kind=LK), | intent(in), | optional | :: | allow_duplicate_keys | ||
logical(kind=LK), | intent(in), | optional | :: | escape_solidus |
Note that this option does not affect parsing (both escaped and unescaped are still valid in all cases). |
|
logical(kind=LK), | intent(in), | optional | :: | stop_on_error | If an exception is raised, then immediately quit. (Default is False). |
|
integer(kind=IK), | intent(in), | optional | :: | null_to_real_mode | if
|
|
integer(kind=IK), | intent(in), | optional | :: | non_normal_mode | How to serialize NaN, Infinity, and -Infinity real values:
|
|
logical(kind=LK), | intent(in), | optional | :: | use_quiet_nan | ||
logical(kind=LK), | intent(in), | optional | :: | strict_integer_type_checking |
(default is true) |
Add a json_value pointer as the root object to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
type(json_value), | intent(in), | pointer | :: | p | pointer to the variable to add |
|
logical(kind=LK), | intent(in), | optional | :: | destroy_original | if the file currently contains an associated pointer, it is destroyed. [Default is True] |
Add an integer value to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Add an integer vector to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Add a logical(LK) value to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Add a logical(LK) vector to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Add a json_value pointer to an object to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
type(json_value), | intent(in), | pointer | :: | p | pointer to the variable to add |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Add a real(RK) variable value to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_real where val
is real32
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_real_vec where vec
is real32
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Add a real(RK) vector to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Add a character string to a json file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Wrapper for json_file_add_string where “path” is kind=CDK).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Wrapper for json_file_add_string where “val” is kind=CDK).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CDK,len=*), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Add a string vector to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | ilen | the string lengths of each
element in |
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 (note that ADJUSTL is done before TRIM) |
Alternate version of json_file_add_string_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | ilen | the string lengths of each
element in |
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 (note that ADJUSTL is done before TRIM) |
Alternate version of json_file_add_string_vec, where “vec” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CDK,len=*), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | ilen | the string lengths of each
element in |
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 (note that ADJUSTL is done before TRIM) |
Retrieve error status and message from the class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
logical(kind=LK), | intent(out), | optional | :: | status_ok | true if there were no errors |
|
character(kind=CK,len=:), | intent(out), | optional | allocatable | :: | error_msg | the error message (if there were errors) |
Clear exceptions in the class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me |
Destroy the json_value data in a json_file. This may be done when the variable is no longer needed, or will be reused to open a different file. Otherwise a memory leak will occur.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
logical, | intent(in), | optional | :: | destroy_core | to also destroy the json_core. default is to leave it as is. |
Get an (allocatable length) string vector from a JSON file. This is just a wrapper for json_get_alloc_string_vec_by_path.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=:), | intent(out), | dimension(:), allocatable | :: | vec | value vector |
|
integer(kind=IK), | intent(out), | dimension(:), allocatable | :: | ilen | the actual length of each character string in the array |
|
logical(kind=LK), | intent(out), | optional | :: | found | ||
character(kind=CK,len=*), | intent(in), | optional | dimension(:) | :: | default | |
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | default_ilen | the actual
length of |
Get an integer value from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
integer(kind=IK), | intent(in), | optional | :: | default |
Get an integer vector from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | default |
Get a logical(LK) value from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
logical(kind=LK), | intent(in), | optional | :: | default |
Get a logical(LK) vector from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
logical(kind=LK), | intent(in), | optional | dimension(:) | :: | default |
Get a json_value pointer to an object from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
type(json_value), | intent(out), | pointer | :: | p | pointer to the variable |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
Get a real(RK) variable value from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=RK), | intent(in), | optional | :: | default |
Alternate version of json_file_get_real where val
is real32
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=real32), | intent(in), | optional | :: | default |
Alternate version of json_file_get_real_vec where vec
is real32
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=real32), | intent(in), | optional | dimension(:) | :: | default |
Get a real(RK) vector from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=RK), | intent(in), | optional | dimension(:) | :: | default |
Get a json_value pointer to the JSON file root.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
type(json_value), | intent(out), | pointer | :: | p | pointer to the variable |
Get a character string from a json file. The output val is an allocatable character string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=:), | intent(out), | allocatable | :: | val | value |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
character(kind=CK,len=*), | intent(in), | optional | :: | default |
Get a string vector from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(out), | dimension(:), allocatable | :: | vec | value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
character(kind=CK,len=*), | intent(in), | optional | dimension(:) | :: | default |
Load the JSON data from a file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | filename | the filename to open |
||
integer(kind=IK), | intent(in), | optional | :: | unit | the unit number to use (if not present, a newunit is used) |
Load the JSON data from a string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | str | string to load JSON data from |
Move the json_value pointer from one json_file to another. The “from” pointer is then nullified, but not destroyed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | to | |||
class(json_file), | intent(inout) | :: | from |
Nullify the json_value pointer in a json_file, but do not destroy it.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me |
This is a wrapper for json_print_error_message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
integer, | intent(in), | optional | :: | io_unit |
Print the JSON file to the console.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me |
Print the JSON structure to the specified filename. The file is opened, printed, and then closed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | filename | filename to print to |
Print the JSON file to a string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=:), | intent(out), | allocatable | :: | str | string to print JSON data to |
Prints the JSON file to the specified file unit number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
integer(kind=IK), | intent(in) | :: | iunit | file unit number (must not be -1) |
Remove a variable from a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
Rename a variable in a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(in) | :: | name | the new name |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
Wrapper for json_file_rename where “name” is kind=CDK).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CDK,len=*), | intent(in) | :: | name | the new name |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
Wrapper for json_file_rename where “path” is kind=CDK).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(in) | :: | name | the new name |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
Traverse the JSON structure in the file. This routine calls the user-specified json_traverse_callback_func for each element of the structure.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
procedure(json_traverse_callback_func) | :: | traverse_callback |
Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | |||
integer(kind=IK), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | |||
logical(kind=LK), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | |||
real(kind=RK), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Alternate version of json_file_update_real where val
is real32
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | |||
real(kind=real32), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Given the path string, if the variable is present in the file, and is a scalar, then update its value. If it is not present, then create it and set its value.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | |||
character(kind=CK,len=*), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found | |||
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Alternate version of json_file_update_string, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | |||
character(kind=CK,len=*), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found | |||
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Alternate version of json_file_update_string, where “val” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | |||
character(kind=CDK,len=*), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found | |||
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Returns information about a variable in a json_file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | path to the variable |
||
logical(kind=LK), | intent(out), | optional | :: | found | the variable exists in the structure |
|
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 |
Returns matrix information about a variable in a json_file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CK,len=*), | intent(in) | :: | path | path to the variable |
||
logical(kind=LK), | intent(out) | :: | is_matrix | true if it is a valid matrix |
||
logical(kind=LK), | intent(out), | optional | :: | found | true if it was found |
|
integer(kind=IK), | intent(out), | optional | :: | var_type | variable type of data in the matrix (if all elements have the same type) |
|
integer(kind=IK), | intent(out), | optional | :: | n_sets | number of data sets (i.e., matrix rows if using row-major order) |
|
integer(kind=IK), | intent(out), | optional | :: | set_size | size of each data set (i.e., matrix cols if using row-major order) |
|
character(kind=CK,len=:), | intent(out), | optional | allocatable | :: | name | variable name |
Set the json_core for this json_file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
type(json_core), | intent(in) | :: | core |
Alternate version of assign_string_to_json_file, where “str” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | str |
Alternate version of json_file_add_integer, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_integer_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_logical, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_logical_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_object, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
type(json_value), | intent(in), | pointer | :: | p | pointer to the variable to add |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_real, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_real32, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_real32_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_real_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
Alternate version of json_file_add_string, where “path” and “val” are kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CDK,len=*), | intent(in) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Alternate version of json_file_add_string_vec, where “path” and “vec” are kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CDK,len=*), | intent(in), | dimension(:) | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
|
logical(kind=LK), | intent(out), | optional | :: | was_created | if the variable had to be created |
|
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | ilen | the string lengths of each
element in |
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 (note that ADJUSTL is done before TRIM) |
Alternate version of json_file_get_alloc_string_vec, where “path” is kind=CDK. This is just a wrapper for wrap_json_get_alloc_string_vec_by_path.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=:), | intent(out), | dimension(:), allocatable | :: | vec | value vector |
|
integer(kind=IK), | intent(out), | dimension(:), allocatable | :: | ilen | the actual length of each character string in the array |
|
logical(kind=LK), | intent(out), | optional | :: | found | ||
character(kind=CK,len=*), | intent(in), | optional | dimension(:) | :: | default | |
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | default_ilen | the actual
length of |
Alternate version of json_file_get_integer, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
integer(kind=IK), | intent(in), | optional | :: | default |
Alternate version of json_file_get_integer_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
integer(kind=IK), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
integer(kind=IK), | intent(in), | optional | dimension(:) | :: | default |
Alternate version of json_file_get_logical, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
logical(kind=LK), | intent(in), | optional | :: | default |
Alternate version of json_file_get_logical_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
logical(kind=LK), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
logical(kind=LK), | intent(in), | optional | dimension(:) | :: | default |
Alternate version of json_file_get_object, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
type(json_value), | intent(out), | pointer | :: | p | pointer to the variable |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
Alternate version of json_file_get_real, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=RK), | intent(in), | optional | :: | default |
Alternate version of json_file_get_real32, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(out) | :: | val | value |
||
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=real32), | intent(in), | optional | :: | default |
Alternate version of json_file_get_real32_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=real32), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=real32), | intent(in), | optional | dimension(:) | :: | default |
Alternate version of json_file_get_real_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
real(kind=RK), | intent(out), | dimension(:), allocatable | :: | vec | the value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
real(kind=RK), | intent(in), | optional | dimension(:) | :: | default |
Alternate version of json_file_get_string, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=:), | intent(out), | allocatable | :: | val | value |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
character(kind=CK,len=*), | intent(in), | optional | :: | default |
Alternate version of json_file_get_string_vec, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CK,len=*), | intent(out), | dimension(:), allocatable | :: | vec | value vector |
|
logical(kind=LK), | intent(out), | optional | :: | found | if it was really found |
|
character(kind=CK,len=*), | intent(in), | optional | dimension(:) | :: | default |
Alternate version of json_file_load_from_string, where “str” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | str |
Alternate version of json_file_remove, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
Alternate version of json_file_rename, where “path” and “name” are kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | the path to the variable |
||
character(kind=CDK,len=*), | intent(in) | :: | name | the new name |
||
logical(kind=LK), | intent(out), | optional | :: | found | if the variable was found |
Alternate version of json_file_update_integer, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | |||
integer(kind=IK), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Alternate version of json_file_update_logical, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | |||
logical(kind=LK), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Alternate version of json_file_update_real, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | |||
real(kind=RK), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Alternate version of json_file_update_real32, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | |||
real(kind=real32), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found |
Alternate version of json_file_update_string, where “path” and “val” are kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | |||
character(kind=CDK,len=*), | intent(in) | :: | val | |||
logical(kind=LK), | intent(out) | :: | found | |||
logical(kind=LK), | intent(in), | optional | :: | trim_str | if TRIM() should be called for the |
|
logical(kind=LK), | intent(in), | optional | :: | adjustl_str | if ADJUSTL() should be called for the |
Alternate version of json_file_variable_info, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | |||
logical(kind=LK), | intent(out), | optional | :: | found | ||
integer(kind=IK), | intent(out), | optional | :: | var_type | ||
integer(kind=IK), | intent(out), | optional | :: | n_children | ||
character(kind=CK,len=:), | intent(out), | optional | allocatable | :: | name | variable name |
Alternate version of json_file_variable_matrix_info, where “path” is kind=CDK.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_file), | intent(inout) | :: | me | |||
character(kind=CDK,len=*), | intent(in) | :: | path | path to the variable |
||
logical(kind=LK), | intent(out) | :: | is_matrix | true if it is a valid matrix |
||
logical(kind=LK), | intent(out), | optional | :: | found | true if it was found |
|
integer(kind=IK), | intent(out), | optional | :: | var_type | variable type of data in the matrix (if all elements have the same type) |
|
integer(kind=IK), | intent(out), | optional | :: | n_sets | number of data sets (i.e., matrix rows if using row-major order) |
|
integer(kind=IK), | intent(out), | optional | :: | set_size | size of each data set (i.e., matrix cols if using row-major order) |
|
character(kind=CK,len=:), | intent(out), | optional | allocatable | :: | name | variable name |