IMPLZSSStream.h
Go to the documentation of this file.
00001 
00002 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00003 /* libe-book
00004  * Version: MPL 2.0 / LGPLv2.1+
00005  *
00006  * This Source Code Form is subject to the terms of the Mozilla Public
00007  * License, v. 2.0. If a copy of the MPL was not distributed with this
00008  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00009  *
00010  * Alternatively, the contents of this file may be used under the terms
00011  * of the GNU Lesser General Public License Version 2.1 or later
00012  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00013  * applicable instead of those above.
00014  *
00015  * For further information visit http://libebook.sourceforge.net
00016  */
00017 
00018 #ifndef IMPLZSSSTREAM_H_INCLUDED
00019 #define IMPLZSSSTREAM_H_INCLUDED
00020 
00021 #include <boost/scoped_ptr.hpp>
00022 
00023 #include <libwpd-stream/libwpd-stream.h>
00024 
00025 namespace libebook
00026 {
00027 
00028 class IMPLZSSStream : public WPXInputStream
00029 {
00030 // disable copying
00031   IMPLZSSStream(const IMPLZSSStream &other);
00032   IMPLZSSStream &operator=(const IMPLZSSStream &other);
00033 
00034 public:
00035   struct Configuration
00036   {
00037     unsigned offsetBits;
00038     unsigned lengthBits;
00039     unsigned uncompressedLength;
00040     unsigned fillPos;
00041     char fillChar;
00042     bool allowOverflow;
00043     bool bigEndian;
00044 
00045     Configuration();
00046   };
00047 
00048 public:
00049   explicit IMPLZSSStream(WPXInputStream *stream, const Configuration &configuration = Configuration());
00050   virtual ~IMPLZSSStream();
00051 
00052   virtual bool isOLEStream();
00053   virtual WPXInputStream *getDocumentOLEStream(const char *name);
00054 
00055   virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00056   virtual int seek(long offset, WPX_SEEK_TYPE seekType);
00057   virtual long tell();
00058   virtual bool atEOS();
00059 
00060 private:
00061   boost::scoped_ptr<WPXInputStream> m_stream;
00062 };
00063 
00064 }
00065 
00066 #endif // IMPLZSSSTREAM_H_INCLUDED
00067 
00068 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */