summaryrefslogtreecommitdiff
path: root/unotools/inc
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-10-04 19:29:34 +0000
committerKurt Zenker <kz@openoffice.org>2004-10-04 19:29:34 +0000
commitcd04e135de9faf89abb988de2180e7dc44610676 (patch)
tree61872ca334b215d6b13833cf5ca7504d37f11461 /unotools/inc
parent1e5615d26da48b561bc6a57d5ad5c936a03e1631 (diff)
INTEGRATION: CWS mav09 (1.4.142); FILE MERGED
2004/08/09 18:59:28 mav 1.4.142.4: RESYNC: (1.4-1.5); FILE MERGED 2004/05/16 17:29:43 mba 1.4.142.3: #i27773#: XTruncate needed 2004/04/30 08:00:11 mba 1.4.142.2: #i27773#: wrapper for XStream 2004/04/26 13:30:50 mba 1.4.142.1: #i27773#: new wrapper for XStream
Diffstat (limited to 'unotools/inc')
-rw-r--r--unotools/inc/unotools/streamwrap.hxx46
1 files changed, 35 insertions, 11 deletions
diff --git a/unotools/inc/unotools/streamwrap.hxx b/unotools/inc/unotools/streamwrap.hxx
index a7cd42c7a920..ec4fe0782053 100644
--- a/unotools/inc/unotools/streamwrap.hxx
+++ b/unotools/inc/unotools/streamwrap.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: streamwrap.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: rt $ $Date: 2004-07-23 10:43:54 $
+ * last change: $Author: kz $ $Date: 2004-10-04 20:29:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,7 +74,16 @@
#ifndef _COM_SUN_STAR_IO_XSEEKABLE_HPP_
#include <com/sun/star/io/XSeekable.hpp>
#endif
+#ifndef _COM_SUN_STAR_IO_XTRUNCATE_HPP_
+#include <com/sun/star/io/XTruncate.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XSTREAM_HPP_
+#include <com/sun/star/io/XStream.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE3_HXX_
+#include <cppuhelper/implbase3.hxx>
+#endif
#ifndef _CPPUHELPER_IMPLBASE1_HXX_
#include <cppuhelper/implbase1.hxx>
#endif
@@ -103,6 +112,10 @@ protected:
::osl::Mutex m_aMutex;
SvStream* m_pSvStream;
sal_Bool m_bSvStreamOwner : 1;
+ OInputStreamWrapper()
+ { m_pSvStream = 0; m_bSvStreamOwner = sal_False; }
+ void SetStream(SvStream* _pStream, sal_Bool bOwner )
+ { m_pSvStream = _pStream; m_bSvStreamOwner = bOwner; }
public:
OInputStreamWrapper(SvStream& _rStream);
@@ -134,19 +147,14 @@ typedef ::cppu::ImplHelper1 < ::com::sun::star::io::XSeekable
/** helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XInputStream</type>
which is seekable (i.e. supports the <type scope="com.sun.star.io">XSeekable</type> interface).
*/
-class OSeekableInputStreamWrapper
- :public OInputStreamWrapper
- ,public OSeekableInputStreamWrapper_Base
+class OSeekableInputStreamWrapper : public ::cppu::ImplInheritanceHelper1 < OInputStreamWrapper, com::sun::star::io::XSeekable >
{
+protected:
+ OSeekableInputStreamWrapper() {}
public:
OSeekableInputStreamWrapper(SvStream& _rStream);
OSeekableInputStreamWrapper(SvStream* _pStream, sal_Bool _bOwner = sal_False);
- // 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);
@@ -206,8 +214,24 @@ public:
virtual sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
};
-} // namespace utl
+class OStreamWrapper : public ::cppu::ImplInheritanceHelper3 < OSeekableInputStreamWrapper, com::sun::star::io::XStream, com::sun::star::io::XOutputStream, com::sun::star::io::XTruncate >
+{
+public:
+ OStreamWrapper(SvStream& _rStream);
+
+// stario::XStream
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException);
+// stario::XOutputStream
+ 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);
+ virtual void SAL_CALL truncate() throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+};
+
+};
+// namespace utl
#endif // _UTL_STREAM_WRAPPER_HXX_