EBOOKMemoryStream.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 EBOOKMEMORYSTREAM_H_INCLUDED
11 #define EBOOKMEMORYSTREAM_H_INCLUDED
12 
13 #include <librevenge-stream/librevenge-stream.h>
14 
15 namespace libebook
16 {
17 
18 class EBOOKMemoryStream : public librevenge::RVNGInputStream
19 {
20 // disable copying
23 
24 public:
25  EBOOKMemoryStream(const unsigned char *data, unsigned length);
26  virtual ~EBOOKMemoryStream();
27 
28  virtual bool isStructured();
29  virtual unsigned subStreamCount();
30  virtual const char *subStreamName(unsigned id);
31  virtual bool existsSubStream(const char *name);
32  virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name);
33  virtual RVNGInputStream *getSubStreamById(unsigned id);
34 
35  virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
36  virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
37  virtual long tell();
38  virtual bool isEnd();
39 
40 private:
41  const unsigned char *m_data;
42  const long m_length;
43  long m_pos;
44 };
45 
46 }
47 
48 #endif // EBOOKMEMORYSTREAM_H_INCLUDED
49 
50 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: EBOOKMemoryStream.h:18
EBOOKMemoryStream & operator=(const EBOOKMemoryStream &other)
const unsigned char * m_data
Definition: EBOOKMemoryStream.h:41
virtual unsigned subStreamCount()
Definition: EBOOKMemoryStream.cpp:37
virtual bool isStructured()
Definition: EBOOKMemoryStream.cpp:32
virtual bool existsSubStream(const char *name)
Definition: EBOOKMemoryStream.cpp:47
virtual librevenge::RVNGInputStream * getSubStreamByName(const char *name)
Definition: EBOOKMemoryStream.cpp:52
virtual const char * subStreamName(unsigned id)
Definition: EBOOKMemoryStream.cpp:42
virtual RVNGInputStream * getSubStreamById(unsigned id)
Definition: EBOOKMemoryStream.cpp:57
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: EBOOKMemoryStream.cpp:62
virtual ~EBOOKMemoryStream()
Definition: EBOOKMemoryStream.cpp:27
virtual bool isEnd()
Definition: EBOOKMemoryStream.cpp:117
long m_pos
Definition: EBOOKMemoryStream.h:43
virtual long tell()
Definition: EBOOKMemoryStream.cpp:112
unsigned offset
Definition: IMPParser.cpp:73
string name
Definition: CHMStream.cpp:80
const long m_length
Definition: EBOOKMemoryStream.h:42
virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: EBOOKMemoryStream.cpp:83
unsigned length
Definition: IMPParser.cpp:72
MSPackFileData * data
Definition: CHMStream.cpp:63
EBOOKMemoryStream(const EBOOKMemoryStream &other)

Generated for libe-book by doxygen 1.8.5