LITStream.h
Go to the documentation of this file.
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  * For further information visit http://libebook.sourceforge.net
00008  */
00009 
00010 #ifndef LITSTREAM_H_INCLUDED
00011 #define LITSTREAM_H_INCLUDED
00012 
00013 #include <boost/scoped_ptr.hpp>
00014 
00015 #include <librevenge-stream/librevenge-stream.h>
00016 
00017 #include "libebook_utils.h"
00018 
00019 namespace libebook
00020 {
00021 
00022 class LITStream : public librevenge::RVNGInputStream
00023 {
00024 // disable copying
00025   LITStream(const LITStream &other);
00026   LITStream &operator=(const LITStream &other);
00027 
00028   struct Impl;
00029 
00030 public:
00031   LITStream(const RVNGInputStreamPtr_t &input);
00032   virtual ~LITStream();
00033 
00034   virtual bool isStructured();
00035   virtual unsigned subStreamCount();
00036   virtual const char *subStreamName(unsigned id);
00037   virtual bool existsSubStream(const char *name);
00038   virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name);
00039   virtual librevenge::RVNGInputStream *getSubStreamById(unsigned id);
00040 
00041   virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00042   virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
00043   virtual long tell();
00044   virtual bool isEnd();
00045 
00046 private:
00047   boost::scoped_ptr<Impl> m_impl;
00048 };
00049 
00050 }
00051 
00052 #endif // LITSTREAM_H_INCLUDED
00053 
00054 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */