57 #ifndef AGS_SHARED_UTIL_DATA_EXT_H 58 #define AGS_SHARED_UTIL_DATA_EXT_H 60 #include "ags/shared/util/error.h" 61 #include "ags/shared/util/string.h" 69 kDataExt_NumID8 = 0x0000,
70 kDataExt_NumID32 = 0x0001,
74 kDataExt_File32 = 0x0000,
75 kDataExt_File64 = 0x0002
78 enum DataExtErrorType {
80 kDataExtErr_UnexpectedEOF,
81 kDataExtErr_BlockNotFound,
82 kDataExtErr_BlockDataOverlapping
85 String GetDataExtErrorText(DataExtErrorType err);
86 typedef TypedCodeError<DataExtErrorType, GetDataExtErrorText> DataExtError;
99 virtual String GetOldBlockName(
int blockId)
const {
100 return String::FromFormat(
"id:%d", blockId);
105 virtual soff_t GetOverLeeway(
int )
const {
110 inline Stream *GetStream() {
114 inline bool AtEnd()
const {
134 soff_t _blockStart = 0;
135 soff_t _blockLen = 0;
154 virtual HError ReadBlock(
int block_id,
const String &ext_id,
155 soff_t block_len,
bool &read_next) = 0;
160 typedef void(*PfnWriteExtBlock)(
Stream *out);
161 void WriteExtBlock(
int block,
const String &ext_id,
const PfnWriteExtBlock &writer,
int flags,
Stream *out);
163 inline void WriteExtBlock(
const String &ext_id, PfnWriteExtBlock writer,
int flags,
Stream *out) {
164 WriteExtBlock(0, ext_id, writer, flags, out);
167 inline void WriteExtBlock(
int block, PfnWriteExtBlock writer,
int flags,
Stream *out) {
168 WriteExtBlock(block,
String(), writer, flags, out);
Definition: achievements_tables.h:27
Definition: data_ext.h:142
Definition: data_ext.h:92