json_file_print_to_filename Subroutine

private subroutine json_file_print_to_filename(me, filename)

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

Example

Example loading a JSON file, changing a value, and then printing result to a new file:

     type(json_file) :: f
     logical :: found
     call f%load('my_file.json')       !open the original file
     call f%update('version',4,found)  !change the value of a variable
     call f%print('my_file_2.json')    !save file as new name

Type Bound

json_file

Arguments

Type IntentOptional Attributes Name
class(json_file), intent(inout) :: me
character(kind=CDK, len=*), intent(in) :: filename

filename to print to


Source Code

    subroutine json_file_print_to_filename(me,filename)

    implicit none

    class(json_file),intent(inout)       :: me
    character(kind=CDK,len=*),intent(in) :: filename  !! filename to print to

    call me%core%print(me%p,filename)

    end subroutine json_file_print_to_filename