MCPcopy Create free account
hub / github.com/Kitware/VTK / WriteAppendedDataOffset

Method WriteAppendedDataOffset

IO/XML/vtkXMLWriter.cxx:906–931  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

904
905//------------------------------------------------------------------------------
906void vtkXMLWriter::WriteAppendedDataOffset(
907 vtkTypeInt64 streamPos, vtkTypeInt64& lastoffset, const char* attr)
908{
909 // Write an XML attribute with the given name. The value is the
910 // current appended data offset. Starts writing at the given stream
911 // position, and returns the ending position. If attr is 0, writes
912 // only the double quotes. In all cases, the final stream position
913 // is left the same as before the call.
914 ostream& os = *(this->Stream);
915 vtkTypeInt64 returnPos = os.tellp();
916 vtkTypeInt64 offset = returnPos - this->AppendedDataPosition;
917 lastoffset = offset; // saving result
918 os.seekp(std::streampos(streamPos));
919 if (attr)
920 {
921 os << " " << attr << "=";
922 }
923 os << "\"" << offset << "\"";
924 os.seekp(std::streampos(returnPos));
925
926 os.flush();
927 if (os.fail())
928 {
929 this->SetErrorCode(vtkErrorCode::GetLastSystemError());
930 }
931}
932
933//------------------------------------------------------------------------------
934void vtkXMLWriter::ForwardAppendedDataOffset(

Callers 1

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected