LibreOffice Module ucb (master)  1
filinpstr.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  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_UCB_SOURCE_UCP_FILE_FILINPSTR_HXX
20 #define INCLUDED_UCB_SOURCE_UCP_FILE_FILINPSTR_HXX
21 
22 #include <rtl/ustring.hxx>
23 #include <cppuhelper/weak.hxx>
24 #include <ucbhelper/macros.hxx>
25 #include <com/sun/star/uno/XInterface.hpp>
26 #include <com/sun/star/lang/XTypeProvider.hpp>
27 #include <com/sun/star/io/XSeekable.hpp>
28 #include <com/sun/star/io/XInputStream.hpp>
29 #include <com/sun/star/ucb/XContentProvider.hpp>
30 
31 #include "filrec.hxx"
32 
33 namespace fileaccess {
34 
35  class TaskManager;
36 
38  : public cppu::OWeakObject,
39  public css::lang::XTypeProvider,
40  public css::io::XInputStream,
41  public css::io::XSeekable
42  {
43  public:
44 
45  XInputStream_impl( const OUString& aUncPath, bool bLock );
46 
47  virtual ~XInputStream_impl() override;
48 
53  sal_Int32 CtorSuccess() { return m_nErrorCode;}
54  sal_Int32 getMinorError() { return m_nMinorErrorCode;}
55 
56 
57  // XTypeProvider
58 
59  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
60  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
61 
62  virtual css::uno::Any SAL_CALL
63  queryInterface( const css::uno::Type& rType ) override;
64 
65  virtual void SAL_CALL
66  acquire()
67  throw() override;
68 
69  virtual void SAL_CALL
70  release()
71  throw() override;
72 
73  virtual sal_Int32 SAL_CALL
74  readBytes(
75  css::uno::Sequence< sal_Int8 >& aData,
76  sal_Int32 nBytesToRead ) override;
77 
78  virtual sal_Int32 SAL_CALL
80  css::uno::Sequence< sal_Int8 >& aData,
81  sal_Int32 nMaxBytesToRead ) override;
82 
83  virtual void SAL_CALL
84  skipBytes( sal_Int32 nBytesToSkip ) override;
85 
86  virtual sal_Int32 SAL_CALL
87  available() override;
88 
89  virtual void SAL_CALL
90  closeInput() override;
91 
92  virtual void SAL_CALL
93  seek( sal_Int64 location ) override;
94 
95  virtual sal_Int64 SAL_CALL
96  getPosition() override;
97 
98  virtual sal_Int64 SAL_CALL
99  getLength() override;
100 
101  private:
102 
103  bool m_nIsOpen;
104 
106 
107  sal_Int32 m_nErrorCode;
108  sal_Int32 m_nMinorErrorCode;
109  };
110 } // end namespace XInputStream_impl
111 
112 #endif
113 
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Int32 SAL_CALL readBytes(css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nBytesToRead) override
signed char sal_Int8
virtual sal_Int32 SAL_CALL available() override
Definition: filinpstr.cxx:158
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SAL_CALL release() override
Definition: filinpstr.cxx:110
virtual sal_Int64 SAL_CALL getPosition() override
Definition: filinpstr.cxx:189
virtual void SAL_CALL acquire() override
Definition: filinpstr.cxx:102
sal_Int32 CtorSuccess()
Returns an error code as given by filerror.hxx.
Definition: filinpstr.hxx:53
virtual void SAL_CALL closeInput() override
Definition: filinpstr.cxx:166
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL seek(sal_Int64 location) override
Definition: filinpstr.cxx:179
virtual sal_Int64 SAL_CALL getLength() override
Definition: filinpstr.cxx:198
virtual ~XInputStream_impl() override
Definition: filinpstr.cxx:64
XInputStream_impl(const OUString &aUncPath, bool bLock)
Definition: filinpstr.cxx:41
virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) override
Definition: filinpstr.cxx:151
virtual sal_Int32 SAL_CALL readSomeBytes(css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nMaxBytesToRead) override