| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef RVNGMEMORYSTREAM_H |
| 21 |
#define RVNGMEMORYSTREAM_H |
| 22 |
|
| 23 |
#include <librevenge-stream/librevenge-stream.h> |
| 24 |
|
| 25 |
namespace librevenge |
| 26 |
{ |
| 27 |
|
| 28 |
class RVNGMemoryInputStream : public RVNGInputStream |
| 29 |
{ |
| 30 |
public: |
| 31 |
RVNGMemoryInputStream(unsigned char *data, unsigned long size); |
| 32 |
~RVNGMemoryInputStream(); |
| 33 |
bool isStructured() |
| 34 |
{ |
| 35 |
return false; |
| 36 |
} |
| 37 |
unsigned subStreamCount() |
| 38 |
{ |
| 39 |
return 0; |
| 40 |
} |
| 41 |
const char *subStreamName(unsigned) |
| 42 |
{ |
| 43 |
return nullptr; |
| 44 |
} |
| 45 |
bool existsSubStream(const char *) |
| 46 |
{ |
| 47 |
return false; |
| 48 |
} |
| 49 |
RVNGInputStream *getSubStreamByName(const char *) |
| 50 |
{ |
| 51 |
return nullptr; |
| 52 |
} |
| 53 |
RVNGInputStream *getSubStreamById(unsigned) |
| 54 |
{ |
| 55 |
return nullptr; |
| 56 |
} |
| 57 |
const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead); |
| 58 |
int seek(long offset, RVNG_SEEK_TYPE seekType); |
| 59 |
long tell(); |
| 60 |
bool isEnd(); |
| 61 |
unsigned long getSize() const |
| 62 |
{ |
| 63 |
return m_size; |
| 64 |
} |
| 65 |
|
| 66 |
private: |
| 67 |
long m_offset; |
| 68 |
unsigned long m_size; |
| 69 |
unsigned char *m_data; |
| 70 |
RVNGMemoryInputStream(const RVNGMemoryInputStream &); |
| 71 |
RVNGMemoryInputStream &operator=(const RVNGMemoryInputStream &); |
| 72 |
}; |
| 73 |
|
| 74 |
} |
| 75 |
|
| 76 |
#endif |
| 77 |
|