1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_UCBHELPER_STD_OUTPUTSTREAM_HXX
11 #define INCLUDED_UCBHELPER_STD_OUTPUTSTREAM_HXX
13 #include <boost/shared_ptr.hpp>
16 #include <osl/mutex.hxx>
17 #include <cppuhelper/weak.hxx>
18 #include <cppuhelper/queryinterface.hxx>
19 #include <com/sun/star/io/XOutputStream.hpp>
20 #include <ucbhelper/ucbhelperdllapi.h>
24 /** Implements a OutputStream
25 * working on an std::ostream
27 class UCBHELPER_DLLPUBLIC StdOutputStream
:
28 public cppu::OWeakObject
,
29 public css::io::XOutputStream
33 StdOutputStream( boost::shared_ptr
< std::ostream
> pStream
);
35 virtual ~StdOutputStream( );
37 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
)
38 throw ( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
40 virtual void SAL_CALL
acquire ( ) throw ( ) SAL_OVERRIDE
;
42 virtual void SAL_CALL
release ( ) throw ( ) SAL_OVERRIDE
;
44 virtual void SAL_CALL
writeBytes ( const css::uno::Sequence
< sal_Int8
>& aData
)
45 throw ( css::io::NotConnectedException
,
46 css::io::BufferSizeExceededException
,
48 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
50 virtual void SAL_CALL
flush ( )
51 throw ( css::io::NotConnectedException
,
52 css::io::BufferSizeExceededException
,
54 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
56 virtual void SAL_CALL
closeOutput ( )
57 throw ( css::io::NotConnectedException
,
58 css::io::BufferSizeExceededException
,
60 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
65 boost::shared_ptr
< std::ostream
> m_pStream
;
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */