RBStream.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 RBSTREAM_H_INCLUDED
00011 #define RBSTREAM_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 RBHeader;
00023 
00024 class RBStream : public librevenge::RVNGInputStream
00025 {
00026 // disable copying
00027   RBStream(const RBStream &other);
00028   RBStream &operator=(const RBStream &other);
00029 
00030   struct Impl;
00031 
00032 public:
00033   RBStream(const RVNGInputStreamPtr_t &input, const RBHeader &header);
00034   virtual ~RBStream();
00035 
00036   virtual bool isStructured();
00037   virtual unsigned subStreamCount();
00038   virtual const char *subStreamName(unsigned id);
00039   virtual bool existsSubStream(const char *name);
00040   virtual librevenge::RVNGInputStream *getSubStreamByName(const char *name);
00041   virtual librevenge::RVNGInputStream *getSubStreamById(unsigned id);
00042 
00043   virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00044   virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
00045   virtual long tell();
00046   virtual bool isEnd();
00047 
00048 private:
00049   boost::scoped_ptr<Impl> m_impl;
00050 };
00051 
00052 }
00053 
00054 #endif // RBSTREAM_H_INCLUDED
00055 
00056 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */