LibreOffice Module oox (master) 1
|
Base class for binary stream classes. More...
#include <binarystreambase.hxx>
Public Member Functions | |
virtual | ~BinaryStreamBase () |
virtual sal_Int64 | size () const =0 |
Implementations return the size of the stream, if possible. More... | |
virtual sal_Int64 | tell () const =0 |
Implementations return the current stream position, if possible. More... | |
virtual void | seek (sal_Int64 nPos)=0 |
Implementations seek the stream to the passed position, if the stream is seekable. More... | |
virtual void | close ()=0 |
Implementations close the stream. More... | |
bool | isSeekable () const |
Returns true, if the implementation supports the seek() operation. More... | |
bool | isEof () const |
Returns true, if the stream position is invalid (EOF). More... | |
sal_Int64 | getRemaining () const |
Returns the size of the remaining data available in the stream, if stream supports size() and tell(), otherwise -1. More... | |
void | seekToStart () |
Seeks the stream to the beginning, if stream is seekable. More... | |
void | alignToBlock (sal_Int32 nBlockSize, sal_Int64 nAnchorPos) |
Seeks the stream forward to a position that is a multiple of the passed block size, if stream is seekable. More... | |
Protected Member Functions | |
BinaryStreamBase (bool bSeekable) | |
Protected Attributes | |
bool | mbEof |
End of stream flag. More... | |
Private Member Functions | |
BinaryStreamBase (const BinaryStreamBase &)=delete | |
BinaryStreamBase & | operator= (const BinaryStreamBase &)=delete |
Private Attributes | |
const bool | mbSeekable |
True = implementation supports seeking. More... | |
Base class for binary stream classes.
Definition at line 39 of file binarystreambase.hxx.
|
virtual |
Definition at line 31 of file binarystreambase.cxx.
|
inlineexplicitprotected |
Definition at line 106 of file binarystreambase.hxx.
|
privatedelete |
void oox::BinaryStreamBase::alignToBlock | ( | sal_Int32 | nBlockSize, |
sal_Int64 | nAnchorPos | ||
) |
Seeks the stream forward to a position that is a multiple of the passed block size, if stream is seekable.
nBlockSize | The size of the data blocks the streams needs to be aligned to. |
nAnchorPos | Position in the stream the data blocks are aligned to. |
Definition at line 43 of file binarystreambase.cxx.
References mbSeekable, seek(), and tell().
Referenced by oox::ole::VbaFormControl::importEmbeddedSiteModels().
|
pure virtual |
Implementations close the stream.
Implemented in oox::BinaryXInputStream, oox::RelativeInputStream, oox::BinaryXOutputStream, oox::SequenceOutputStream, oox::BinaryXSeekableStream, oox::SequenceSeekableStream, oox::ole::AxAlignedInputStream, oox::ole::AxAlignedOutputStream, and oox::ole::VbaInputStream.
sal_Int64 oox::BinaryStreamBase::getRemaining | ( | ) | const |
Returns the size of the remaining data available in the stream, if stream supports size() and tell(), otherwise -1.
Definition at line 35 of file binarystreambase.cxx.
References nPos, size(), and tell().
Referenced by oox::crypto::DocumentDecryption::readEncryptionInfo(), and oox::RelativeInputStream::RelativeInputStream().
|
inline |
Returns true, if the stream position is invalid (EOF).
This flag turns true after the first attempt to seek/read beyond the stream end.
Definition at line 83 of file binarystreambase.hxx.
Referenced by oox::ole::AxAlignedInputStream::AxAlignedInputStream(), oox::ole::AxAlignedOutputStream::AxAlignedOutputStream(), oox::ole::AxBinaryPropertyWriter::ensureValid(), oox::ole::AxBinaryPropertyReader::ensureValid(), oox::dump::StorageObjectBase::extractStream(), oox::dump::DffStreamObject::implReadRecordHeader(), oox::dump::VbaDirStreamObject::implReadRecordHeader(), oox::dump::SequenceRecordObjectBase::implStartRecord(), oox::core::FilterBase::importBinaryData(), oox::ole::ComCtlModelBase::importBinaryModel(), oox::ole::ComCtlModelBase::importCommonPart(), oox::ole::ComCtlModelBase::importComplexPart(), oox::ole::VbaFormControl::importEmbeddedSiteModels(), oox::ole::VbaUserForm::importForm(), oox::ole::VbaFormControl::importModelOrStorage(), oox::ole::ComCtlModelBase::importSizePart(), oox::ole::OleHelper::importStdFont(), oox::ole::OleHelper::importStdPic(), oox::ole::VbaFormControl::importStorage(), oox::ole::AxControlFragment::onCreateContext(), oox::RelativeInputStream::readData(), oox::ole::AxAlignedInputStream::readData(), oox::ole::VbaHelper::readDirRecord(), oox::crypto::DocumentDecryption::readEncryptionInfo(), oox::crypto::Standard2007Engine::readEncryptionInfo(), oox::RelativeInputStream::readMemory(), oox::ole::AxAlignedInputStream::readMemory(), oox::ole::ComCtlModelBase::readPartHeader(), oox::ole::VbaModule::readSourceCode(), oox::ole::VbaProject::readVbaModules(), oox::RelativeInputStream::RelativeInputStream(), oox::RelativeInputStream::seek(), oox::ole::AxAlignedInputStream::skip(), oox::ole::VbaInputStream::updateChunk(), and oox::ole::VbaInputStream::VbaInputStream().
|
inline |
Returns true, if the implementation supports the seek() operation.
Implementations may still implement size() and tell() even if the stream is not seekable.
Definition at line 78 of file binarystreambase.hxx.
Referenced by oox::dump::SequenceRecordObjectBase::implStartRecord(), and oox::RelativeInputStream::seek().
|
privatedelete |
|
pure virtual |
Implementations seek the stream to the passed position, if the stream is seekable.
Implemented in oox::RelativeInputStream, oox::SequenceOutputStream, oox::BinaryXSeekableStream, oox::SequenceSeekableStream, oox::ole::AxAlignedInputStream, oox::ole::AxAlignedOutputStream, and oox::ole::VbaInputStream.
Referenced by alignToBlock(), oox::ole::ComCtlModelBase::importCommonPart(), oox::ole::VbaFormControl::importEmbeddedSiteModels(), oox::ole::VbaFormControl::importModelOrStorage(), oox::RelativeInputStream::seek(), oox::ole::AxAlignedOutputStream::seek(), and oox::ole::VbaInputStream::updateChunk().
|
inline |
Seeks the stream to the beginning, if stream is seekable.
Definition at line 92 of file binarystreambase.hxx.
Referenced by oox::core::RecordParser::parseStream().
|
pure virtual |
Implementations return the size of the stream, if possible.
This function may be implemented for some types of unseekable streams, and MUST be implemented for all seekable streams.
Implemented in oox::RelativeInputStream, oox::SequenceOutputStream, oox::BinaryXSeekableStream, oox::SequenceSeekableStream, oox::ole::AxAlignedInputStream, oox::ole::AxAlignedOutputStream, and oox::ole::VbaInputStream.
Referenced by getRemaining(), oox::dump::SequenceRecordObjectBase::implStartRecord(), oox::ole::HtmlSelectModel::importBinaryModel(), and oox::ole::HtmlTextBoxModel::importBinaryModel().
|
pure virtual |
Implementations return the current stream position, if possible.
This function may be implemented for some types of unseekable streams, and MUST be implemented for all seekable streams.
Implemented in oox::RelativeInputStream, oox::SequenceOutputStream, oox::BinaryXSeekableStream, oox::SequenceSeekableStream, oox::ole::AxAlignedInputStream, oox::ole::AxAlignedOutputStream, and oox::ole::VbaInputStream.
Referenced by alignToBlock(), getRemaining(), oox::dump::SequenceRecordObjectBase::implStartRecord(), oox::ole::ComCtlModelBase::importCommonPart(), oox::ole::VbaFormControl::importEmbeddedSiteModels(), oox::ole::VbaFormControl::importModelOrStorage(), oox::ole::AxAlignedOutputStream::pad(), oox::ole::AxAlignedOutputStream::seek(), oox::ole::VbaInputStream::updateChunk(), oox::ole::AxAlignedOutputStream::writeData(), and oox::ole::AxAlignedOutputStream::writeMemory().
|
protected |
End of stream flag.
Definition at line 113 of file binarystreambase.hxx.
Referenced by oox::ole::AxAlignedInputStream::AxAlignedInputStream(), oox::ole::AxAlignedOutputStream::AxAlignedOutputStream(), oox::BinaryXInputStream::BinaryXInputStream(), oox::BinaryXOutputStream::BinaryXOutputStream(), oox::RelativeInputStream::close(), oox::SequenceOutputStream::close(), oox::BinaryXSeekableStream::close(), oox::SequenceSeekableStream::close(), oox::ole::AxAlignedInputStream::close(), oox::ole::AxAlignedOutputStream::close(), oox::ole::VbaInputStream::close(), oox::BinaryInputStream::readArray(), oox::BinaryXInputStream::readData(), oox::SequenceInputStream::readData(), oox::RelativeInputStream::readData(), oox::ole::AxAlignedInputStream::readData(), oox::ole::VbaInputStream::readData(), oox::BinaryXInputStream::readMemory(), oox::SequenceInputStream::readMemory(), oox::RelativeInputStream::readMemory(), oox::ole::AxAlignedInputStream::readMemory(), oox::BinaryInputStream::readNulUnicodeArray(), oox::RelativeInputStream::RelativeInputStream(), oox::RelativeInputStream::seek(), oox::SequenceOutputStream::seek(), oox::BinaryXSeekableStream::seek(), oox::SequenceSeekableStream::seek(), oox::ole::AxAlignedInputStream::seek(), oox::ole::AxAlignedOutputStream::seek(), oox::BinaryXInputStream::skip(), oox::SequenceInputStream::skip(), oox::RelativeInputStream::skip(), oox::ole::AxAlignedInputStream::skip(), oox::ole::VbaInputStream::updateChunk(), and oox::ole::VbaInputStream::VbaInputStream().
|
private |
True = implementation supports seeking.
Definition at line 116 of file binarystreambase.hxx.
Referenced by alignToBlock().