Print data with a pretty format.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_ini), | intent(in) | :: | self | File data. |
||
integer(kind=I4P), | intent(in) | :: | unit | Logic unit. |
||
character, | intent(in), | optional | :: | pref | Prefixing string. |
|
logical, | intent(in), | optional | :: | retain_comments | Flag for retaining eventual comments. |
|
integer(kind=I4P), | intent(out), | optional | :: | iostat | IO error. |
|
character, | intent(out), | optional | :: | iomsg | IO error message. |
subroutine print_file_ini(self, unit, pref, retain_comments, iostat, iomsg)
!< Print data with a pretty format.
class(file_ini), intent(in) :: self !< File data.
integer(I4P), intent(in) :: unit !< Logic unit.
character(*), optional, intent(in) :: pref !< Prefixing string.
logical, optional, intent(in) :: retain_comments !< Flag for retaining eventual comments.
integer(I4P), optional, intent(out) :: iostat !< IO error.
character(*), optional, intent(out) :: iomsg !< IO error message.
character(len=:), allocatable :: prefd !< Prefixing string.
logical :: rt_comm !< Flag for retaining eventual comments.
integer(I4P) :: iostatd !< IO error.
character(500) :: iomsgd !< Temporary variable for IO error message.
integer(I4P) :: s !< Counter.
prefd = '' ; if (present(pref)) prefd = pref
rt_comm = .false. ; if (present(retain_comments)) rt_comm = retain_comments
if (allocated(self%sections)) then
do s=1, size(self%sections, dim=1)
call self%sections(s)%print(pref=prefd, iostat=iostatd, iomsg=iomsgd, unit=unit, retain_comments=rt_comm)
enddo
endif
if (present(iostat)) iostat = iostatd
if (present(iomsg)) iomsg = iomsgd
endsubroutine print_file_ini