@@ -197,7 +197,7 @@ module json_module
197
197
! json_file
198
198
!
199
199
! DESCRIPTION
200
- ! The json_file is the main public class that is
200
+ ! The json_file is the main public class that is
201
201
! used to open a file and get data from it.
202
202
!
203
203
! EXAMPLE
@@ -345,9 +345,20 @@ end subroutine array_callback_func
345
345
end interface json_get
346
346
! *************************************************************************************
347
347
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
348
358
interface json_print_to_string
349
359
module procedure :: json_value_to_string
350
360
end interface
361
+ ! *************************************************************************************
351
362
352
363
! *************************************************************************************
353
364
! ****f* json_module/json_print
@@ -370,17 +381,59 @@ end subroutine array_callback_func
370
381
end interface
371
382
! *************************************************************************************
372
383
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
373
401
interface json_destroy
374
402
module procedure :: json_value_destroy
375
403
end interface
404
+ ! *************************************************************************************
376
405
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
377
418
interface json_remove
378
419
module procedure :: json_value_remove
379
420
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
381
433
interface json_remove_if_present
382
434
module procedure :: json_value_remove_if_present
383
435
end interface
436
+ ! *************************************************************************************
384
437
385
438
! public routines:
386
439
public :: json_initialize ! to initialize the module
@@ -391,8 +444,7 @@ end subroutine array_callback_func
391
444
public :: json_clear_exceptions ! clear exceptions
392
445
public :: json_check_for_errors ! check for error and get error message
393
446
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.
396
448
public :: json_value_add ! add data to a JSON structure
397
449
public :: json_update ! update a value in a JSON structure
398
450
public :: json_get ! get data from the JSON structure
@@ -423,7 +475,7 @@ end subroutine array_callback_func
423
475
! *****************************************************************************************
424
476
425
477
! *****************************************************************************************
426
- ! ****f * json_module/destroy_json_data_non_polymorphic
478
+ ! ****if * json_module/destroy_json_data_non_polymorphic
427
479
!
428
480
! NAME
429
481
! destroy_json_data_non_polymorphic
@@ -1226,6 +1278,7 @@ end subroutine json_value_destroy
1226
1278
! DESCRIPTION
1227
1279
! Remove and destroy a json_value (and all its children)
1228
1280
! from a linked-list structure.
1281
+ ! The rest of the structure is preserved.
1229
1282
!
1230
1283
! AUTHOR
1231
1284
! Jacob Williams : 9/9/2014
@@ -4531,7 +4584,7 @@ end subroutine push_char
4531
4584
! *****************************************************************************************
4532
4585
4533
4586
! *****************************************************************************************
4534
- ! ****f * json_module/integer_to_string
4587
+ ! ****if * json_module/integer_to_string
4535
4588
!
4536
4589
! NAME
4537
4590
! integer_to_string
0 commit comments