ioffset_update Subroutine

private elemental subroutine ioffset_update(self, n_byte)

Arguments

TypeIntentOptionalAttributesName
class(xml_writer_appended), intent(inout) :: self
integer(kind=I4P), intent(in) :: n_byte

Contents

Source Code


Source Code

  elemental subroutine ioffset_update(self, n_byte)
  !< Update ioffset count.
  class(xml_writer_appended), intent(inout) :: self  !< Writer.
  integer(I4P),               intent(in)    :: n_byte !< Number of bytes saved.

  if (self%encoding=='raw') then
    self%ioffset = self%ioffset + BYI4P + n_byte
  else
    self%ioffset = self%ioffset + ((n_byte + BYI4P + 2_I4P)/3_I4P)*4_I4P
  endif
  endsubroutine ioffset_update