build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / include / ucbhelper / fd_inputstream.hxx
blobb0b12e64afc9a3432f9cf322335d15c2c42f4ce7
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UCBHELPER_FD_INPUTSTREAM_HXX
21 #define INCLUDED_UCBHELPER_FD_INPUTSTREAM_HXX
23 #include <rtl/ustring.hxx>
24 #include <osl/mutex.hxx>
25 #include <osl/file.h>
26 #include <com/sun/star/io/XInputStream.hpp>
27 #include <com/sun/star/io/XSeekable.hpp>
28 #include <cppuhelper/implbase2.hxx>
29 #include <cppuhelper/basemutex.hxx>
31 #include <ucbhelper/ucbhelperdllapi.h>
33 namespace ucbhelper
35 typedef ::cppu::WeakImplHelper2<
36 css::io::XInputStream,
37 css::io::XSeekable > FdInputStream_Base;
39 /** Implements a seekable InputStream
40 * working on a buffer.
42 class UCBHELPER_DLLPUBLIC FdInputStream
43 : protected cppu::BaseMutex,
44 public FdInputStream_Base
46 public:
48 /** Defines the storage kind found
49 * on which the inputstream acts.
51 FdInputStream(oslFileHandle tmpfl);
53 virtual ~FdInputStream() override;
55 virtual sal_Int32 SAL_CALL
56 readBytes(css::uno::Sequence< sal_Int8 >& aData,
57 sal_Int32 nBytesToRead)
58 throw( css::io::NotConnectedException,
59 css::io::BufferSizeExceededException,
60 css::io::IOException,
61 css::uno::RuntimeException, std::exception) override;
63 virtual sal_Int32 SAL_CALL
64 readSomeBytes(css::uno::Sequence< sal_Int8 >& aData,
65 sal_Int32 nMaxBytesToRead )
66 throw( css::io::NotConnectedException,
67 css::io::BufferSizeExceededException,
68 css::io::IOException,
69 css::uno::RuntimeException, std::exception) override;
71 virtual void SAL_CALL
72 skipBytes(sal_Int32 nBytesToSkip)
73 throw(css::io::NotConnectedException,
74 css::io::BufferSizeExceededException,
75 css::io::IOException,
76 css::uno::RuntimeException, std::exception ) override;
78 virtual sal_Int32 SAL_CALL
79 available()
80 throw(css::io::NotConnectedException,
81 css::io::IOException,
82 css::uno::RuntimeException, std::exception ) override;
84 virtual void SAL_CALL
85 closeInput()
86 throw(css::io::NotConnectedException,
87 css::io::IOException,
88 css::uno::RuntimeException, std::exception) override;
91 /** XSeekable
94 virtual void SAL_CALL
95 seek(sal_Int64 location)
96 throw(css::lang::IllegalArgumentException,
97 css::io::IOException,
98 css::uno::RuntimeException, std::exception) override;
101 virtual sal_Int64 SAL_CALL
102 getPosition()
103 throw(css::io::IOException,
104 css::uno::RuntimeException, std::exception) override;
107 virtual sal_Int64 SAL_CALL
108 getLength()
109 throw(css::io::IOException,
110 css::uno::RuntimeException, std::exception) override;
112 private:
113 oslFileHandle m_tmpfl;
114 sal_uInt64 m_nLength;
118 #endif
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */