diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-03-29 01:19:24 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-03-29 02:03:07 +0100 |
commit | 1258b576aef2ff3cdd4f44e1c03edb8c862a79f6 (patch) | |
tree | 80bbe4b11f5f7149ee64d50ecd55eb15e79839df /include | |
parent | 19bbfc0b39d79a90539fd3094d9b6d7d81619a45 (diff) |
tools: support 64-bit file positions in SvStream
Bump stream positions to 64 bits on:
SvLockBytes::SetSize()
SvStream::SeekPos()
SvStream::SetSize()
SvStream::SetStreamSize()
SvStream::Seek()
SvStream::SeekRel()
SvStream::Tell()
SvStream::remainingSize()
SvStream::nActPos
SvStream::nBufFilePos
Change-Id: I0521fd60d31d1a33e5634cbf51dd42edc46ad919
TODO: adapt callers of Seek()/SeekRel()/Tell()/remainingSize()
Diffstat (limited to 'include')
-rw-r--r-- | include/sot/storage.hxx | 6 | ||||
-rw-r--r-- | include/svl/instrm.hxx | 4 | ||||
-rw-r--r-- | include/svl/outstrm.hxx | 4 | ||||
-rw-r--r-- | include/svl/strmadpt.hxx | 2 | ||||
-rw-r--r-- | include/tools/pstm.hxx | 2 | ||||
-rw-r--r-- | include/tools/stream.hxx | 32 | ||||
-rw-r--r-- | include/unotools/ucblockbytes.hxx | 4 |
7 files changed, 27 insertions, 27 deletions
diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx index 2ce9bf565bb0..b0c5b4670733 100644 --- a/include/sot/storage.hxx +++ b/include/sot/storage.hxx @@ -56,7 +56,7 @@ friend class SotStorage; protected: virtual sal_uLong GetData( void* pData, sal_uLong nSize ) SAL_OVERRIDE; virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) SAL_OVERRIDE; - virtual sal_uLong SeekPos( sal_uLong nPos ) SAL_OVERRIDE; + virtual sal_uInt64 SeekPos(sal_uInt64 nPos) SAL_OVERRIDE; virtual void FlushData() SAL_OVERRIDE; ~SotStorageStream(); public: @@ -77,13 +77,13 @@ public: virtual void ResetError() SAL_OVERRIDE; - virtual void SetSize( sal_uLong nNewSize ) SAL_OVERRIDE; + virtual void SetSize( sal_uInt64 nNewSize ) SAL_OVERRIDE; sal_uInt32 GetSize() const; bool CopyTo( SotStorageStream * pDestStm ); virtual bool Commit(); virtual bool Revert(); bool SetProperty( const OUString& rName, const ::com::sun::star::uno::Any& rValue ); - virtual sal_Size remainingSize() SAL_OVERRIDE; + virtual sal_uInt64 remainingSize() SAL_OVERRIDE; }; #ifndef SOT_DECL_SOTSTORAGESTREAM_DEFINED diff --git a/include/svl/instrm.hxx b/include/svl/instrm.hxx index 149b0f74059a..441238f1382e 100644 --- a/include/svl/instrm.hxx +++ b/include/svl/instrm.hxx @@ -47,11 +47,11 @@ class SVL_DLLPUBLIC SvInputStream: public SvStream SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong) SAL_OVERRIDE; - SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong nPos) SAL_OVERRIDE; + SVL_DLLPRIVATE virtual sal_uInt64 SeekPos(sal_uInt64 nPos) SAL_OVERRIDE; SVL_DLLPRIVATE virtual void FlushData() SAL_OVERRIDE; - SVL_DLLPRIVATE virtual void SetSize(sal_uLong) SAL_OVERRIDE; + SVL_DLLPRIVATE virtual void SetSize(sal_uInt64) SAL_OVERRIDE; public: SvInputStream( diff --git a/include/svl/outstrm.hxx b/include/svl/outstrm.hxx index 8ab49a6d1da3..a0bea052689b 100644 --- a/include/svl/outstrm.hxx +++ b/include/svl/outstrm.hxx @@ -38,11 +38,11 @@ class SVL_DLLPUBLIC SvOutputStream: public SvStream SVL_DLLPRIVATE virtual sal_uLong PutData(void const * pData, sal_uLong nSize) SAL_OVERRIDE; - SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong) SAL_OVERRIDE; + SVL_DLLPRIVATE virtual sal_uInt64 SeekPos(sal_uInt64) SAL_OVERRIDE; SVL_DLLPRIVATE virtual void FlushData() SAL_OVERRIDE; - SVL_DLLPRIVATE virtual void SetSize(sal_uLong) SAL_OVERRIDE; + SVL_DLLPRIVATE virtual void SetSize(sal_uInt64) SAL_OVERRIDE; public: SvOutputStream(com::sun::star::uno::Reference< diff --git a/include/svl/strmadpt.hxx b/include/svl/strmadpt.hxx index 5f540566db92..872a8506cc3c 100644 --- a/include/svl/strmadpt.hxx +++ b/include/svl/strmadpt.hxx @@ -50,7 +50,7 @@ public: virtual ErrCode Flush() const SAL_OVERRIDE; - virtual ErrCode SetSize(sal_uLong) SAL_OVERRIDE; + virtual ErrCode SetSize(sal_uInt64) SAL_OVERRIDE; virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const SAL_OVERRIDE; diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx index f43603e8c6c4..cf42246cd9e9 100644 --- a/include/tools/pstm.hxx +++ b/include/tools/pstm.hxx @@ -197,7 +197,7 @@ class TOOLS_DLLPUBLIC SvPersistStream : public SvStream virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE; virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE; - virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ) SAL_OVERRIDE; + virtual sal_uInt64 SeekPos(sal_uInt64 nPos) SAL_OVERRIDE; virtual void FlushData() SAL_OVERRIDE; protected: diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index 448b4811865d..7732d6dcb291 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -70,7 +70,7 @@ typedef sal_uInt16 StreamMode; #define STREAM_STD_READWRITE (STREAM_READWRITE | STREAM_SHARE_DENYALL) #define STREAM_SEEK_TO_BEGIN 0L -#define STREAM_SEEK_TO_END ULONG_MAX +#define STREAM_SEEK_TO_END SAL_MAX_UINT64 #define NUMBERFORMAT_INT_BIGENDIAN (sal_uInt16)0x0000 #define NUMBERFORMAT_INT_LITTLEENDIAN (sal_uInt16)0xFFFF @@ -136,7 +136,7 @@ public: virtual ErrCode Flush() const; - virtual ErrCode SetSize(sal_Size nSize); + virtual ErrCode SetSize(sal_uInt64 nSize); virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const; }; @@ -204,7 +204,7 @@ private: // LockBytes Interface void* pImp; // unused SvLockBytesRef xLockBytes; // Default implementation - sal_Size nActPos; + sal_uInt64 m_nActPos; // Puffer-Verwaltung sal_uInt8* pRWBuf; // Points to read/write buffer @@ -244,15 +244,15 @@ private: SvStream& operator=( const SvStream& rStream ); // not implemented protected: - sal_Size nBufFilePos;///< File position of pBuf[0] + sal_uInt64 m_nBufFilePos; ///< File position of pBuf[0] sal_uInt16 eStreamMode; bool bIsWritable; virtual sal_Size GetData( void* pData, sal_Size nSize ); virtual sal_Size PutData( const void* pData, sal_Size nSize ); - virtual sal_Size SeekPos( sal_Size nPos ); + virtual sal_uInt64 SeekPos( sal_uInt64 nPos ); virtual void FlushData(); - virtual void SetSize( sal_Size nSize ); + virtual void SetSize(sal_uInt64 nSize); void ClearError(); void ClearBuffer(); @@ -339,15 +339,15 @@ public: sal_Size Read( void* pData, sal_Size nSize ); sal_Size Write( const void* pData, sal_Size nSize ); - sal_Size Seek( sal_Size nPos ); - sal_Size SeekRel( sal_sSize nPos ); - sal_Size Tell() const { return nBufFilePos+nBufActualPos; } + sal_uInt64 Seek( sal_uInt64 nPos ); + sal_uInt64 SeekRel( sal_Int64 nPos ); + sal_uInt64 Tell() const { return m_nBufFilePos + nBufActualPos; } // length between current (Tell()) pos and end of stream - virtual sal_Size remainingSize(); + virtual sal_uInt64 remainingSize(); void Flush(); bool IsEof() const { return bIsEof; } // next Tell() <= nSize - bool SetStreamSize( sal_Size nSize ); + bool SetStreamSize( sal_uInt64 nSize ); /** Read a line of bytes. @@ -662,8 +662,8 @@ private: protected: virtual sal_Size GetData( void* pData, sal_Size nSize ) SAL_OVERRIDE; virtual sal_Size PutData( const void* pData, sal_Size nSize ) SAL_OVERRIDE; - virtual sal_Size SeekPos( sal_Size nPos ) SAL_OVERRIDE; - virtual void SetSize( sal_Size nSize ) SAL_OVERRIDE; + virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE; + virtual void SetSize( sal_uInt64 nSize ) SAL_OVERRIDE; virtual void FlushData() SAL_OVERRIDE; public: @@ -703,8 +703,8 @@ protected: virtual sal_Size GetData( void* pData, sal_Size nSize ) SAL_OVERRIDE; virtual sal_Size PutData( const void* pData, sal_Size nSize ) SAL_OVERRIDE; - virtual sal_Size SeekPos( sal_Size nPos ) SAL_OVERRIDE; - virtual void SetSize( sal_Size nSize ) SAL_OVERRIDE; + virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE; + virtual void SetSize( sal_uInt64 nSize ) SAL_OVERRIDE; virtual void FlushData() SAL_OVERRIDE; /// AllocateMemory must update pBuf accordingly @@ -747,7 +747,7 @@ public: bool IsObjectMemoryOwner() { return bOwnsData; } void SetResizeOffset( sal_Size nNewResize ) { nResize = nNewResize; } sal_Size GetResizeOffset() const { return nResize; } - virtual sal_Size remainingSize() SAL_OVERRIDE { return GetBufSize() - Tell(); } + virtual sal_uInt64 remainingSize() SAL_OVERRIDE { return GetBufSize() - Tell(); } }; class TOOLS_DLLPUBLIC SvScriptStream: public SvStream diff --git a/include/unotools/ucblockbytes.hxx b/include/unotools/ucblockbytes.hxx index 8bb15e77dc28..a8b854a1a1a1 100644 --- a/include/unotools/ucblockbytes.hxx +++ b/include/unotools/ucblockbytes.hxx @@ -134,8 +134,8 @@ public: virtual void SetSynchronMode (bool bSynchron) SAL_OVERRIDE; virtual ErrCode ReadAt(sal_uInt64 nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const SAL_OVERRIDE; virtual ErrCode WriteAt(sal_uInt64, const void*, sal_uLong, sal_uLong *pWritten) SAL_OVERRIDE; - virtual ErrCode Flush (void) const SAL_OVERRIDE; - virtual ErrCode SetSize (sal_uLong) SAL_OVERRIDE; + virtual ErrCode Flush() const SAL_OVERRIDE; + virtual ErrCode SetSize(sal_uInt64) SAL_OVERRIDE; virtual ErrCode Stat ( SvLockBytesStat *pStat, SvLockBytesStatFlag) const SAL_OVERRIDE; void SetError( ErrCode nError ) |