|
Globals Library 1.0
|
Derived data type to handle JSON data. More...
Public Member Functions | |
| generic, public | init (this) |
| Initialize the object as an empty JSON file/database. | |
| generic, public | init (this, str) |
| Initialize the object from a JSON string payload. | |
| generic, public | load_file (this, filename) |
| Construct a JSON structure from a JSON file path. | |
| generic, public | write (this) |
| Print the JSON object representation to standard output. | |
| generic, public | write (this, iunit) |
| Print the JSON object representation to a specific formatted Fortran unit. | |
| generic, public | write (this, filename) |
| Save the JSON object representation directly to a file. | |
| generic, public | clone (this, other) |
| Prepares native assignments logic deeply copies mapping JSON representation states. | |
| generic, public | has (this, path) |
| Verify if a specific path exists within the JSON tree. | |
| generic, public | rename (this, path, new_name) |
| Rename a node located at the specified path. | |
| generic, public | remove (this, path) |
| Remove a node located at the specified path entirely. | |
| generic, public | set_null (this, path) |
| Modifies payload hierarchy to explicitly associate a JSON null block. | |
| generic, public | set_null (this, path, nvalues) |
| Evaluates an explicitly formatted sized array mapped block of JSON null components. | |
| generic, public | set (this, path, value) |
| Setup a logical boolean value inside the JSON tree. | |
| generic, public | set (this, path, value) |
| Setup an integer value inside the JSON tree. | |
| generic, public | set (this, path, value) |
| Setup a float literal (double precision) value into JSON tree. | |
| generic, public | set (this, path, value) |
| Setup a JSON string scalar property. | |
| generic, public | set (this, path, value) |
| Append a deeply copied instance of another JSON object at path. | |
| generic, public | set (this, path, value) |
| Adds an array dimension of logic variables linearly. | |
| generic, public | set (this, path, value) |
| Adds an array block size containing integers to current root. | |
| generic, public | set (this, path, value) |
| Adds an array literal values consisting of double precisions. | |
| generic, public | get (this, path, value, default) |
| Retrive integer primitive from loaded property tree. | |
| generic, public | get (this, path, value, default) |
| Retrieve floating point double sequence type variable. | |
| generic, public | get (this, path, value, default) |
| Get a logical expression defined inside properties list mapping. | |
| generic, public | get (this, path, value, default) |
| Retrieve string character definitions loaded dynamically via parsed map length format. | |
| generic, public | get (this, path, value) |
| Parses a subtree and clones its content into an alternative object variable. | |
| generic, public | get (this, path, value, default) |
| Parses target dynamically evaluated integer matrix structure hierarchy sequences. | |
| generic, public | get (this, path, value, default) |
| Retrives continuous unmapped values sequence containing decimal arrays. | |
| generic, public | get (this, path, value, default) |
| Returns memory structure block sequences representing dynamically stored logic array data. | |
| generic, public | assignment (this, other) |
| Prepares native assignments logic deeply copies mapping JSON representation states. | |
| generic, public | assignment (this, str) |
| Initialize the object from a JSON string payload. | |
| generic, public | kill (this) |
| Destroys the JSON object and deallocates internal variables. | |
| final | finalize_json_type (this) |
| Finalization routine triggered implicitly when object goes out of scope or is destroyed. | |
Private Member Functions | |
| procedure, private | init_core (this) |
| Static constructor for internal JSON core settings. | |
| procedure, private | throw_error (this) |
| Checks for parsing/runtime errors and raises Fortran exception. | |
| procedure, private | init_empty (this) |
| Initialize the object as an empty JSON file/database. | |
| procedure, private | init_string (this, str) |
| Initialize the object from a JSON string payload. | |
| procedure, private | load_file_name (this, filename) |
| Construct a JSON structure from a JSON file path. | |
| procedure, private | write_to_console (this) |
| Print the JSON object representation to standard output. | |
| procedure, private | write_to_unit (this, iunit) |
| Print the JSON object representation to a specific formatted Fortran unit. | |
| procedure, private | write_to_file (this, filename) |
| Save the JSON object representation directly to a file. | |
| procedure, private | assign_json_type (this, other) |
| Prepares native assignments logic deeply copies mapping JSON representation states. | |
| procedure, private | check_path_is_valid (this, path) |
| Verify if a specific path exists within the JSON tree. | |
| procedure, private | rename_path (this, path, new_name) |
| Rename a node located at the specified path. | |
| procedure, private | remove_path (this, path) |
| Remove a node located at the specified path entirely. | |
| procedure, private | set_null_value (this, path) |
| Modifies payload hierarchy to explicitly associate a JSON null block. | |
| procedure, private | set_vec_null_value (this, path, nvalues) |
| Evaluates an explicitly formatted sized array mapped block of JSON null components. | |
| procedure, private | set_object (this, path, value) |
| Append a deeply copied instance of another JSON object at path. | |
| procedure, private | set_logical (this, path, value) |
| Setup a logical boolean value inside the JSON tree. | |
| procedure, private | set_integer (this, path, value) |
| Setup an integer value inside the JSON tree. | |
| procedure, private | set_real (this, path, value) |
| Setup a float literal (double precision) value into JSON tree. | |
| procedure, private | set_string (this, path, value) |
| Setup a JSON string scalar property. | |
| procedure, private | set_vec_logical (this, path, value) |
| Adds an array dimension of logic variables linearly. | |
| procedure, private | set_vec_integer (this, path, value) |
| Adds an array block size containing integers to current root. | |
| procedure, private | set_vec_real (this, path, value) |
| Adds an array literal values consisting of double precisions. | |
| procedure, private | get_object (this, path, value) |
| Parses a subtree and clones its content into an alternative object variable. | |
| procedure, private | get_integer (this, path, value, default) |
| Retrive integer primitive from loaded property tree. | |
| procedure, private | get_real (this, path, value, default) |
| Retrieve floating point double sequence type variable. | |
| procedure, private | get_logical (this, path, value, default) |
| Get a logical expression defined inside properties list mapping. | |
| procedure, private | get_string (this, path, value, default) |
| Retrieve string character definitions loaded dynamically via parsed map length format. | |
| procedure, private | get_vec_integer (this, path, value, default) |
| Parses target dynamically evaluated integer matrix structure hierarchy sequences. | |
| procedure, private | get_vec_real (this, path, value, default) |
| Retrives continuous unmapped values sequence containing decimal arrays. | |
| procedure, private | get_vec_logical (this, path, value, default) |
| Returns memory structure block sequences representing dynamically stored logic array data. | |
| procedure, private | kill_json_type (this) |
| Destroys the JSON object and deallocates internal variables. | |
Private Attributes | |
| type(json_file) | data |
| Internal json-fortran object representing the JSON database. | |
Derived data type to handle JSON data.
This type acts as a wrapper around json-fortran's json_file type. It simplifies the API and provides automatic error handling, initialization, and type-bound procedures for get/set operations.
Definition at line 16 of file modJsonData.f90.
|
final |
Finalization routine triggered implicitly when object goes out of scope or is destroyed.
Definition at line 80 of file modJsonData.f90.
|
private |
Static constructor for internal JSON core settings.
Sets the preferred configuration for json-fortran's core.
Definition at line 21 of file modJsonData.f90.
|
private |
Checks for parsing/runtime errors and raises Fortran exception.
If an error has been registered within the json_file instance, this subroutine throws a standard Fortran error stop with the message.
Definition at line 22 of file modJsonData.f90.
| generic, public jsondata::json_type::init | ( | class(json_type), intent(inout) | this | ) |
Initialize the object as an empty JSON file/database.
Definition at line 24 of file modJsonData.f90.
| generic, public jsondata::json_type::init | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | str ) |
Initialize the object from a JSON string payload.
| [in] | str | character string payload in JSON format |
Definition at line 24 of file modJsonData.f90.
|
private |
Initialize the object as an empty JSON file/database.
Definition at line 25 of file modJsonData.f90.
|
private |
Initialize the object from a JSON string payload.
| [in] | str | character string payload in JSON format |
Definition at line 26 of file modJsonData.f90.
| generic, public jsondata::json_type::load_file | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | filename ) |
Construct a JSON structure from a JSON file path.
| [in] | filename | path to the JSON file to parse |
Definition at line 28 of file modJsonData.f90.
|
private |
Construct a JSON structure from a JSON file path.
| [in] | filename | path to the JSON file to parse |
Definition at line 29 of file modJsonData.f90.
| generic, public jsondata::json_type::write | ( | class(json_type), intent(inout) | this | ) |
Print the JSON object representation to standard output.
Definition at line 31 of file modJsonData.f90.
| generic, public jsondata::json_type::write | ( | class(json_type), intent(inout) | this, |
| integer, intent(in) | iunit ) |
Print the JSON object representation to a specific formatted Fortran unit.
| [in] | iunit | integer, connected Fortran file unit |
Definition at line 31 of file modJsonData.f90.
| generic, public jsondata::json_type::write | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | filename ) |
Save the JSON object representation directly to a file.
| [in] | filename | name of the output JSON file |
Definition at line 31 of file modJsonData.f90.
|
private |
Print the JSON object representation to standard output.
Definition at line 32 of file modJsonData.f90.
|
private |
Print the JSON object representation to a specific formatted Fortran unit.
| [in] | iunit | integer, connected Fortran file unit |
Definition at line 33 of file modJsonData.f90.
|
private |
Save the JSON object representation directly to a file.
| [in] | filename | name of the output JSON file |
Definition at line 34 of file modJsonData.f90.
| generic, public jsondata::json_type::clone | ( | class(json_type), intent(out) | this, |
| type(json_type), intent(in) | other ) |
Prepares native assignments logic deeply copies mapping JSON representation states.
| [in] | other | representation data map wrapper struct source variable reference structure target |
Definition at line 36 of file modJsonData.f90.
|
private |
Prepares native assignments logic deeply copies mapping JSON representation states.
| [in] | other | representation data map wrapper struct source variable reference structure target |
Definition at line 37 of file modJsonData.f90.
| generic, public jsondata::json_type::has | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path ) |
Verify if a specific path exists within the JSON tree.
| [in] | path | valid JSONPath style or key path |
Definition at line 39 of file modJsonData.f90.
|
private |
Verify if a specific path exists within the JSON tree.
| [in] | path | valid JSONPath style or key path |
Definition at line 40 of file modJsonData.f90.
| generic, public jsondata::json_type::rename | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| character(len=*), intent(in) | new_name ) |
Rename a node located at the specified path.
| [in] | path | path to the node to rename |
| [in] | new_name | new string identifier for the node |
Definition at line 42 of file modJsonData.f90.
|
private |
Rename a node located at the specified path.
| [in] | path | path to the node to rename |
| [in] | new_name | new string identifier for the node |
Definition at line 43 of file modJsonData.f90.
| generic, public jsondata::json_type::remove | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path ) |
Remove a node located at the specified path entirely.
| [in] | path | path to the node to remove |
Definition at line 45 of file modJsonData.f90.
|
private |
Remove a node located at the specified path entirely.
| [in] | path | path to the node to remove |
Definition at line 46 of file modJsonData.f90.
| generic, public jsondata::json_type::set_null | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path ) |
Modifies payload hierarchy to explicitly associate a JSON null block.
| [in] | path | JSON property where null literal representation is added mapping identifier sequence |
Definition at line 48 of file modJsonData.f90.
| generic, public jsondata::json_type::set_null | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| integer, intent(in) | nvalues ) |
Evaluates an explicitly formatted sized array mapped block of JSON null components.
| [in] | path | directory sequence pointer map parameter reference string identifier |
| [in] | nvalues | amount of mapped identical logical NULL array sequence size representation vector |
Definition at line 48 of file modJsonData.f90.
|
private |
Modifies payload hierarchy to explicitly associate a JSON null block.
| [in] | path | JSON property where null literal representation is added mapping identifier sequence |
Definition at line 49 of file modJsonData.f90.
|
private |
Evaluates an explicitly formatted sized array mapped block of JSON null components.
| [in] | path | directory sequence pointer map parameter reference string identifier |
| [in] | nvalues | amount of mapped identical logical NULL array sequence size representation vector |
Definition at line 50 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| logical, intent(in) | value ) |
Setup a logical boolean value inside the JSON tree.
| [in] | path | target property path |
| [in] | value | target scalar array to map |
Definition at line 52 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| integer, intent(in) | value ) |
Setup an integer value inside the JSON tree.
| [in] | path | target property path |
| [in] | value | target scalar to map |
Definition at line 52 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| real(kind=double), intent(in) | value ) |
Setup a float literal (double precision) value into JSON tree.
| [in] | path | target property path |
| [in] | value | target scalar to map |
Definition at line 52 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| character(len=*), intent(in) | value ) |
Setup a JSON string scalar property.
| [in] | path | target property path |
| [in] | value | character string to add |
Definition at line 52 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| type(json_type), intent(inout) | value ) |
Append a deeply copied instance of another JSON object at path.
| [in] | path | path where the new object will be inserted |
| [in,out] | value | standard json_type object (content will be copied) |
Definition at line 52 of file modJsonData.f90.
|
private |
Append a deeply copied instance of another JSON object at path.
| [in] | path | path where the new object will be inserted |
| [in,out] | value | standard json_type object (content will be copied) |
Definition at line 53 of file modJsonData.f90.
|
private |
Setup a logical boolean value inside the JSON tree.
| [in] | path | target property path |
| [in] | value | target scalar array to map |
Definition at line 54 of file modJsonData.f90.
|
private |
Setup an integer value inside the JSON tree.
| [in] | path | target property path |
| [in] | value | target scalar to map |
Definition at line 55 of file modJsonData.f90.
|
private |
Setup a float literal (double precision) value into JSON tree.
| [in] | path | target property path |
| [in] | value | target scalar to map |
Definition at line 56 of file modJsonData.f90.
|
private |
Setup a JSON string scalar property.
| [in] | path | target property path |
| [in] | value | character string to add |
Definition at line 57 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| logical, dimension(:), intent(in) | value ) |
Adds an array dimension of logic variables linearly.
| [in] | path | target property path |
| [in] | value | logical dimension 1 vector mapping |
Definition at line 59 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| integer, dimension(:), intent(in) | value ) |
Adds an array block size containing integers to current root.
| [in] | path | target property path |
| [in] | value | integer target dimensions to add |
Definition at line 59 of file modJsonData.f90.
| generic, public jsondata::json_type::set | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| real(kind=double), dimension(:), intent(in) | value ) |
Adds an array literal values consisting of double precisions.
| [in] | path | target property path |
| [in] | value | sequence representing float point doubles |
Definition at line 59 of file modJsonData.f90.
|
private |
Adds an array dimension of logic variables linearly.
| [in] | path | target property path |
| [in] | value | logical dimension 1 vector mapping |
Definition at line 60 of file modJsonData.f90.
|
private |
Adds an array block size containing integers to current root.
| [in] | path | target property path |
| [in] | value | integer target dimensions to add |
Definition at line 61 of file modJsonData.f90.
|
private |
Adds an array literal values consisting of double precisions.
| [in] | path | target property path |
| [in] | value | sequence representing float point doubles |
Definition at line 62 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| integer, intent(out) | value, | ||
| integer, intent(in), optional | default ) |
Retrive integer primitive from loaded property tree.
| [in] | path | integer json path target to retrieve |
| [out] | value | output mapped variable memory target |
| [in] | default | integer default backup variable if path does not exist |
Definition at line 64 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| real(kind=double), intent(out) | value, | ||
| real(kind=double), intent(in), optional | default ) |
Retrieve floating point double sequence type variable.
| [in] | path | target search index representing object floating node |
| [out] | value | output double float mapped variable target |
| [in] | default | double precision backup variable definition |
Definition at line 64 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| logical, intent(out) | value, | ||
| logical, intent(in), optional | default ) |
Get a logical expression defined inside properties list mapping.
| [in] | path | structural map defining where local var resides |
| [out] | value | mapping output variable allocation logic |
| [in] | default | literal substitution default sequence expression |
Definition at line 64 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| character(len=:), intent(out), allocatable | value, | ||
| character(len=*), intent(in), optional | default ) |
Retrieve string character definitions loaded dynamically via parsed map length format.
| [in] | path | mapping representation block identifier parameter |
| [out] | value | explicit allocation string containing sequence variable loaded |
| [in] | default | base case default string text returned as alternative definition structure |
Definition at line 64 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| type(json_type), intent(inout) | value ) |
Parses a subtree and clones its content into an alternative object variable.
| [in] | path | json path identifier to load the object hierarchy |
| [in,out] | value | distinct json_type object constructed from that path copy |
Definition at line 64 of file modJsonData.f90.
|
private |
Parses a subtree and clones its content into an alternative object variable.
| [in] | path | json path identifier to load the object hierarchy |
| [in,out] | value | distinct json_type object constructed from that path copy |
Definition at line 65 of file modJsonData.f90.
|
private |
Retrive integer primitive from loaded property tree.
| [in] | path | integer json path target to retrieve |
| [out] | value | output mapped variable memory target |
| [in] | default | integer default backup variable if path does not exist |
Definition at line 66 of file modJsonData.f90.
|
private |
Retrieve floating point double sequence type variable.
| [in] | path | target search index representing object floating node |
| [out] | value | output double float mapped variable target |
| [in] | default | double precision backup variable definition |
Definition at line 67 of file modJsonData.f90.
|
private |
Get a logical expression defined inside properties list mapping.
| [in] | path | structural map defining where local var resides |
| [out] | value | mapping output variable allocation logic |
| [in] | default | literal substitution default sequence expression |
Definition at line 68 of file modJsonData.f90.
|
private |
Retrieve string character definitions loaded dynamically via parsed map length format.
| [in] | path | mapping representation block identifier parameter |
| [out] | value | explicit allocation string containing sequence variable loaded |
| [in] | default | base case default string text returned as alternative definition structure |
Definition at line 69 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| integer, dimension(:), intent(out), allocatable | value, | ||
| integer, dimension(:), intent(in), optional | default ) |
Parses target dynamically evaluated integer matrix structure hierarchy sequences.
| [in] | path | json-fortran query pointer representing valid location definitions array |
| [out] | value | parsed output list of dynamically typed integers map |
| [in] | default | alternative list sequence to bypass failing load tree elements logic structure |
Definition at line 71 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| real(kind=double), dimension(:), intent(out), allocatable | value, | ||
| real(kind=double), dimension(:), intent(in), optional | default ) |
Retrives continuous unmapped values sequence containing decimal arrays.
| [in] | path | standard map search component path lookup identifier map sequence |
| [out] | value | mapped data payload holding dynamic floating sequences size allocation |
| [in] | default | definition array fallback defaults representation |
Definition at line 71 of file modJsonData.f90.
| generic, public jsondata::json_type::get | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | path, | ||
| logical, dimension(:), intent(out), allocatable | value, | ||
| logical, dimension(:), intent(in), optional | default ) |
Returns memory structure block sequences representing dynamically stored logic array data.
| [in] | path | base location directory to find boolean maps vector |
| [out] | value | memory structure to assign found array boolean literals map dynamically |
| [in] | default | precomputed defaults mapping fallback sequence vector structure list |
Definition at line 71 of file modJsonData.f90.
|
private |
Parses target dynamically evaluated integer matrix structure hierarchy sequences.
| [in] | path | json-fortran query pointer representing valid location definitions array |
| [out] | value | parsed output list of dynamically typed integers map |
| [in] | default | alternative list sequence to bypass failing load tree elements logic structure |
Definition at line 72 of file modJsonData.f90.
|
private |
Retrives continuous unmapped values sequence containing decimal arrays.
| [in] | path | standard map search component path lookup identifier map sequence |
| [out] | value | mapped data payload holding dynamic floating sequences size allocation |
| [in] | default | definition array fallback defaults representation |
Definition at line 73 of file modJsonData.f90.
|
private |
Returns memory structure block sequences representing dynamically stored logic array data.
| [in] | path | base location directory to find boolean maps vector |
| [out] | value | memory structure to assign found array boolean literals map dynamically |
| [in] | default | precomputed defaults mapping fallback sequence vector structure list |
Definition at line 74 of file modJsonData.f90.
| generic, public jsondata::json_type::assignment | ( | class(json_type), intent(out) | this, |
| type(json_type), intent(in) | other ) |
Prepares native assignments logic deeply copies mapping JSON representation states.
| [in] | other | representation data map wrapper struct source variable reference structure target |
Definition at line 76 of file modJsonData.f90.
| generic, public jsondata::json_type::assignment | ( | class(json_type), intent(inout) | this, |
| character(len=*), intent(in) | str ) |
Initialize the object from a JSON string payload.
| [in] | str | character string payload in JSON format |
Definition at line 76 of file modJsonData.f90.
| generic, public jsondata::json_type::kill | ( | class(json_type), intent(inout) | this | ) |
Destroys the JSON object and deallocates internal variables.
Definition at line 78 of file modJsonData.f90.
|
private |
Destroys the JSON object and deallocates internal variables.
Definition at line 79 of file modJsonData.f90.
|
private |
Internal json-fortran object representing the JSON database.
Definition at line 19 of file modJsonData.f90.