resonance 1.0.1
Loading...
Searching...
No Matches
memstream.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "rnd/stream.h"
6
7namespace Rnd {
8
10constexpr int kMemStreamReserve = 0x1000;
11
19class MemStream : public Stream {
20public:
28
33 virtual ~MemStream();
34
39 virtual Stream &Read(void *pDest, int nSize);
40
45 virtual Stream &Write(const void *pSrc, int nSize);
46
51 virtual Stream &Flush();
52
57 virtual Stream &Seek(int nOffset, int nWhence);
58
63 virtual int Tell();
64
69 virtual int Eof();
70
75 virtual int Fail();
76
86 void Compact();
87
88private:
89 int mEof; // +0x04
90 int mFail; // +0x08
91 int mPos; // +0x0c
92 std::vector<char> mBuffer; // +0x10
93};
94
95} // namespace Rnd
virtual int Eof()
virtual Stream & Seek(int nOffset, int nWhence)
void Compact()
Drop the bytes already read from the front of the buffer and rewind the cursor.
virtual Stream & Write(const void *pSrc, int nSize)
virtual int Fail()
virtual ~MemStream()
virtual Stream & Read(void *pDest, int nSize)
virtual Stream & Flush()
MemStream()
Construct an empty stream with kMemStreamReserve bytes reserved.
virtual int Tell()
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
The rendering engine.
Definition animhelper.h:3
constexpr int kMemStreamReserve
Bytes the constructor reserves before the first write.
Definition memstream.h:10