Print the json_value structure to a file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(json_core), | intent(inout) | :: | json | |||
type(json_value), | intent(in), | pointer | :: | p | ||
integer(kind=IK), | intent(in) | :: | iunit | the file unit (the file must already have been opened, can’t be -1). |
subroutine json_print_to_unit(json,p,iunit)
implicit none
class(json_core),intent(inout) :: json
type(json_value),pointer,intent(in) :: p
integer(IK),intent(in) :: iunit !! the file unit (the file must
!! already have been opened, can't be -1).
character(kind=CK,len=:),allocatable :: dummy !! dummy for `str` argument
!! to [[json_value_print]]
integer(IK) :: idummy !! dummy for `iloc` argument
!! to [[json_value_print]]
if (iunit/=unit2str) then
idummy = 0_IK
call json%json_value_print(p,iunit,str=dummy,iloc=idummy,indent=1_IK,colon=.true.)
else
call json%throw_exception('Error in json_print_to_unit: iunit must not be -1.')
end if
end subroutine json_print_to_unit