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);
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: */
~EBOOKStreamView() override
Definition: EBOOKStreamView.cpp:32
unsigned offset
Definition: SoftBookParser.cpp:74
EBOOKStreamView(const EBOOKStreamView &other)
bool isEnd() override
Definition: EBOOKStreamView.cpp:121
librevenge::RVNGInputStream * getSubStreamByName(const char *name) override
Definition: EBOOKStreamView.cpp:56
const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead) override
Definition: EBOOKStreamView.cpp:66
RVNGInputStreamPtr_t stream
Definition: HTMLHelpStream.cpp:79
RVNGInputStream * getSubStreamById(unsigned id) override
Definition: EBOOKStreamView.cpp:61
bool isStructured() override
Definition: EBOOKStreamView.cpp:36
const char * subStreamName(unsigned id) override
Definition: EBOOKStreamView.cpp:46
const char * name
Definition: EBOOKHTMLToken.cpp:44
unsigned subStreamCount() override
Definition: EBOOKStreamView.cpp:41
bool existsSubStream(const char *name) override
Definition: EBOOKStreamView.cpp:51
EBOOKStreamView & operator=(const EBOOKStreamView &other)
int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override
Definition: EBOOKStreamView.cpp:83
A stream representing a view into an another stream.
Definition: EBOOKStreamView.h:25
Definition: BBeBCollector.cpp:18
const long m_begin
Definition: EBOOKStreamView.h:49
const long m_end
Definition: EBOOKStreamView.h:50
long tell() override
Definition: EBOOKStreamView.cpp:116
librevenge::RVNGInputStream *const m_stream
Definition: EBOOKStreamView.h:48

Generated for libe-book by doxygen 1.8.14