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