EBOOKStreamSlice.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libe-book
3  * Version: MPL 2.0 / LGPLv2.1+
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  * Alternatively, the contents of this file may be used under the terms
10  * of the GNU Lesser General Public License Version 2.1 or later
11  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
12  * applicable instead of those above.
13  *
14  * For further information visit http://libebook.sourceforge.net
15  */
16 
17 #ifndef EBOOKSTREAMSLICE_H_INCLUDED
18 #define EBOOKSTREAMSLICE_H_INCLUDED
19 
20 #include <libwpd-stream/libwpd-stream.h>
21 
22 namespace libebook
23 {
24 
32 class EBOOKStreamSlice : public WPXInputStream
33 {
34  // -Weffc++
35  EBOOKStreamSlice(const EBOOKStreamSlice &other);
37 
38 public:
39  EBOOKStreamSlice(WPXInputStream *stream, long begin, long end);
40  virtual ~EBOOKStreamSlice();
41 
42  virtual bool isOLEStream();
43  virtual WPXInputStream *getDocumentOLEStream(const char *name);
44 
45  virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
46  virtual int seek(long offset, WPX_SEEK_TYPE seekType);
47  virtual long tell();
48  virtual bool atEOS();
49 
50 private:
51  WPXInputStream *const m_stream;
52  const long m_begin;
53  const long m_end;
54 };
55 
56 }
57 
58 #endif // EBOOKSTREAMSLICE_H_INCLUDED
59 
60 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
virtual WPXInputStream * getDocumentOLEStream(const char *name)
Definition: EBOOKStreamSlice.cpp:42
virtual bool atEOS()
Definition: EBOOKStreamSlice.cpp:102
virtual bool isOLEStream()
Definition: EBOOKStreamSlice.cpp:37
EBOOKStreamSlice & operator=(const EBOOKStreamSlice &other)
WPXInputStream *const m_stream
Definition: EBOOKStreamSlice.h:51
const long m_end
Definition: EBOOKStreamSlice.h:53
const long m_begin
Definition: EBOOKStreamSlice.h:52
unsigned offset
Definition: IMPParser.cpp:78
EBOOKStreamSlice(const EBOOKStreamSlice &other)
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: EBOOKStreamSlice.cpp:47
virtual int seek(long offset, WPX_SEEK_TYPE seekType)
Definition: EBOOKStreamSlice.cpp:64
A stream representing a slice of (or view into) another stream.
Definition: EBOOKStreamSlice.h:32
virtual ~EBOOKStreamSlice()
Definition: EBOOKStreamSlice.cpp:33
virtual long tell()
Definition: EBOOKStreamSlice.cpp:97
const char * name
Definition: FB2Token.cpp:26

Generated for libe-book by doxygen 1.8.5