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/.
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>
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>
35 typedef ::cppu::WeakImplHelper2
<
36 com::sun::star::io::XInputStream
,
37 com::sun::star::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
48 /** Defines the storage kind found
49 * on which the inputstream acts.
52 FdInputStream(oslFileHandle tmpfl
= 0);
54 virtual ~FdInputStream();
56 virtual sal_Int32 SAL_CALL
57 readBytes(css::uno::Sequence
< sal_Int8
>& aData
,
58 sal_Int32 nBytesToRead
)
59 throw( css::io::NotConnectedException
,
60 css::io::BufferSizeExceededException
,
62 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
64 virtual sal_Int32 SAL_CALL
65 readSomeBytes(css::uno::Sequence
< sal_Int8
>& aData
,
66 sal_Int32 nMaxBytesToRead
)
67 throw( css::io::NotConnectedException
,
68 css::io::BufferSizeExceededException
,
70 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 skipBytes(sal_Int32 nBytesToSkip
)
74 throw(css::io::NotConnectedException
,
75 css::io::BufferSizeExceededException
,
77 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 virtual sal_Int32 SAL_CALL
81 throw(css::io::NotConnectedException
,
83 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 throw(css::io::NotConnectedException
,
89 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 seek(sal_Int64 location
)
97 throw(css::lang::IllegalArgumentException
,
99 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
102 virtual sal_Int64 SAL_CALL
104 throw(css::io::IOException
,
105 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 virtual sal_Int64 SAL_CALL
110 throw(css::io::IOException
,
111 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
114 oslFileHandle m_tmpfl
;
115 sal_uInt64 m_nLength
;
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */