merged tag LIBREOFFICE_3_2_99_3
[LibreOffice.git] / filter / source / xmlfilteradaptor / streamwrap.hxx
blob53f865475a22461b8e0145c3e733ffe67ec09b73
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _OSL_FILE_WRAPPER_HXX_
29 #define _OSL_FILE_WRAPPER_HXX_
31 #include <osl/mutex.hxx>
32 #include <com/sun/star/io/XOutputStream.hpp>
33 #include <com/sun/star/io/XInputStream.hpp>
34 #include <com/sun/star/io/XSeekable.hpp>
35 #include <cppuhelper/implbase1.hxx>
37 #define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass) \
38 virtual void SAL_CALL acquire() throw() { baseclass::acquire(); } \
39 virtual void SAL_CALL release() throw() { baseclass::release(); } \
40 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException) \
41 { return baseclass::queryInterface(_rType); } \
42 void SAL_CALL PUT_SEMICOLON_AT_THE_END()
44 namespace osl
46 class File;
49 namespace foo
51 namespace stario = ::com::sun::star::io;
52 namespace staruno = ::com::sun::star::uno;
54 //==================================================================
55 //= OOutputStreamWrapper
56 //==================================================================
57 typedef ::cppu::WeakImplHelper1<stario::XOutputStream> OutputStreamWrapper_Base;
58 // needed for some compilers
59 class OOutputStreamWrapper : public OutputStreamWrapper_Base
61 ::osl::File& rStream;
63 public:
64 OOutputStreamWrapper(::osl::File& _rStream) :rStream(_rStream) { }
66 // UNO Anbindung
67 DECLARE_UNO3_AGG_DEFAULTS(OOutputStreamWrapper, OutputStreamWrapper_Base);
69 // stario::XOutputStream
70 virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
71 virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
72 virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
75 } // namespace utl
78 #endif // _UTL_STREAM_WRAPPER_HXX_
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */