summaryrefslogtreecommitdiff
path: root/oox/inc/oox/ole/axbinaryreader.hxx
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-07 17:18:11 +0100
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-02-07 17:18:11 +0100
commit7a5084f1acacb0858588d4d0c82651e47ca9914f (patch)
treea92a5c9040270413f47cbf9eacc2605896c7ebb9 /oox/inc/oox/ole/axbinaryreader.hxx
parent09f7fc99c442d71852396d97ee1079f0d03901a0 (diff)
dr78: rework of stream handling, improve handling of very large streams (prevent loading entire stream into array or string, esp. dumper and VML import), full support of XComponentContext
Diffstat (limited to 'oox/inc/oox/ole/axbinaryreader.hxx')
-rw-r--r--oox/inc/oox/ole/axbinaryreader.hxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/oox/inc/oox/ole/axbinaryreader.hxx b/oox/inc/oox/ole/axbinaryreader.hxx
index f26075ff52eb..b986fc8065c6 100644
--- a/oox/inc/oox/ole/axbinaryreader.hxx
+++ b/oox/inc/oox/ole/axbinaryreader.hxx
@@ -40,7 +40,7 @@ namespace ole {
/** A wrapper for a binary input stream that supports aligned read operations.
The implementation does not support seeking back the wrapped stream. All
- seeking operations (tell, seek, align) are performed relative to the
+ seeking operations (tell, seekTo, align) are performed relative to the
position of the wrapped stream at construction time of this wrapper. It is
possible to construct this wrapper with an unseekable input stream without
loosing any functionality.
@@ -50,21 +50,26 @@ class AxAlignedInputStream : public BinaryInputStream
public:
explicit AxAlignedInputStream( BinaryInputStream& rInStrm );
+ /** Returns the size of the data this stream represents, if the wrapped
+ stream supports the size() operation. */
+ virtual sal_Int64 size() const;
/** Return the current relative stream position (relative to position of
the wrapped stream at construction time). */
virtual sal_Int64 tell() const;
/** Seeks the stream to the passed relative position, if it is behind the
current position. */
virtual void seek( sal_Int64 nPos );
+ /** Closes the input stream but not the wrapped stream. */
+ virtual void close();
/** Reads nBytes bytes to the passed sequence.
@return Number of bytes really read. */
- virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes );
+ virtual sal_Int32 readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Reads nBytes bytes to the (existing) buffer opMem.
@return Number of bytes really read. */
- virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes );
+ virtual sal_Int32 readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Seeks the stream forward by the passed number of bytes. */
- virtual void skip( sal_Int32 nBytes );
+ virtual void skip( sal_Int32 nBytes, size_t nAtomSize = 1 );
/** Aligns the stream to a multiple of the passed size (relative to the
position of the wrapped stream at construction time). */
@@ -78,8 +83,9 @@ public:
inline void skipAligned() { align( sizeof( Type ) ); skip( sizeof( Type ) ); }
private:
- BinaryInputStream& mrInStrm; /// The wrapped input stream.
+ BinaryInputStream* mpInStrm; /// The wrapped input stream.
sal_Int64 mnStrmPos; /// Tracks relative position in the stream.
+ sal_Int64 mnStrmSize; /// Size of the wrapped stream data.
};
// ============================================================================