44 #ifndef AGS_SHARED_UTIL_ALIGNEDSTREAM_H 45 #define AGS_SHARED_UTIL_ALIGNEDSTREAM_H 47 #include "ags/shared/util/proxy_stream.h" 53 enum AlignedStreamMode {
61 ObjectOwnershipPolicy stream_ownership_policy = kReleaseAfterUse,
62 size_t base_alignment =
sizeof(int16_t));
68 void Close()
override;
70 bool CanRead()
const override;
71 bool CanWrite()
const override;
72 bool CanSeek()
const override;
74 size_t Read(
void *buffer,
size_t size)
override;
75 int32_t ReadByte()
override;
76 int16_t ReadInt16()
override;
77 int32_t ReadInt32()
override;
78 int64_t ReadInt64()
override;
79 size_t ReadArray(
void *buffer,
size_t elem_size,
size_t count)
override;
80 size_t ReadArrayOfInt16(int16_t *buffer,
size_t count)
override;
81 size_t ReadArrayOfInt32(int32_t *buffer,
size_t count)
override;
82 size_t ReadArrayOfInt64(int64_t *buffer,
size_t count)
override;
84 size_t Write(
const void *buffer,
size_t size)
override;
85 int32_t WriteByte(uint8_t b)
override;
86 size_t WriteInt16(int16_t val)
override;
87 size_t WriteInt32(int32_t val)
override;
88 size_t WriteInt64(int64_t val)
override;
89 size_t WriteArray(
const void *buffer,
size_t elem_size,
size_t count)
override;
90 size_t WriteArrayOfInt16(
const int16_t *buffer,
size_t count)
override;
91 size_t WriteArrayOfInt32(
const int32_t *buffer,
size_t count)
override;
92 size_t WriteArrayOfInt64(
const int64_t *buffer,
size_t count)
override;
94 bool Seek(soff_t offset, StreamSeek origin)
override;
97 void ReadPadding(
size_t next_type);
98 void WritePadding(
size_t next_type);
102 static const size_t LargestPossibleType =
sizeof(int64_t);
104 AlignedStreamMode _mode;
105 size_t _baseAlignment;
106 size_t _maxAlignment;
Definition: achievements_tables.h:27
Definition: aligned_stream.h:58
Definition: proxy_stream.h:37