EBOOKZlibStream.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 EBOOKZLIBSTREAM_H_INCLUDED
11 #define EBOOKZLIBSTREAM_H_INCLUDED
12
13 #include <boost/scoped_ptr.hpp>
14
15 #include <librevenge-stream/librevenge-stream.h>
16
17 namespace libebook
18 {
19
20 class EBOOKZlibStream : public librevenge::RVNGInputStream
21 {
22 public:
23 EBOOKZlibStream(librevenge::RVNGInputStream *stream);
24 virtual ~EBOOKZlibStream();
25
26 virtual bool isStructured();
27 virtual unsigned subStreamCount();
28 virtual const char *subStreamName(unsigned id);
29 virtual bool existsSubStream(const char *name);
30 virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name);
31 virtual RVNGInputStream *getSubStreamById(unsigned id);
32
33 virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
34 virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
35 virtual long tell();
36 virtual bool isEnd();
37
38 private:
39 boost::scoped_ptr<librevenge::RVNGInputStream> m_stream;
40 };
41
42 }
43
44 #endif // EBOOKZLIBSTREAM_H_INCLUDED
45
46 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::EBOOKZlibStream::EBOOKZlibStream
EBOOKZlibStream(librevenge::RVNGInputStream *stream)
Definition: EBOOKZlibStream.cpp:104
libebook::EBOOKZlibStream::subStreamName
virtual const char * subStreamName(unsigned id)
Definition: EBOOKZlibStream.cpp:129
libebook::EBOOKZlibStream::tell
virtual long tell()
Definition: EBOOKZlibStream.cpp:159
libebook::EBOOKZlibStream::existsSubStream
virtual bool existsSubStream(const char *name)
Definition: EBOOKZlibStream.cpp:134
libebook::EBOOKZlibStream::isStructured
virtual bool isStructured()
Definition: EBOOKZlibStream.cpp:119
libebook::EBOOKZlibStream::read
virtual const unsigned char * read(unsigned long numBytes, unsigned long &numBytesRead)
Definition: EBOOKZlibStream.cpp:149
libebook::EBOOKZlibStream::isEnd
virtual bool isEnd()
Definition: EBOOKZlibStream.cpp:164
libebook::EBOOKZlibStream::m_stream
boost::scoped_ptr< librevenge::RVNGInputStream > m_stream
Definition: EBOOKZlibStream.h:39
offset
unsigned offset
Definition: IMPParser.cpp:73
name
string name
Definition: CHMStream.cpp:80
libebook::EBOOKZlibStream
Definition: EBOOKZlibStream.h:20
libebook::EBOOKZlibStream::seek
virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType)
Definition: EBOOKZlibStream.cpp:154
libebook::EBOOKZlibStream::subStreamCount
virtual unsigned subStreamCount()
Definition: EBOOKZlibStream.cpp:124
libebook
Definition: CHMParser.cpp:20
stream
RVNGInputStreamPtr_t stream
Definition: CHMStream.cpp:79
libebook::EBOOKZlibStream::getSubStreamById
virtual RVNGInputStream * getSubStreamById(unsigned id)
Definition: EBOOKZlibStream.cpp:144
libebook::EBOOKZlibStream::getSubStreamByName
virtual librevenge::RVNGInputStream * getSubStreamByName(const char *name)
Definition: EBOOKZlibStream.cpp:139
libebook::EBOOKZlibStream::~EBOOKZlibStream
virtual ~EBOOKZlibStream()
Definition: EBOOKZlibStream.cpp:115