bump product version to 7.2.5.1
[LibreOffice.git] / ucb / source / ucp / cmis / std_inputstream.hxx
blob82bf5e39b568541fa57173ae8050e405812a06e4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #pragma once
12 #include <boost/shared_ptr.hpp>
13 #include <istream>
15 #include <osl/mutex.hxx>
16 #include <cppuhelper/weak.hxx>
17 #include <com/sun/star/io/XInputStream.hpp>
18 #include <com/sun/star/io/XSeekable.hpp>
20 namespace cmis
22 /** Implements a seekable InputStream
23 * working on an std::istream
25 class StdInputStream
26 : public cppu::OWeakObject,
27 public css::io::XInputStream,
28 public css::io::XSeekable
30 public:
32 StdInputStream( boost::shared_ptr< std::istream > const & pStream );
34 virtual ~StdInputStream() override;
36 virtual css::uno::Any SAL_CALL queryInterface ( const css::uno::Type& rType ) override;
38 virtual void SAL_CALL acquire( ) noexcept override;
40 virtual void SAL_CALL release( ) noexcept override;
42 virtual sal_Int32 SAL_CALL
43 readBytes ( css::uno::Sequence< sal_Int8 >& aData,
44 sal_Int32 nBytesToRead ) override;
46 virtual sal_Int32 SAL_CALL
47 readSomeBytes ( css::uno::Sequence< sal_Int8 >& aData,
48 sal_Int32 nMaxBytesToRead ) override;
50 virtual void SAL_CALL
51 skipBytes ( sal_Int32 nBytesToSkip ) override;
53 virtual sal_Int32 SAL_CALL
54 available ( ) override;
56 virtual void SAL_CALL
57 closeInput ( ) override;
60 /** XSeekable
63 virtual void SAL_CALL
64 seek ( sal_Int64 location ) override;
67 virtual sal_Int64 SAL_CALL
68 getPosition ( ) override;
71 virtual sal_Int64 SAL_CALL
72 getLength ( ) override;
74 private:
76 osl::Mutex m_aMutex;
77 boost::shared_ptr< std::istream > m_pStream;
78 sal_Int64 m_nLength;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */