Update ooo320-m1
[ooovba.git] / filter / source / xmlfilteradaptor / streamwrap.hxx
blob072a2cb1d3fc86e77d133f026bda5c3e6e995c4b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: streamwrap.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _OSL_FILE_WRAPPER_HXX_
31 #define _OSL_FILE_WRAPPER_HXX_
33 #include <osl/mutex.hxx>
34 #include <com/sun/star/io/XOutputStream.hpp>
35 #include <com/sun/star/io/XInputStream.hpp>
36 #include <com/sun/star/io/XSeekable.hpp>
37 #include <cppuhelper/implbase1.hxx>
39 #define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass) \
40 virtual void SAL_CALL acquire() throw() { baseclass::acquire(); } \
41 virtual void SAL_CALL release() throw() { baseclass::release(); } \
42 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) \
43 { return baseclass::queryInterface(_rType); } \
44 void SAL_CALL PUT_SEMICOLON_AT_THE_END()
46 namespace osl
48 class File;
51 namespace foo
53 namespace stario = ::com::sun::star::io;
54 namespace staruno = ::com::sun::star::uno;
56 //==================================================================
57 //= OOutputStreamWrapper
58 //==================================================================
59 typedef ::cppu::WeakImplHelper1<stario::XOutputStream> OutputStreamWrapper_Base;
60 // needed for some compilers
61 class OOutputStreamWrapper : public OutputStreamWrapper_Base
63 ::osl::File& rStream;
65 public:
66 OOutputStreamWrapper(::osl::File& _rStream) :rStream(_rStream) { }
68 // UNO Anbindung
69 DECLARE_UNO3_AGG_DEFAULTS(OOutputStreamWrapper, OutputStreamWrapper_Base);
71 // stario::XOutputStream
72 virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
73 virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
74 virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
77 } // namespace utl
80 #endif // _UTL_STREAM_WRAPPER_HXX_