LibreOffice Module oox (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
oox::ole::VbaInputStream Class Referencefinal

A non-seekable input stream that implements run-length decompression. More...

#include <vbainputstream.hxx>

Inheritance diagram for oox::ole::VbaInputStream:
[legend]
Collaboration diagram for oox::ole::VbaInputStream:
[legend]

Public Member Functions

 VbaInputStream (BinaryInputStream &rInStrm)
 
virtual sal_Int64 size () const override
 Returns -1, stream size is not determinable. More...
 
virtual sal_Int64 tell () const override
 Returns -1, stream position is not tracked. More...
 
virtual void seek (sal_Int64 nPos) override
 Does nothing, stream is not seekable. More...
 
virtual void close () override
 Closes the input stream but not the wrapped stream. More...
 
virtual sal_Int32 readData (StreamDataSequence &orData, sal_Int32 nBytes, size_t nAtomSize=1) override
 Reads nBytes bytes to the passed sequence. More...
 
virtual sal_Int32 readMemory (void *opMem, sal_Int32 nBytes, size_t nAtomSize=1) override
 Reads nBytes bytes to the (existing) buffer opMem. More...
 
virtual void skip (sal_Int32 nBytes, size_t nAtomSize=1) override
 Seeks the stream forward by the passed number of bytes. More...
 
- Public Member Functions inherited from oox::BinaryInputStream
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...
 

Private Types

typedef ::std::vector< sal_uInt8ChunkBuffer
 

Private Member Functions

bool updateChunk ()
 If no data left in chunk buffer, reads the next chunk from stream. More...
 

Private Attributes

BinaryInputStreammpInStrm
 
ChunkBuffer maChunk
 
size_t mnChunkPos
 

Additional Inherited Members

- Protected Member Functions inherited from oox::BinaryInputStream
 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)
 
- Protected Attributes inherited from oox::BinaryStreamBase
bool mbEof
 End of stream flag. More...
 

Detailed Description

A non-seekable input stream that implements run-length decompression.

Definition at line 34 of file vbainputstream.hxx.

Member Typedef Documentation

◆ ChunkBuffer

typedef ::std::vector< sal_uInt8 > oox::ole::VbaInputStream::ChunkBuffer
private

Definition at line 62 of file vbainputstream.hxx.

Constructor & Destructor Documentation

◆ VbaInputStream()

oox::ole::VbaInputStream::VbaInputStream ( BinaryInputStream rInStrm)
explicit

Member Function Documentation

◆ close()

void oox::ole::VbaInputStream::close ( )
overridevirtual

Closes the input stream but not the wrapped stream.

Implements oox::BinaryStreamBase.

Definition at line 62 of file vbainputstream.cxx.

References oox::BinaryStreamBase::mbEof, and mpInStrm.

◆ readData()

sal_Int32 oox::ole::VbaInputStream::readData ( StreamDataSequence orData,
sal_Int32  nBytes,
size_t  nAtomSize = 1 
)
overridevirtual

Reads nBytes bytes to the passed sequence.

Returns
Number of bytes really read.

Implements oox::BinaryInputStream.

Definition at line 68 of file vbainputstream.cxx.

References oox::BinaryStreamBase::mbEof, and readMemory().

◆ readMemory()

sal_Int32 oox::ole::VbaInputStream::readMemory ( void *  opMem,
sal_Int32  nBytes,
size_t  nAtomSize = 1 
)
overridevirtual

Reads nBytes bytes to the (existing) buffer opMem.

Returns
Number of bytes really read.

Implements oox::BinaryInputStream.

Definition at line 84 of file vbainputstream.cxx.

References maChunk, mnChunkPos, and updateChunk().

Referenced by readData().

◆ seek()

void oox::ole::VbaInputStream::seek ( sal_Int64  nPos)
overridevirtual

Does nothing, stream is not seekable.

Implements oox::BinaryStreamBase.

Definition at line 58 of file vbainputstream.cxx.

◆ size()

sal_Int64 oox::ole::VbaInputStream::size ( ) const
overridevirtual

Returns -1, stream size is not determinable.

Implements oox::BinaryStreamBase.

Definition at line 48 of file vbainputstream.cxx.

◆ skip()

void oox::ole::VbaInputStream::skip ( sal_Int32  nBytes,
size_t  nAtomSize = 1 
)
overridevirtual

Seeks the stream forward by the passed number of bytes.

Implements oox::BinaryInputStream.

Definition at line 101 of file vbainputstream.cxx.

References maChunk, mnChunkPos, and updateChunk().

◆ tell()

sal_Int64 oox::ole::VbaInputStream::tell ( ) const
overridevirtual

Returns -1, stream position is not tracked.

Implements oox::BinaryStreamBase.

Definition at line 53 of file vbainputstream.cxx.

◆ updateChunk()

bool oox::ole::VbaInputStream::updateChunk ( )
private

Member Data Documentation

◆ maChunk

ChunkBuffer oox::ole::VbaInputStream::maChunk
private

Definition at line 65 of file vbainputstream.hxx.

Referenced by readMemory(), skip(), updateChunk(), and VbaInputStream().

◆ mnChunkPos

size_t oox::ole::VbaInputStream::mnChunkPos
private

Definition at line 66 of file vbainputstream.hxx.

Referenced by readMemory(), skip(), and updateChunk().

◆ mpInStrm

BinaryInputStream* oox::ole::VbaInputStream::mpInStrm
private

Definition at line 64 of file vbainputstream.hxx.

Referenced by close(), and updateChunk().


The documentation for this class was generated from the following files: