ut_IOStream

thanks ogws
This commit is contained in:
elijah-thomas774
2024-05-04 23:47:10 -04:00
parent e1f491d2d1
commit 20bedbfc3b
5 changed files with 56 additions and 22 deletions
+24 -16
View File
@@ -10,33 +10,41 @@ class IOStream {
public:
NW4R_UT_RTTI_DECL(IOStream);
typedef void (*AsyncCallback)(s32 result, IOStream* stream, void* arg);
typedef void (*AsyncCallback)(long result, IOStream *stream, void *arg);
IOStream() : mIsOpen(false), mCallback(NULL), mCallbackArg(NULL) {}
virtual ~IOStream() {} // at 0xC
virtual void Close() = 0; // at 0x10
virtual s32 Read(void* dst, u32 size) = 0; // at 0x14
virtual bool ReadAsync(void* dst, u32 size, AsyncCallback callback,
void* arg); // at 0x18
virtual void Write(const void* src, u32 size); // at 0x1C
virtual bool WriteAsync(const void* src, u32 size, AsyncCallback callback,
void* arg); // at 0x20
virtual bool IsBusy() const; // at 0x24
virtual bool CanAsync() const = 0; // at 0x28
virtual bool CanRead() const = 0; // at 0x2C
virtual bool CanWrite() const = 0; // at 0x30
virtual u32 GetOffsetAlign() const { return 1; } // at 0x34
virtual u32 GetSizeAlign() const { return 1; } // at 0x38
virtual u32 GetBufferAlign() const { return 1; } // at 0x3C
virtual s32 Read(void *dst, u32 size) = 0; // at 0x14
virtual bool ReadAsync(void *dst, unsigned long size, AsyncCallback callback,
void *arg); // at 0x18
virtual bool Write(const void *src, unsigned long size); // at 0x1C
virtual bool WriteAsync(const void *src, unsigned long size, AsyncCallback callback,
void *arg); // at 0x20
virtual bool IsBusy() const; // at 0x24
virtual bool CanAsync() const = 0; // at 0x28
virtual bool CanRead() const = 0; // at 0x2C
virtual bool CanWrite() const = 0; // at 0x30
virtual u32 GetOffsetAlign() const {
return 1;
} // at 0x34
virtual u32 GetSizeAlign() const {
return 1;
} // at 0x38
virtual u32 GetBufferAlign() const {
return 1;
} // at 0x3C
bool IsAvailable() const { return mIsOpen; }
bool IsAvailable() const {
return mIsOpen;
}
protected:
bool mIsOpen; // at 0x4
s32 mResult; // at 0x8
AsyncCallback mCallback; // at 0xC
void* mCallbackArg; // at 0x10
void *mCallbackArg; // at 0x10
};
} // namespace ut