LibreOffice Module xmlhelp (master) 1
inputstream.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
20#pragma once
21
22#include <rtl/ustring.hxx>
23#include <osl/file.hxx>
24#include <cppuhelper/weak.hxx>
25#include <com/sun/star/io/XSeekable.hpp>
26#include <com/sun/star/io/XInputStream.hpp>
27
28
29namespace chelp {
30
32 : public cppu::OWeakObject,
33 public css::io::XInputStream,
34 public css::io::XSeekable
35 {
36
37 public:
38 explicit XInputStream_impl( const OUString& aUncPath );
39
40 virtual ~XInputStream_impl() override;
41
46 bool CtorSuccess() { return m_bIsOpen;}
47
48 virtual css::uno::Any SAL_CALL
50 const css::uno::Type& rType ) override;
51
52 virtual void SAL_CALL
53 acquire()
54 noexcept override;
55
56 virtual void SAL_CALL
57 release()
58 noexcept override;
59
60 virtual sal_Int32 SAL_CALL
62 css::uno::Sequence< sal_Int8 >& aData,
63 sal_Int32 nBytesToRead ) override;
64
65 virtual sal_Int32 SAL_CALL
67 css::uno::Sequence< sal_Int8 >& aData,
68 sal_Int32 nMaxBytesToRead ) override;
69
70 virtual void SAL_CALL
71 skipBytes( sal_Int32 nBytesToSkip ) override;
72
73 virtual sal_Int32 SAL_CALL
74 available() override;
75
76 virtual void SAL_CALL
77 closeInput() override;
78
79 virtual void SAL_CALL
80 seek( sal_Int64 location ) override;
81
82 virtual sal_Int64 SAL_CALL
83 getPosition() override;
84
85 virtual sal_Int64 SAL_CALL
86 getLength() override;
87
88 private:
90 osl::File m_aFile;
91 };
92
93
94} // end namespace XInputStream_impl
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL closeInput() override
virtual void SAL_CALL acquire() noexcept override
Definition: inputstream.cxx:56
virtual sal_Int32 SAL_CALL available() override
virtual sal_Int64 SAL_CALL getPosition() override
virtual void SAL_CALL release() noexcept override
Definition: inputstream.cxx:64
virtual void SAL_CALL seek(sal_Int64 location) override
XInputStream_impl(const OUString &aUncPath)
Definition: inputstream.cxx:32
virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) override
virtual ~XInputStream_impl() override
Definition: inputstream.cxx:39
bool CtorSuccess()
Returns an error code as given by filerror.hxx.
Definition: inputstream.hxx:46
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: inputstream.cxx:46
virtual sal_Int32 SAL_CALL readSomeBytes(css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nMaxBytesToRead) override
virtual sal_Int64 SAL_CALL getLength() override
virtual sal_Int32 SAL_CALL readBytes(css::uno::Sequence< sal_Int8 > &aData, sal_Int32 nBytesToRead) override
signed char sal_Int8