EBOOKMemoryStream.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 EBOOKMEMORYSTREAM_H_INCLUDED
18 #define EBOOKMEMORYSTREAM_H_INCLUDED
19 
20 #include <libwpd-stream/libwpd-stream.h>
21 
22 namespace libebook
23 {
24 
25 class EBOOKMemoryStream : public WPXInputStream
26 {
27 // disable copying
30 
31 public:
32  EBOOKMemoryStream(const unsigned char *data, unsigned length);
33  virtual ~EBOOKMemoryStream();
34 
35  virtual bool isOLEStream();
36  virtual WPXInputStream *getDocumentOLEStream(const char *name);
37 
38  virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
39  virtual int seek(long offset, WPX_SEEK_TYPE seekType);
40  virtual long tell();
41  virtual bool atEOS();
42 
43 private:
44  const unsigned char *m_data;
45  const long m_length;
46  long m_pos;
47 };
48 
49 }
50 
51 #endif // EBOOKMEMORYSTREAM_H_INCLUDED
52 
53 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
virtual bool atEOS()
Definition: EBOOKMemoryStream.cpp:104
Definition: EBOOKMemoryStream.h:25
EBOOKMemoryStream & operator=(const EBOOKMemoryStream &other)
const unsigned char * m_data
Definition: EBOOKMemoryStream.h:44
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: EBOOKMemoryStream.cpp:49
virtual ~EBOOKMemoryStream()
Definition: EBOOKMemoryStream.cpp:34
long m_pos
Definition: EBOOKMemoryStream.h:46
virtual long tell()
Definition: EBOOKMemoryStream.cpp:99
unsigned offset
Definition: IMPParser.cpp:78
const long m_length
Definition: EBOOKMemoryStream.h:45
virtual bool isOLEStream()
Definition: EBOOKMemoryStream.cpp:39
virtual WPXInputStream * getDocumentOLEStream(const char *name)
Definition: EBOOKMemoryStream.cpp:44
unsigned length
Definition: IMPParser.cpp:77
const char * name
Definition: FB2Token.cpp:26
virtual int seek(long offset, WPX_SEEK_TYPE seekType)
Definition: EBOOKMemoryStream.cpp:70
EBOOKMemoryStream(const EBOOKMemoryStream &other)

Generated for libe-book by doxygen 1.8.5