@@ -197,7 +197,7 @@ module json_module
197197 ! json_file
198198 !
199199 ! DESCRIPTION
200- ! The json_file is the main public class that is
200+ ! The json_file is the main public class that is
201201 ! used to open a file and get data from it.
202202 !
203203 ! EXAMPLE
@@ -345,9 +345,20 @@ end subroutine array_callback_func
345345 end interface json_get
346346 ! *************************************************************************************
347347
348+ ! *************************************************************************************
349+ ! ****f* json_module/json_print_to_string
350+ !
351+ ! NAME
352+ ! json_print_to_string
353+ !
354+ ! DESCRIPTION
355+ ! Print the json_value structure to an allocatable string.
356+ !
357+ ! SOURCE
348358 interface json_print_to_string
349359 module procedure :: json_value_to_string
350360 end interface
361+ ! *************************************************************************************
351362
352363 ! *************************************************************************************
353364 ! ****f* json_module/json_print
@@ -370,17 +381,59 @@ end subroutine array_callback_func
370381 end interface
371382 ! *************************************************************************************
372383
384+ ! *************************************************************************************
385+ ! ****f* json_module/json_destroy
386+ !
387+ ! NAME
388+ ! json_destroy
389+ !
390+ ! DESCRIPTION
391+ ! Destructor routine for a json_value pointer.
392+ ! This must be called explicitly if it is no longer needed,
393+ ! before it goes out of scope. Otherwise, a memory leak will result.
394+ !
395+ ! USAGE
396+ ! type(json_value) :: p
397+ ! ...
398+ ! call json_destroy(p)
399+ !
400+ ! SOURCE
373401 interface json_destroy
374402 module procedure :: json_value_destroy
375403 end interface
404+ ! *************************************************************************************
376405
406+ ! *************************************************************************************
407+ ! ****f* json_module/json_remove
408+ !
409+ ! NAME
410+ ! json_remove
411+ !
412+ ! DESCRIPTION
413+ ! Remove and destroy a json_value (and all its children)
414+ ! from a linked-list structure.
415+ ! The rest of the structure is preserved.
416+ !
417+ ! SOURCE
377418 interface json_remove
378419 module procedure :: json_value_remove
379420 end interface
380-
421+ ! *************************************************************************************
422+
423+ ! *************************************************************************************
424+ ! ****f* json_module/json_remove_if_present
425+ !
426+ ! NAME
427+ ! json_remove_if_present
428+ !
429+ ! DESCRIPTION
430+ ! If the child variable is present, then remove it.
431+ !
432+ ! SOURCE
381433 interface json_remove_if_present
382434 module procedure :: json_value_remove_if_present
383435 end interface
436+ ! *************************************************************************************
384437
385438 ! public routines:
386439 public :: json_initialize ! to initialize the module
@@ -391,8 +444,7 @@ end subroutine array_callback_func
391444 public :: json_clear_exceptions ! clear exceptions
392445 public :: json_check_for_errors ! check for error and get error message
393446 public :: json_failed ! check for error
394- public :: json_value_get ! use either a 1 based index or member
395- ! name to get a json_value.
447+ public :: json_value_get ! use either a 1 based index or member name to get a json_value.
396448 public :: json_value_add ! add data to a JSON structure
397449 public :: json_update ! update a value in a JSON structure
398450 public :: json_get ! get data from the JSON structure
@@ -423,7 +475,7 @@ end subroutine array_callback_func
423475! *****************************************************************************************
424476
425477! *****************************************************************************************
426- ! ****f * json_module/destroy_json_data_non_polymorphic
478+ ! ****if * json_module/destroy_json_data_non_polymorphic
427479!
428480! NAME
429481! destroy_json_data_non_polymorphic
@@ -1226,6 +1278,7 @@ end subroutine json_value_destroy
12261278! DESCRIPTION
12271279! Remove and destroy a json_value (and all its children)
12281280! from a linked-list structure.
1281+ ! The rest of the structure is preserved.
12291282!
12301283! AUTHOR
12311284! Jacob Williams : 9/9/2014
@@ -4531,7 +4584,7 @@ end subroutine push_char
45314584! *****************************************************************************************
45324585
45334586! *****************************************************************************************
4534- ! ****f * json_module/integer_to_string
4587+ ! ****if * json_module/integer_to_string
45354588!
45364589! NAME
45374590! integer_to_string
0 commit comments