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
15 namespace libebook
16{
17
25 class EBOOKStreamView : public librevenge::RVNGInputStream
26{
27 // -Weffc++
28 EBOOKStreamView(const EBOOKStreamView &other);
29 EBOOKStreamView &operator=(const EBOOKStreamView &other);
30
31 public:
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
47 private:
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: */
stream
RVNGInputStreamPtr_t stream
Definition HTMLHelpStream.cpp:79
name
string name
Definition HTMLHelpStream.cpp:80
offset
unsigned offset
Definition SoftBookParser.cpp:74
libebook::EBOOKStreamView
A stream representing a view into an another stream.
Definition EBOOKStreamView.h:26
libebook::EBOOKStreamView::m_end
const long m_end
Definition EBOOKStreamView.h:50
libebook::EBOOKStreamView::operator=
EBOOKStreamView & operator=(const EBOOKStreamView &other)
libebook::EBOOKStreamView::seek
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition EBOOKStreamView.cpp:83
libebook::EBOOKStreamView::~EBOOKStreamView
~EBOOKStreamView() override
Definition EBOOKStreamView.cpp:32
libebook::EBOOKStreamView::m_begin
const long m_begin
Definition EBOOKStreamView.h:49
libebook::EBOOKStreamView::isStructured
bool isStructured() override
Definition EBOOKStreamView.cpp:36
libebook::EBOOKStreamView::m_stream
librevenge::RVNGInputStream *const m_stream
Definition EBOOKStreamView.h:48
libebook::EBOOKStreamView::getSubStreamByName
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition EBOOKStreamView.cpp:56
libebook::EBOOKStreamView::existsSubStream
bool existsSubStream(const char *name) override
Definition EBOOKStreamView.cpp:51
libebook::EBOOKStreamView::getSubStreamById
RVNGInputStream * getSubStreamById(unsigned id) override
Definition EBOOKStreamView.cpp:61
libebook::EBOOKStreamView::tell
long tell() override
Definition EBOOKStreamView.cpp:116
libebook::EBOOKStreamView::EBOOKStreamView
EBOOKStreamView(const EBOOKStreamView &other)
libebook::EBOOKStreamView::subStreamName
const char * subStreamName(unsigned id) override
Definition EBOOKStreamView.cpp:46
libebook::EBOOKStreamView::isEnd
bool isEnd() override
Definition EBOOKStreamView.cpp:121
libebook::EBOOKStreamView::subStreamCount
unsigned subStreamCount() override
Definition EBOOKStreamView.cpp:41
libebook::EBOOKStreamView::read
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition EBOOKStreamView.cpp:66
libebook
Definition BBeBCollector.cpp:19