LibreOffice Module writerperfect (master) 1
DirectoryStream.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
10#pragma once
11
12#include <librevenge-stream/librevenge-stream.h>
13#include <com/sun/star/uno/Reference.h>
14#include "writerperfectdllapi.h"
15#include <tools/long.hxx>
16#include <memory>
17
18namespace com::sun::star::ucb
19{
20class XContent;
21}
22
23namespace writerperfect
24{
25class WRITERPERFECT_DLLPUBLIC DirectoryStream final : public librevenge::RVNGInputStream
26{
27 struct Impl;
28
29public:
30 explicit DirectoryStream(const css::uno::Reference<css::ucb::XContent>& xContent);
31 virtual ~DirectoryStream() override;
32
33 static bool isDirectory(const css::uno::Reference<css::ucb::XContent>& xContent);
34 static std::unique_ptr<DirectoryStream>
35 createForParent(const css::uno::Reference<css::ucb::XContent>& xContent);
36
37 css::uno::Reference<css::ucb::XContent> getContent() const;
38
39 virtual bool isStructured() override;
40 SAL_DLLPRIVATE virtual unsigned subStreamCount() override;
41 SAL_DLLPRIVATE virtual const char* subStreamName(unsigned id) override;
42 SAL_DLLPRIVATE virtual bool existsSubStream(const char* name) override;
43 SAL_DLLPRIVATE virtual librevenge::RVNGInputStream*
44 getSubStreamByName(const char* name) override;
45 SAL_DLLPRIVATE virtual librevenge::RVNGInputStream* getSubStreamById(unsigned id) override;
46
47 virtual const unsigned char* read(unsigned long numBytes, unsigned long& numBytesRead) override;
48 virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
49 virtual long tell() override;
50 virtual bool isEnd() override;
51
52private:
53 std::unique_ptr<Impl> m_pImpl;
54};
55}
56
57/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OString name
Name of the stream.
std::unique_ptr< Impl > m_pImpl
#define WRITERPERFECT_DLLPUBLIC