EBOOKStreamView.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libe-book 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#ifndef EBOOKSTREAMVIEW_H_INCLUDED
11#define EBOOKSTREAMVIEW_H_INCLUDED
12
13#include <librevenge-stream/librevenge-stream.h>
14
15namespace libebook
16{
17
25class EBOOKStreamView : public librevenge::RVNGInputStream
26{
27 // -Weffc++
30
31public:
32 EBOOKStreamView(librevenge::RVNGInputStream *stream, long begin, long end);
33 ~EBOOKStreamView() override;
34
35 bool isStructured() override;
36 unsigned subStreamCount() override;
37 const char *subStreamName(unsigned id) override;
38 bool existsSubStream(const char *name) override;
39 librevenge::RVNGInputStream *getSubStreamByName(const char *name) override;
40 RVNGInputStream *getSubStreamById(unsigned id) override;
41
42 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override;
43 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
44 long tell() override;
45 bool isEnd() override;
46
47private:
48 librevenge::RVNGInputStream *const m_stream;
49 const long m_begin;
50 const long m_end;
51};
52
53}
54
55#endif // EBOOKSTREAMVIEW_H_INCLUDED
56
57/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
RVNGInputStreamPtr_t stream
Definition: HTMLHelpStream.cpp:79
string name
Definition: HTMLHelpStream.cpp:80
unsigned offset
Definition: SoftBookParser.cpp:74
A stream representing a view into an another stream.
Definition: EBOOKStreamView.h:26
const long m_end
Definition: EBOOKStreamView.h:50
EBOOKStreamView & operator=(const EBOOKStreamView &other)
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: EBOOKStreamView.cpp:83
~EBOOKStreamView() override
Definition: EBOOKStreamView.cpp:32
const long m_begin
Definition: EBOOKStreamView.h:49
bool isStructured() override
Definition: EBOOKStreamView.cpp:36
librevenge::RVNGInputStream *const m_stream
Definition: EBOOKStreamView.h:48
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition: EBOOKStreamView.cpp:56
bool existsSubStream(const char *name) override
Definition: EBOOKStreamView.cpp:51
RVNGInputStream * getSubStreamById(unsigned id) override
Definition: EBOOKStreamView.cpp:61
long tell() override
Definition: EBOOKStreamView.cpp:116
EBOOKStreamView(const EBOOKStreamView &other)
const char * subStreamName(unsigned id) override
Definition: EBOOKStreamView.cpp:46
bool isEnd() override
Definition: EBOOKStreamView.cpp:121
unsigned subStreamCount() override
Definition: EBOOKStreamView.cpp:41
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: EBOOKStreamView.cpp:66
Definition: BBeBCollector.cpp:19

Generated for libe-book by doxygen 1.9.5