Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QXPMEMORYSTREAM_H_INCLUDED
00011 #define QXPMEMORYSTREAM_H_INCLUDED
00012
00013 #include <memory>
00014
00015 #include <librevenge-stream/librevenge-stream.h>
00016
00017 namespace libqxp
00018 {
00019
00020 class QXPMemoryStream : public librevenge::RVNGInputStream
00021 {
00022
00023 QXPMemoryStream(const QXPMemoryStream &other) = delete;
00024 QXPMemoryStream &operator=(const QXPMemoryStream &other) = delete;
00025
00026 public:
00027 QXPMemoryStream(const unsigned char *data, unsigned length);
00028 ~QXPMemoryStream() override;
00029
00030 bool isStructured() override;
00031 unsigned subStreamCount() override;
00032 const char *subStreamName(unsigned id) override;
00033 bool existsSubStream(const char *name) override;
00034 librevenge::RVNGInputStream *getSubStreamByName(const char *name) override;
00035 RVNGInputStream *getSubStreamById(unsigned id) override;
00036
00037 const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override;
00038 int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
00039 long tell() override;
00040 bool isEnd() override;
00041
00042 private:
00043 std::unique_ptr<unsigned char[]> m_data;
00044 const long m_length;
00045 long m_pos;
00046 };
00047
00048 }
00049
00050 #endif // QXPMEMORYSTREAM_H_INCLUDED
00051
00052