diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-07-23 09:43:54 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-07-23 09:43:54 +0000 |
commit | 853cc6ddaf3b347be2782c4a672378a121f59884 (patch) | |
tree | 83657f2676d223926896c78d04db34f465617c3f /unotools/inc | |
parent | 459a29ac7f0d5672eeb9b0c8c7baec82149e5f90 (diff) |
INTEGRATION: CWS dba14 (1.4.192); FILE MERGED
2004/07/15 15:04:20 fs 1.4.192.1: #i31536# +OSeekableOutputStreamWrapper
Diffstat (limited to 'unotools/inc')
-rw-r--r-- | unotools/inc/unotools/streamwrap.hxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/unotools/inc/unotools/streamwrap.hxx b/unotools/inc/unotools/streamwrap.hxx index 4168505b5aaa..a7cd42c7a920 100644 --- a/unotools/inc/unotools/streamwrap.hxx +++ b/unotools/inc/unotools/streamwrap.hxx @@ -2,9 +2,9 @@ * * $RCSfile: streamwrap.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: fs $ $Date: 2001-05-30 11:31:54 $ + * last change: $Author: rt $ $Date: 2004-07-23 10:43:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -160,6 +160,8 @@ typedef ::cppu::WeakImplHelper1<stario::XOutputStream> OutputStreamWrapper_Base; // needed for some compilers class OOutputStreamWrapper : public OutputStreamWrapper_Base { +protected: + // TODO: thread safety! SvStream& rStream; public: @@ -172,6 +174,36 @@ public: virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException); virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException); virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException); + +protected: + /// throws an exception according to the error flag of m_pSvStream + void checkError() const; +}; + +//================================================================== +//= OSeekableOutputStreamWrapper +//================================================================== +typedef ::cppu::ImplHelper1 < ::com::sun::star::io::XSeekable + > OSeekableOutputStreamWrapper_Base; +/** helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XOutputStream</type> + which is seekable (i.e. supports the <type scope="com.sun.star.io">XSeekable</type> interface). +*/ +class OSeekableOutputStreamWrapper + :public OOutputStreamWrapper + ,public OSeekableOutputStreamWrapper_Base +{ +public: + OSeekableOutputStreamWrapper(SvStream& _rStream); + + // disambiguate XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + // XSeekable + virtual void SAL_CALL seek( sal_Int64 _nLocation ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); }; } // namespace utl |