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  virtual ~EBOOKStreamView();
34 
35  virtual bool isStructured();
36  virtual unsigned subStreamCount();
37  virtual const char *subStreamName(unsigned id);
38  virtual bool existsSubStream(const char *name);
39  virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name);
40  virtual RVNGInputStream *getSubStreamById(unsigned id);
41 
42  virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
43  virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
44  virtual long tell();
45  virtual bool isEnd();
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: */
virtual librevenge::RVNGInputStream * getSubStreamByName(const char *name)
Definition: EBOOKStreamView.cpp:54
virtual ~EBOOKStreamView()
Definition: EBOOKStreamView.cpp:30
EBOOKStreamView(const EBOOKStreamView &other)
virtual bool isEnd()
Definition: EBOOKStreamView.cpp:119
virtual RVNGInputStream * getSubStreamById(unsigned id)
Definition: EBOOKStreamView.cpp:59
virtual const char * subStreamName(unsigned id)
Definition: EBOOKStreamView.cpp:44
virtual unsigned subStreamCount()
Definition: EBOOKStreamView.cpp:39
virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: EBOOKStreamView.cpp:81
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: EBOOKStreamView.cpp:64
unsigned offset
Definition: IMPParser.cpp:73
string name
Definition: CHMStream.cpp:80
virtual long tell()
Definition: EBOOKStreamView.cpp:114
virtual bool isStructured()
Definition: EBOOKStreamView.cpp:34
EBOOKStreamView & operator=(const EBOOKStreamView &other)
virtual bool existsSubStream(const char *name)
Definition: EBOOKStreamView.cpp:49
A stream representing a view into an another stream.
Definition: EBOOKStreamView.h:25
Definition: CHMParser.cpp:20
RVNGInputStreamPtr_t stream
Definition: CHMStream.cpp:79
const long m_begin
Definition: EBOOKStreamView.h:49
const long m_end
Definition: EBOOKStreamView.h:50
librevenge::RVNGInputStream *const m_stream
Definition: EBOOKStreamView.h:48

Generated for libe-book by doxygen 1.8.8