00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* 00003 * This file is part of the libe-book project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 */ 00009 00010 #ifndef EBOOKSTREAMVIEW_H_INCLUDED 00011 #define EBOOKSTREAMVIEW_H_INCLUDED 00012 00013 #include <librevenge-stream/librevenge-stream.h> 00014 00015 namespace libebook 00016 { 00017 00025 class EBOOKStreamView : public librevenge::RVNGInputStream 00026 { 00027 // -Weffc++ 00028 EBOOKStreamView(const EBOOKStreamView &other); 00029 EBOOKStreamView &operator=(const EBOOKStreamView &other); 00030 00031 public: 00032 EBOOKStreamView(librevenge::RVNGInputStream *stream, long begin, long end); 00033 virtual ~EBOOKStreamView(); 00034 00035 virtual bool isStructured(); 00036 virtual unsigned subStreamCount(); 00037 virtual const char *subStreamName(unsigned id); 00038 virtual bool existsSubStream(const char *name); 00039 virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name); 00040 virtual RVNGInputStream *getSubStreamById(unsigned id); 00041 00042 virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead); 00043 virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType); 00044 virtual long tell(); 00045 virtual bool isEnd(); 00046 00047 private: 00048 librevenge::RVNGInputStream *const m_stream; 00049 const long m_begin; 00050 const long m_end; 00051 }; 00052 00053 } 00054 00055 #endif // EBOOKSTREAMVIEW_H_INCLUDED 00056 00057 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */