LibreOffice Module ucb (master)  1
std_outputstream.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  */
9 
10 #pragma once
11 
12 #include <boost/shared_ptr.hpp>
13 #include <ostream>
14 
15 #include <mutex>
16 #include <cppuhelper/weak.hxx>
17 #include <com/sun/star/io/XOutputStream.hpp>
18 
19 namespace cmis
20 {
25  public cppu::OWeakObject,
26  public css::io::XOutputStream
27  {
28  public:
29 
30  StdOutputStream( boost::shared_ptr< std::ostream > const & pStream );
31 
32  virtual ~StdOutputStream( ) override;
33 
34  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) override;
35 
36  virtual void SAL_CALL acquire ( ) noexcept override;
37 
38  virtual void SAL_CALL release ( ) noexcept override;
39 
40  virtual void SAL_CALL writeBytes ( const css::uno::Sequence< sal_Int8 >& aData ) override;
41 
42  virtual void SAL_CALL flush ( ) override;
43 
44  virtual void SAL_CALL closeOutput ( ) override;
45 
46  private:
47 
48  std::mutex m_aMutex;
49  boost::shared_ptr< std::ostream > m_pStream;
50  };
51 }
52 
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL flush() override
virtual void SAL_CALL closeOutput() override
virtual void SAL_CALL writeBytes(const css::uno::Sequence< sal_Int8 > &aData) override
constexpr OUStringLiteral aData
virtual ~StdOutputStream() override
boost::shared_ptr< std::ostream > m_pStream
Implements a OutputStream working on an std::ostream.
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL acquire() noexcept override
StdOutputStream(boost::shared_ptr< std::ostream > const &pStream)