35 #ifndef AGS_SHARED_UTIL_MEMORY_STREAM_H 36 #define AGS_SHARED_UTIL_MEMORY_STREAM_H 38 #include "common/std/vector.h" 39 #include "ags/shared/util/data_stream.h" 40 #include "ags/shared/util/string.h" 51 MemoryStream(
const uint8_t *cbuf,
size_t buf_sz, DataEndianess stream_endianess = kLittleEndian);
55 MemoryStream(uint8_t *buf,
size_t buf_sz, StreamWorkMode mode, DataEndianess stream_endianess = kLittleEndian);
58 void Close()
override;
59 bool Flush()
override;
62 bool IsValid()
const override;
64 bool EOS()
const override;
66 soff_t GetLength()
const override;
68 soff_t GetPosition()
const override;
69 bool CanRead()
const override;
70 bool CanWrite()
const override;
71 bool CanSeek()
const override;
73 size_t Read(
void *buffer,
size_t size)
override;
74 int32_t ReadByte()
override;
75 size_t Write(
const void *buffer,
size_t size)
override;
76 int32_t WriteByte(uint8_t b)
override;
78 soff_t Seek(soff_t offset, StreamSeek origin)
override;
81 const uint8_t *_cbuf =
nullptr;
84 const StreamWorkMode _mode;
88 uint8_t *_buf =
nullptr;
102 void Close()
override;
104 bool CanRead()
const override;
105 bool CanWrite()
const override;
107 size_t Write(
const void *buffer,
size_t size)
override;
108 int32_t WriteByte(uint8_t b)
override;
Definition: achievements_tables.h:27
Definition: memory_stream.h:46
Definition: data_stream.h:40
Definition: memory_stream.h:92