00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* 00003 * This file is part of the libabw 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 __ABWZLIBSTREAM_H__ 00011 #define __ABWZLIBSTREAM_H__ 00012 00013 #include <vector> 00014 #include <librevenge-stream/librevenge-stream.h> 00015 00016 namespace libabw 00017 { 00018 00019 class ABWZlibStream : public librevenge::RVNGInputStream 00020 { 00021 public: 00022 ABWZlibStream(librevenge::RVNGInputStream *input); 00023 ~ABWZlibStream() {} 00024 00025 bool isStructured() 00026 { 00027 return false; 00028 } 00029 unsigned subStreamCount() 00030 { 00031 return 0; 00032 } 00033 const char *subStreamName(unsigned) 00034 { 00035 return 0; 00036 } 00037 bool existsSubStream(const char *) 00038 { 00039 return false; 00040 } 00041 librevenge::RVNGInputStream *getSubStreamByName(const char *) 00042 { 00043 return 0; 00044 } 00045 librevenge::RVNGInputStream *getSubStreamById(unsigned) 00046 { 00047 return 0; 00048 } 00049 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead); 00050 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType); 00051 long tell(); 00052 bool isEnd(); 00053 unsigned long getSize() const 00054 { 00055 return m_buffer.size(); 00056 } 00057 private: 00058 librevenge::RVNGInputStream *m_input; 00059 volatile long m_offset; 00060 std::vector<unsigned char> m_buffer; 00061 ABWZlibStream(const ABWZlibStream &); 00062 ABWZlibStream &operator=(const ABWZlibStream &); 00063 }; 00064 00065 } // namespace libabw 00066 00067 #endif // __ABWZLIBSTREAM_H__ 00068 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */