LibreOffice Module oox (master) 1
|
Interface for binary input stream classes. More...
#include <binaryinputstream.hxx>
Public Member Functions | |
virtual sal_Int32 | readData (StreamDataSequence &orData, sal_Int32 nBytes, size_t nAtomSize=1)=0 |
Derived classes implement reading nBytes bytes to the passed sequence. More... | |
virtual sal_Int32 | readMemory (void *opMem, sal_Int32 nBytes, size_t nAtomSize=1)=0 |
Derived classes implement reading nBytes bytes to the (preallocated!) memory buffer opMem. More... | |
virtual void | skip (sal_Int32 nBytes, size_t nAtomSize=1)=0 |
Derived classes implement seeking the stream forward by the passed number of bytes. More... | |
template<typename Type > | |
Type | readValue () |
Reads a value from the stream and converts it to platform byte order. More... | |
sal_Int8 | readInt8 () |
sal_uInt8 | readuInt8 () |
sal_Int16 | readInt16 () |
sal_uInt16 | readuInt16 () |
sal_Int32 | readInt32 () |
sal_uInt32 | readuInt32 () |
sal_Int64 | readInt64 () |
float | readFloat () |
double | readDouble () |
unsigned char | readuChar () |
template<typename Type > | |
sal_Int32 | readArray (Type *opnArray, sal_Int32 nElemCount) |
Reads a (preallocated!) C array of values from the stream. More... | |
template<typename Type > | |
sal_Int32 | readArray (::std::vector< Type > &orVector, sal_Int32 nElemCount) |
Reads a vector of values from the stream. More... | |
OUString | readNulUnicodeArray () |
Reads a NUL-terminated Unicode character array and returns the string. More... | |
OString | readCharArray (sal_Int32 nChars) |
Reads a byte character array and returns the string. More... | |
OUString | readCharArrayUC (sal_Int32 nChars, rtl_TextEncoding eTextEnc) |
Reads a byte character array and returns a Unicode string. More... | |
OUString | readUnicodeArray (sal_Int32 nChars) |
Reads a Unicode character array and returns the string. More... | |
OUString | readCompressedUnicodeArray (sal_Int32 nChars, bool bCompressed) |
Reads a Unicode character array (may be compressed) and returns the string. More... | |
void | copyToStream (BinaryOutputStream &rOutStrm) |
Copies bytes from the current position to the passed output stream. More... | |
Public Member Functions inherited from oox::BinaryStreamBase | |
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 | |
BinaryInputStream () | |
This dummy default c'tor will never call the c'tor of the virtual base class BinaryStreamBase as this class cannot be instantiated directly. More... | |
Protected Member Functions inherited from oox::BinaryStreamBase | |
BinaryStreamBase (bool bSeekable) | |
Private Member Functions | |
BinaryInputStream (BinaryInputStream const &)=delete | |
BinaryInputStream & | operator= (BinaryInputStream const &)=delete |
Additional Inherited Members | |
Protected Attributes inherited from oox::BinaryStreamBase | |
bool | mbEof |
End of stream flag. More... | |
Interface for binary input stream classes.
The binary data in the stream is assumed to be in little-endian format.
Definition at line 49 of file binaryinputstream.hxx.
|
inlineprotected |
This dummy default c'tor will never call the c'tor of the virtual base class BinaryStreamBase as this class cannot be instantiated directly.
Definition at line 193 of file binaryinputstream.hxx.
|
privatedelete |
void oox::BinaryInputStream::copyToStream | ( | BinaryOutputStream & | rOutStrm | ) |
Copies bytes from the current position to the passed output stream.
Definition at line 105 of file binaryinputstream.cxx.
References aBuffer, readData(), SAL_MAX_INT64, and oox::BinaryOutputStream::writeData().
Referenced by oox::StorageBase::copyToStorage(), oox::dump::StorageObjectBase::extractStream(), and oox::core::FilterBase::importBinaryData().
|
privatedelete |
sal_Int32 oox::BinaryInputStream::readArray | ( | ::std::vector< Type > & | orVector, |
sal_Int32 | nElemCount | ||
) |
Reads a vector of values from the stream.
The vector will be resized internally. Converts all values in the vector to platform byte order. All data types supported by the ByteOrderConverter class can be used.
nElemCount | Number of elements to put into the vector (NOT byte count). |
Definition at line 226 of file binaryinputstream.hxx.
References readArray().
sal_Int32 oox::BinaryInputStream::readArray | ( | Type * | opnArray, |
sal_Int32 | nElemCount | ||
) |
Reads a (preallocated!) C array of values from the stream.
Converts all values in the array to platform byte order. All data types supported by the ByteOrderConverter class can be used.
nElemCount | Number of array elements to read (NOT byte count). |
Definition at line 213 of file binaryinputstream.hxx.
References oox::ByteOrderConverter::convertLittleEndianArray(), oox::BinaryStreamBase::mbEof, readMemory(), and SAL_MAX_INT32.
Referenced by readArray(), readCharArray(), oox::crypto::Standard2007Engine::readEncryptionInfo(), and readUnicodeArray().
OString oox::BinaryInputStream::readCharArray | ( | sal_Int32 | nChars | ) |
Reads a byte character array and returns the string.
NUL characters are replaced by question marks.
nChars | Number of characters (bytes) to read from the stream. |
Definition at line 54 of file binaryinputstream.cxx.
References aBuffer, and readArray().
Referenced by readCharArrayUC().
OUString oox::BinaryInputStream::readCharArrayUC | ( | sal_Int32 | nChars, |
rtl_TextEncoding | eTextEnc | ||
) |
Reads a byte character array and returns a Unicode string.
NUL characters are replaced by question marks.
nChars | Number of characters (bytes) to read from the stream. |
eTextEnc | The text encoding used to create the Unicode string. |
Definition at line 71 of file binaryinputstream.cxx.
References readCharArray().
Referenced by oox::ole::VbaModule::importDirRecords(), oox::ole::OleHelper::importStdFont(), readCompressedUnicodeArray(), and oox::ole::VbaProject::readVbaModules().
OUString oox::BinaryInputStream::readCompressedUnicodeArray | ( | sal_Int32 | nChars, |
bool | bCompressed | ||
) |
Reads a Unicode character array (may be compressed) and returns the string.
NUL characters are replaced by question marks (default).
nChars | Number of 8-bit or 16-bit characters to read from the stream. |
bCompressed | True = Character array is compressed (stored as 8-bit characters). False = Character array is not compressed (stored as 16-bit characters). |
Definition at line 97 of file binaryinputstream.cxx.
References readCharArrayUC(), and readUnicodeArray().
|
pure virtual |
Derived classes implement reading nBytes bytes to the passed sequence.
The sequence will be reallocated internally.
nAtomSize | The size of the elements in the memory block, if available. Derived classes may be interested in this information. |
Implemented in oox::BinaryXInputStream, oox::SequenceInputStream, oox::RelativeInputStream, oox::ole::AxAlignedInputStream, and oox::ole::VbaInputStream.
Referenced by copyToStream(), oox::dump::SequenceRecordObjectBase::implStartRecord(), oox::ole::OleHelper::importStdPic(), oox::RelativeInputStream::readData(), oox::ole::AxAlignedInputStream::readData(), and oox::ole::VbaHelper::readDirRecord().
|
inline |
Definition at line 109 of file binaryinputstream.hxx.
|
inline |
Definition at line 107 of file binaryinputstream.hxx.
Referenced by oox::ole::ComCtlProgressBarModel::importControlData().
|
inline |
Definition at line 97 of file binaryinputstream.hxx.
|
inline |
Definition at line 101 of file binaryinputstream.hxx.
Referenced by oox::dump::DffStreamObject::implReadRecordHeader(), oox::dump::VbaDirStreamObject::implReadRecordHeader(), oox::ole::ComCtlScrollBarModel::importControlData(), oox::ole::AxMultiPageModel::importPageAndMultiPageProperties(), oox::ole::ComCtlModelBase::importSizePart(), oox::ole::OleHelper::importStdPic(), oox::ole::VbaHelper::readDirRecord(), and oox::ole::AxBinaryPropertyReader::PairProperty::readProperty().
|
inline |
Definition at line 105 of file binaryinputstream.hxx.
Referenced by oox::ole::AxBinaryPropertyReader::AxBinaryPropertyReader().
|
inline |
Definition at line 93 of file binaryinputstream.hxx.
|
pure virtual |
Derived classes implement reading nBytes bytes to the (preallocated!) memory buffer opMem.
nAtomSize | The size of the elements in the memory block, if available. Derived classes may be interested in this information. |
Implemented in oox::BinaryXInputStream, oox::SequenceInputStream, oox::RelativeInputStream, oox::ole::AxAlignedInputStream, and oox::ole::VbaInputStream.
Referenced by readArray(), oox::RelativeInputStream::readMemory(), oox::ole::AxAlignedInputStream::readMemory(), readValue(), and oox::ole::VbaInputStream::updateChunk().
OUString oox::BinaryInputStream::readNulUnicodeArray | ( | ) |
Reads a NUL-terminated Unicode character array and returns the string.
Definition at line 42 of file binaryinputstream.cxx.
References aBuffer, oox::BinaryStreamBase::mbEof, and readuInt16().
Referenced by oox::ole::MSConvertOCXControls::ReadOCXStorage().
|
inline |
Definition at line 111 of file binaryinputstream.hxx.
Referenced by oox::ole::OleHelper::importStdFont(), and oox::ole::VbaInputStream::updateChunk().
|
inline |
Definition at line 99 of file binaryinputstream.hxx.
Referenced by oox::ole::AxBinaryPropertyReader::AxBinaryPropertyReader(), oox::dump::DffStreamObject::implReadRecordHeader(), oox::dump::VbaDirStreamObject::implReadRecordHeader(), oox::ole::AxContainerModelBase::importClassTable(), oox::ole::ComCtlProgressBarModel::importControlData(), oox::ole::OleHelper::importGuid(), oox::ole::OleHelper::importStdFont(), oox::ole::VbaHelper::readDirRecord(), readNulUnicodeArray(), oox::ole::ComCtlModelBase::readPartHeader(), oox::ole::VbaProject::readVbaModules(), and oox::ole::VbaInputStream::updateChunk().
|
inline |
Definition at line 103 of file binaryinputstream.hxx.
Referenced by oox::ole::AxBinaryPropertyReader::AxBinaryPropertyReader(), oox::crypto::AgileEngine::decrypt(), oox::crypto::Standard2007Engine::decrypt(), oox::ole::ComCtlModelBase::importBinaryModel(), oox::ole::ComCtlModelBase::importCommonPart(), oox::ole::ComCtlModelBase::importComplexPart(), oox::ole::ComCtlScrollBarModel::importControlData(), oox::ole::VbaModule::importDirRecords(), oox::ole::VbaFormControl::importEmbeddedSiteModels(), oox::ole::OleHelper::importGuid(), oox::ole::OleHelper::importStdFont(), oox::ole::OleHelper::importStdPic(), oox::crypto::DocumentDecryption::readEncryptionInfo(), oox::crypto::StrongEncryptionDataSpace::readEncryptionInfo(), oox::crypto::Standard2007Engine::readEncryptionInfo(), oox::ole::ComCtlModelBase::readPartHeader(), and oox::ole::AxBinaryPropertyReader::ArrayStringProperty::readProperty().
|
inline |
Definition at line 95 of file binaryinputstream.hxx.
Referenced by oox::ole::VbaFormControl::importEmbeddedSiteModels(), oox::ole::OleHelper::importGuid(), oox::ole::VbaInputStream::updateChunk(), and oox::ole::VbaInputStream::VbaInputStream().
OUString oox::BinaryInputStream::readUnicodeArray | ( | sal_Int32 | nChars | ) |
Reads a Unicode character array and returns the string.
NUL characters are replaced by question marks (default).
nChars | Number of 16-bit characters to read from the stream. |
Definition at line 76 of file binaryinputstream.cxx.
References aBuffer, and readArray().
Referenced by oox::ole::HtmlSelectModel::importBinaryModel(), oox::ole::HtmlTextBoxModel::importBinaryModel(), readCompressedUnicodeArray(), and oox::crypto::DocumentDecryption::readEncryptionInfo().
Reads a value from the stream and converts it to platform byte order.
All data types supported by the ByteOrderConverter class can be used.
Definition at line 204 of file binaryinputstream.hxx.
References oox::ByteOrderConverter::convertLittleEndian(), and readMemory().
|
pure virtual |
Derived classes implement seeking the stream forward by the passed number of bytes.
This should work for non-seekable streams too.
nAtomSize | The size of the elements in the memory block, if available. Derived classes may be interested in this information. |
Implemented in oox::BinaryXInputStream, oox::SequenceInputStream, oox::RelativeInputStream, oox::ole::AxAlignedInputStream, and oox::ole::VbaInputStream.
Referenced by oox::ole::ComCtlModelBase::importCommonPart(), oox::ole::VbaFormControl::importEmbeddedSiteModels(), oox::RelativeInputStream::skip(), and oox::ole::AxAlignedInputStream::skip().