VSDInternalStream.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 libvisio 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 
00011 #ifndef __VSDINTERNALSTREAM_H__
00012 #define __VSDINTERNALSTREAM_H__
00013 
00014 #include <stddef.h>
00015 #include <vector>
00016 #include <librevenge-stream/librevenge-stream.h>
00017 
00018 class VSDInternalStream : public librevenge::RVNGInputStream
00019 {
00020 public:
00021   VSDInternalStream(librevenge::RVNGInputStream *input, unsigned long size, bool compressed=false);
00022   ~VSDInternalStream() {}
00023 
00024   bool isStructured()
00025   {
00026     return false;
00027   }
00028   unsigned subStreamCount()
00029   {
00030     return 0;
00031   }
00032   const char *subStreamName(unsigned)
00033   {
00034     return 0;
00035   }
00036   bool existsSubStream(const char *)
00037   {
00038     return false;
00039   }
00040   librevenge::RVNGInputStream *getSubStreamByName(const char *)
00041   {
00042     return 0;
00043   }
00044   librevenge::RVNGInputStream *getSubStreamById(unsigned)
00045   {
00046     return 0;
00047   }
00048   const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
00049   int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType);
00050   long tell();
00051   bool isEnd();
00052   unsigned long getSize() const
00053   {
00054     return m_buffer.size();
00055   };
00056 
00057 private:
00058   volatile long m_offset;
00059   std::vector<unsigned char> m_buffer;
00060   VSDInternalStream(const VSDInternalStream &);
00061   VSDInternalStream &operator=(const VSDInternalStream &);
00062 };
00063 
00064 #endif
00065 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */