Procedures

ProcedureLocationProcedure TypeDescription
add_variables_to_inputjf_test_2_modSubroutine
annotate_invalid_jsonjson_moduleSubroutine

Generate a warning message if there was an error parsing a JSON file or string.

compact_real_stringjson_moduleSubroutine

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

default_comp_ucs4json_moduleFunction

CDK==CK operator.

default_join_ucs4json_moduleFunction

CDK//CK operator.

destroy_json_datajson_moduleSubroutine

Destroy the data within a json_value, and rest type to json_unknown.

escape_stringjson_moduleSubroutine

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

get_current_line_from_file_sequentialjson_moduleSubroutine

Rewind the file to the beginning of the current line, and return this line. The file is assumed to be opened. This is the SEQUENTIAL version (see also get_current_line_from_file_stream).

get_current_line_from_file_streamjson_moduleSubroutine

Rewind the file to the beginning of the current line, and return this line. The file is assumed to be opened. This is the STREAM version (see also get_current_line_from_file_sequential).

initialize_json_filejson_moduleFunction

Cast a json_value object as a json_file object

integer_to_stringjson_moduleSubroutine

Convert an integer to a string.

json_addjson_moduleInterface

Add objects to a linked list of json_values.

json_check_for_errorsjson_moduleSubroutine

Retrieve error code from the module. This should be called after json_parse to check for errors. If an error is thrown, before using the module again, json_initialize should be called to clean up before it is used again.

json_clear_exceptionsjson_moduleSubroutine

Clear exceptions in the JSON module.

json_countjson_moduleFunction

Count the number of children.

json_create_arrayjson_moduleInterface

Allocate a json_value pointer and make it an array variable. The pointer should not already be allocated.

json_create_doublejson_moduleInterface

Allocate a json_value pointer and make it a double variable. The pointer should not already be allocated.

json_create_integerjson_moduleInterface

Allocate a json_value pointer and make it an integer variable. The pointer should not already be allocated.

json_create_logicaljson_moduleInterface

Allocate a json_value pointer and make it a logical variable. The pointer should not already be allocated.

json_create_nulljson_moduleInterface

Allocate a json_value pointer and make it a null variable. The pointer should not already be allocated.

json_create_objectjson_moduleInterface

Allocate a json_value pointer and make it an object variable. The pointer should not already be allocated.

json_create_stringjson_moduleInterface

Allocate a json_value pointer and make it a string variable. The pointer should not already be allocated.

json_destroyjson_moduleInterface

Destructor routine for a json_value pointer. This must be called explicitly if it is no longer needed, before it goes out of scope. Otherwise, a memory leak will result.

json_failedjson_moduleFunction

Logical function to indicate if an exception has been thrown.

json_filejson_moduleInterface

Structure constructor to initialize a json_file object with an existing json_value object

json_file_destroyjson_moduleSubroutine

Destroy the json_file.

json_file_get_doublejson_moduleSubroutine

Get a real(RK) variable value from a JSON file.

json_file_get_double_vecjson_moduleSubroutine

Get a real(RK) vector from a JSON file.

json_file_get_integerjson_moduleSubroutine

Get an integer value from a JSON file.

json_file_get_integer_vecjson_moduleSubroutine

Get an integer vector from a JSON file.

json_file_get_logicaljson_moduleSubroutine

Get a logical(LK) value from a JSON file.

json_file_get_logical_vecjson_moduleSubroutine

Get a logical(LK) vector from a JSON file.

json_file_get_objectjson_moduleSubroutine

Get a json_value pointer to an object from a JSON file.

json_file_get_rootjson_moduleSubroutine

Get a json_value pointer to the JSON file root.

json_file_get_stringjson_moduleSubroutine

Get a character string from a json file. The output val is an allocatable character string.

json_file_get_string_vecjson_moduleSubroutine

Get a string vector from a JSON file.

json_file_loadjson_moduleSubroutine

Load the JSON data from a file.

json_file_load_from_stringjson_moduleSubroutine

Load the JSON data from a string.

json_file_move_pointerjson_moduleSubroutine

Move the json_value pointer from one json_file to another. The "from" pointer is then nullified, but not destroyed.

json_file_print_1json_moduleSubroutine

Prints the JSON file to the specified file unit number.

json_file_print_2json_moduleSubroutine

Print the JSON structure to the specified filename. The file is opened, printed, and then closed.

json_file_print_to_consolejson_moduleSubroutine

Print the JSON file to the console.

json_file_print_to_stringjson_moduleSubroutine

Print the JSON file to a string.

json_file_update_integerjson_moduleSubroutine

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.

json_file_update_logicaljson_moduleSubroutine

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.

json_file_update_realjson_moduleSubroutine

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.

json_file_update_stringjson_moduleSubroutine

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.

json_file_update_string_name_asciijson_moduleSubroutine

Alternate version of json_file_update_string, where "name" is kind=CDK.

json_file_update_string_val_asciijson_moduleSubroutine

Alternate version of json_file_update_string, where "val" is kind=CDK.

json_file_variable_infojson_moduleSubroutine

Returns information about a variable in a json_file.

json_getjson_moduleInterface

Get data from a json_value linked list.

json_get_arrayjson_moduleSubroutine

This routine calls the user-supplied array_callback_func subroutine for each element in the array.

json_get_array_with_pathjson_moduleSubroutine

This routine calls the user-supplied array_callback subroutine for each element in the array (specified by the path).

json_get_by_pathjson_moduleSubroutine

Returns the json_value pointer given the path string.

json_get_childjson_moduleInterface

Get a child, either by index or name string. Both of these return a json_value pointer.

json_get_doublejson_moduleSubroutine

Get a double value from a json_value.

json_get_double_vecjson_moduleSubroutine

Get a double vector from a json_value.

json_get_double_vec_with_pathjson_moduleSubroutine

Get a double vector from a json_value, given the path.

json_get_double_with_pathjson_moduleSubroutine

Get a double value from a json_value, given the path.

json_get_integerjson_moduleSubroutine

Get an integer value from a json_value.

json_get_integer_vecjson_moduleSubroutine

Get an integer vector from a json_value.

json_get_integer_vec_with_pathjson_moduleSubroutine

Get an integer vector from a json_value, given the path string.

json_get_integer_with_pathjson_moduleSubroutine

Get an integer value from a json_value, given the path string.

json_get_logicaljson_moduleSubroutine

Get a logical value from a json_value.

json_get_logical_vecjson_moduleSubroutine

Get a logical vector from json_value.

json_get_logical_vec_with_pathjson_moduleSubroutine

Get a logical vector from a json_value, given the path.

json_get_logical_with_pathjson_moduleSubroutine

Get a logical value from a json_value, given the path.

json_get_stringjson_moduleSubroutine

Get a character string from a json_value.

json_get_string_vecjson_moduleSubroutine

Get a string vector from a json_file.

json_get_string_vec_with_pathjson_moduleSubroutine

Get a string vector from a json_file, given the path.

json_get_string_with_pathjson_moduleSubroutine

Get a character string from a json_value, given the path.

json_infojson_moduleSubroutine

Returns information about a json_value.

json_initializejson_moduleSubroutine

Initialize the JSON-Fortran module. The routine must be called before any of the routines are used. It can also be called after using the module and encountering exceptions.

json_parsejson_moduleInterface

Parse the JSON file and populate the json_value tree.

json_parse_filejson_moduleSubroutine

Parse the JSON file and populate the json_value tree.

json_parse_stringjson_moduleSubroutine

Parse the JSON string and populate the json_value tree.

json_printjson_moduleInterface

Print the json_value to a file.

json_print_1json_moduleSubroutine

Print the json_value structure to a file.

json_print_2json_moduleSubroutine

Print the json_value structure to a file.

json_print_error_messagejson_moduleSubroutine

Print any error message, and then clear the exceptions.

json_print_to_stringjson_moduleInterface

Print the json_value structure to an allocatable string.

json_removejson_moduleInterface

Remove a json_value from a linked-list structure.

json_remove_if_presentjson_moduleInterface

If the child variable is present, then remove it.

json_throw_exceptionjson_moduleSubroutine

Throw an exception in the JSON module. This routine sets the error flag, and prevents any subsequent routine from doing anything, until json_clear_exceptions is called.

json_traversejson_moduleSubroutine

Traverse a JSON structure. This routine calls the user-specified traverse_callback_func for each element of the structure.

json_updatejson_moduleInterface

These are like json_add, except if a child with the same name is already present, then its value is simply updated. Note that currently, these only work for scalar variables. These routines can also change the variable's type (but an error will be thrown if the existing variable is not a scalar).

json_update_doublejson_moduleSubroutine

Given the path string, if the variable is present, and is a scalar, then update its value. If it is not present, then create it and set its value.

json_update_integerjson_moduleSubroutine

Given the path string, if the variable is present, and is a scalar, then update its value. If it is not present, then create it and set its value.

json_update_logicaljson_moduleSubroutine

Given the path string, if the variable is present, and is a scalar, then update its value. If it is not present, then create it and set its value.

json_update_stringjson_moduleSubroutine

Given the path string, if the variable is present, and is a scalar, then update its value. If it is not present, then create it and set its value.

json_update_string_name_asciijson_moduleSubroutine

Alternate version of json_update_string, where "name" is kind=CDK.

json_update_string_val_asciijson_moduleSubroutine

Alternate version of json_update_string, where "val" is kind=CDK.

json_value_add_doublejson_moduleSubroutine

Add a real value child to the json_value variable

json_value_add_double_vecjson_moduleSubroutine

Add a real vector to the structure.

json_value_add_integerjson_moduleSubroutine

Add an integer value child to the json_value variable

json_value_add_integer_vecjson_moduleSubroutine

Add an integer vector to the structure.

json_value_add_logicaljson_moduleSubroutine

Add a logical value child to the json_value variable

json_value_add_logical_vecjson_moduleSubroutine

Add a logical vector to the structure.

json_value_add_memberjson_moduleSubroutine

Adds "member" as a child of "me".

json_value_add_stringjson_moduleSubroutine

Add a character string child to the json_value variable.

json_value_add_string_name_asciijson_moduleSubroutine

Alternate version of json_value_add_string where "name" is kind=CDK.

json_value_add_string_val_asciijson_moduleSubroutine

Alternate version of json_value_add_string where "val" is kind=CDK.

json_value_add_string_vecjson_moduleSubroutine

Add an array of character strings to the structure.

json_value_add_string_vec_name_asciijson_moduleSubroutine

Alternate version of json_value_add_string_vec where "name" is kind=CDK.

json_value_add_string_vec_val_asciijson_moduleSubroutine

Alternate version of json_value_add_string_vec where "val" is kind=CDK.

json_value_createjson_moduleSubroutine

Allocate a json_value pointer variable. This should be called before adding data to it.

json_value_create_arrayjson_moduleSubroutine

Allocate a json_value pointer and make it an array variable. The pointer should not already be allocated.

json_value_create_doublejson_moduleSubroutine

Allocate a json_value pointer and make it a real(RK) variable. The pointer should not already be allocated.

json_value_create_integerjson_moduleSubroutine

Allocate a json_value pointer and make it an integer(IK) variable. The pointer should not already be allocated.

json_value_create_logicaljson_moduleSubroutine

Allocate a json_value pointer and make it a logical(LK) variable. The pointer should not already be allocated.

json_value_create_nulljson_moduleSubroutine

Allocate a json_value pointer and make it a null variable. The pointer should not already be allocated.

json_value_create_objectjson_moduleSubroutine

Allocate a json_value pointer and make it an object variable. The pointer should not already be allocated.

json_value_create_stringjson_moduleSubroutine

Allocate a json_value pointer and make it a string variable. The pointer should not already be allocated.

json_value_destroyjson_moduleSubroutine

Destroy a json_value linked-list structure.

json_value_get_by_indexjson_moduleSubroutine

Returns a child in the object or array given the index.

json_value_get_by_name_charsjson_moduleSubroutine

Returns a child in the object or array given the name string.

json_value_printjson_moduleSubroutine

Print the JSON structure to a string or a file.

json_value_removejson_moduleSubroutine

Remove a json_value (and all its children) from a linked-list structure, preserving the rest of the structure.

json_value_remove_if_presentjson_moduleSubroutine

Given the path string, remove the variable from the json_value structure, if it exists.

json_value_to_stringjson_moduleSubroutine

Print the json_value structure to an allocatable string.

parse_arrayjson_moduleSubroutine

Core parsing routine.

parse_for_charsjson_moduleSubroutine

Core parsing routine.

parse_numberjson_moduleSubroutine

Read a numerical value from the file (or string). The routine will determine if it is an integer or a double, and allocate the type accordingly.

parse_objectjson_moduleSubroutine

Core parsing routine.

parse_stringjson_moduleSubroutine

Parses a string while reading a JSON file.

parse_valuejson_moduleSubroutine

Core parsing routine.

pop_charjson_moduleFunction

Get the next character from the file (or string).

push_charjson_moduleSubroutine

Core routine.

read_filejf_test_9_modSubroutine

Reads the contents of the file into the allocatable string str. If there are any problems, str will be returned unallocated.

real_to_stringjson_moduleSubroutine

Convert a real value to a string.

renamejf_test_14_modSubroutine

change all "name" variable values to "Fred"

string_to_doublejson_moduleFunction

Convert a string into a double.

string_to_integerjson_moduleFunction

Convert a string into an integer.

test_1jf_test_1_modSubroutine

Read a sample JSON file and retrieve some data from it

test_10jf_test_10_modSubroutine

Test some of the lesser-used features of the library

test_11jf_test_11_modSubroutine

Read the file and extract some data from it.

test_12jf_test_12_modSubroutine
test_13jf_test_13_modSubroutine

Tests different real format strings using repeated calls to json_initialize.

test_14jf_test_14_modSubroutine

Tests the traversal of a JSON structure

test_2jf_test_2_modSubroutine

Populate a JSON structure and write it to a file.

test_3jf_test_3_modSubroutine

Read the file generated in test_2, and extract some data from it.

test_4jf_test_4_modSubroutine

Populate a JSON structure, write it to a file, then read it.

test_5jf_test_5_modSubroutine

Github issue example: https://github.com/josephalevin/fson/issues/12

test_6jf_test_6_modSubroutine

This example tries to read an invalid JSON file.

test_7jf_test_7_modSubroutine

Indent test

test_8jf_test_8_modSubroutine

read a JSON structure from a string

test_9jf_test_9_modSubroutine

Open a random JSON file generated by http://www.json-generator.com

throw_exceptionjson_moduleInterface

Throw an exception.

to_arrayjson_moduleSubroutine

Change the json_value variable to an array.

to_doublejson_moduleSubroutine

Change the json_value variable to a double.

to_integerjson_moduleSubroutine

Change the json_value variable to an integer.

to_logicaljson_moduleSubroutine

Change the json_value variable to a logical.

to_nulljson_moduleSubroutine

Change the json_value variable to a null.

to_objectjson_moduleSubroutine

Change the json_value variable to an object.

to_stringjson_moduleSubroutine

Change the json_value variable to a string.

to_unijson_moduleFunction

Convert string to unicode (CDK to CK).

to_uni_vecjson_moduleFunction

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

to_unicodejson_moduleInterface

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

ucs4_comp_defaultjson_moduleFunction

CK==CDK operator.

ucs4_join_defaultjson_moduleFunction

CK//CDK operator.

valid_json_hexjson_moduleFunction

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

wrap_json_file_get_doublejson_moduleSubroutine

Alternate version of json_file_get_double, where "path" is kind=CDK.

wrap_json_file_get_double_vecjson_moduleSubroutine

Alternate version of json_file_get_double_vec, where "path" is kind=CDK.

wrap_json_file_get_integerjson_moduleSubroutine

Alternate version of json_file_get_integer, where "path" is kind=CDK.

wrap_json_file_get_integer_vecjson_moduleSubroutine

Alternate version of json_file_get_integer_vec, where "path" is kind=CDK.

wrap_json_file_get_logicaljson_moduleSubroutine

Alternate version of json_file_get_logical, where "path" is kind=CDK.

wrap_json_file_get_logical_vecjson_moduleSubroutine

Alternate version of json_file_get_logical_vec, where "path" is kind=CDK.

wrap_json_file_get_objectjson_moduleSubroutine

Alternate version of json_file_get_object, where "path" is kind=CDK.

wrap_json_file_get_stringjson_moduleSubroutine

Alternate version of json_file_get_string, where "path" is kind=CDK.

wrap_json_file_get_string_vecjson_moduleSubroutine

Alternate version of json_file_get_string_vec, where "path" is kind=CDK.

wrap_json_file_load_from_stringjson_moduleSubroutine

Alternate version of json_file_load_from_string, where "str" is kind=CDK.

wrap_json_file_update_integerjson_moduleSubroutine

Alternate version of json_file_update_integer, where "name" is kind=CDK.

wrap_json_file_update_logicaljson_moduleSubroutine

Alternate version of json_file_update_logical, where "name" is kind=CDK.

wrap_json_file_update_realjson_moduleSubroutine

Alternate version of json_file_update_real, where "name" is kind=CDK.

wrap_json_file_update_stringjson_moduleSubroutine

Alternate version of json_file_update_string, where "name" and "val" are kind=CDK.

wrap_json_file_variable_infojson_moduleSubroutine

Alternate version of json_file_variable_info, where "path" is kind=CDK.

wrap_json_get_array_with_pathjson_moduleSubroutine

Alternate version of json_get_array_with_path, where "path" is kind=CDK

wrap_json_get_by_pathjson_moduleSubroutine

Alternate version of json_get_by_path where "path" is kind=CDK.

wrap_json_get_double_vec_with_pathjson_moduleSubroutine

Alternate version of json_get_double_vec_with_path, where "path" is kind=CDK

wrap_json_get_double_with_pathjson_moduleSubroutine

Alternate version of json_get_double_with_path, where "path" is kind=CDK

wrap_json_get_integer_vec_with_pathjson_moduleSubroutine

Alternate version of json_get_integer_vec_with_path, where "path" is kind=CDK

wrap_json_get_integer_with_pathjson_moduleSubroutine

Alternate version of json_get_integer_with_path, where "path" is kind=CDK.

wrap_json_get_logical_vec_with_pathjson_moduleSubroutine

Alternate version of json_get_logical_vec_with_path, where "path" is kind=CDK

wrap_json_get_logical_with_pathjson_moduleSubroutine

Alternate version of json_get_logical_with_path, where "path" is kind=CDK

wrap_json_get_string_vec_with_pathjson_moduleSubroutine

Alternate version of json_get_string_vec_with_path, where "path" is kind=CDK

wrap_json_get_string_with_pathjson_moduleSubroutine

Alternate version of json_get_string_with_path, where "path" is kind=CDK

wrap_json_parse_stringjson_moduleSubroutine

Alternate version of json_parse_string, where "str" is kind=CDK.

wrap_json_throw_exceptionjson_moduleSubroutine

Alternate version of json_throw_exception, where "msg" is kind=CDK.

wrap_json_update_doublejson_moduleSubroutine

Alternate version of json_update_double, where "name" is kind=CDK.

wrap_json_update_integerjson_moduleSubroutine

Alternate version of json_update_integer, where "name" is kind=CDK.

wrap_json_update_logicaljson_moduleSubroutine

Alternate version of json_update_logical, where "name" is kind=CDK.

wrap_json_update_stringjson_moduleSubroutine

Alternate version of json_update_string, where "name" and "value" are kind=CDK.

wrap_json_value_add_doublejson_moduleSubroutine

Alternate version of json_value_add_double where "name" is kind=CDK.

wrap_json_value_add_double_vecjson_moduleSubroutine

Alternate version of json_value_add_double_vec where "name" is kind=CDK.

wrap_json_value_add_integerjson_moduleSubroutine

Alternate version of json_value_add_integer where "name" is kind=CDK.

wrap_json_value_add_integer_vecjson_moduleSubroutine

Alternate version of json_value_add_integer_vec where "name" is kind=CDK.

wrap_json_value_add_logicaljson_moduleSubroutine

Alternate version of json_value_add_logical where "name" is kind=CDK.

wrap_json_value_add_logical_vecjson_moduleSubroutine

Alternate version of json_value_add_logical_vec where "name" is kind=CDK.

wrap_json_value_add_stringjson_moduleSubroutine

Alternate version of json_value_add_string where "name" and "val" are kind=CDK.

wrap_json_value_add_string_vecjson_moduleSubroutine

Alternate version of json_value_add_string_vec where "name" and "val" are kind=CDK.

wrap_json_value_create_arrayjson_moduleSubroutine

A wrapper for json_value_create_array so that json_create_array may be called with an actual argument, corresponding to the dummy argument 'name', that is either of 'DEFAULT' or 'ISO_10646' character kind.

wrap_json_value_create_doublejson_moduleSubroutine

A wrapper for json_value_create_double so that json_create_double may be called with an actual argument corresponding to the dummy argument, 'name' that may be of 'DEFAULT' or 'ISO_10646' character kind.

wrap_json_value_create_integerjson_moduleSubroutine

A wrapper procedure for json_value_create_integer so that json_create_integer may be called with either a 'DEFAULT' or 'ISO_10646' character kind 'name' actual argument.

wrap_json_value_create_logicaljson_moduleSubroutine

Wrapper for json_value_create_logical so json_create_logical can be called with name of character kind 'DEFAULT' or 'ISO_10646'

wrap_json_value_create_nulljson_moduleSubroutine

Wrap json_value_create_null so that json_create_null may be called with an actual argument corresponding to the dummy argument 'name' that is either of 'DEFAULT' or 'ISO_10646' character kind.

wrap_json_value_create_objectjson_moduleSubroutine

Wrap json_value_create_object so that json_create_object may be called with an actual argument corresponding to the dummy argument 'name' that is of either 'DEFAULT' or 'ISO_10646' character kind.

wrap_json_value_create_stringjson_moduleSubroutine

Wrap json_value_create_string so that json_create_string may be called with actual character string arguments for 'name' and 'val' that are BOTH of 'DEFAULT' or 'ISO_10646' character kind.

wrap_json_value_get_by_name_charsjson_moduleSubroutine

Alternate version of json_value_get_by_name_chars where "name" is kind=CDK.

wrap_json_value_remove_if_presentjson_moduleSubroutine

Alternate version of json_value_remove_if_present, where "name" is kind=CDK.