resonance 1.0.1
Loading...
Searching...
No Matches
hxmemstream.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/hxstr.h"
4#include "stream/hxstream.h"
5
20class HxMemStream : public HxStream {
21public:
32 HxMemStream(const char *pszName, char *pData, int nSize);
33
40 virtual ~HxMemStream();
41
54 virtual void SetMarker(int nOffset, int nWhence);
55
60 virtual int GetMarker();
61
66 virtual int Size();
67
79 virtual HxStream &Write(const void *pSrc, int nSize);
80
94 virtual HxStream &ReadData(void *pDest, int nSize);
95
96private:
97 HxStr mName;
98 char *mStart;
99 char *mEnd;
100 char *mCur;
101};
virtual HxStream & ReadData(void *pDest, int nSize)
Move up to nSize bytes into pDest.
virtual int GetMarker()
HxMemStream(const char *pszName, char *pData, int nSize)
Open a stream over a caller-owned byte range.
virtual ~HxMemStream()
Close the stream and release the title.
virtual void SetMarker(int nOffset, int nWhence)
Move the read position, clamping to the range.
virtual HxStream & Write(const void *pSrc, int nSize)
Report a fatal error, since the stream is read-only.
virtual int Size()
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
HxStream()
Construct a stream with a zeroed state.