Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JORFile.h
Go to the documentation of this file.
1#ifndef JORFILE_H
2#define JORFILE_H
3
5
6class JORDir {
7public:
9 void setFindHandle(u32 handle) { m_findHandle = handle; }
10 void setFileAttribute(u32 attribute) { m_fileAttribute = attribute; }
13
14 char* getFilename() { return m_filename; }
15
16 /* 0x00 */ u32 m_status;
17 /* 0x04 */ u32 m_findHandle;
18 /* 0x08 */ u32 m_fileAttribute;
19 /* 0x0C */ u32 m_lowDateTime;
20 /* 0x10 */ u32 m_highDateTime;
21 /* 0x14 */ char* m_filename;
22};
23
24class JORFile {
25public:
32
42
43 enum EFlags {
44 EFlags_READ = (1 << 0),
45 EFlags_WRITE = (1 << 1),
47 EFlags_UNK_0x20 = (1 << 5),
49 };
50
51 JORFile();
52
53 int countMaskSize(const char* mask);
54 void setBuffer(void* buffer, s32 length);
55
56 char* getFilename() { return mFilename; }
57 u32 getHandle() const { return mHandle; }
58
60
61 void setHandle(u32 handle) { mHandle = handle; }
62 void setFileLength(s32 length) { mFileLength = length; }
63 void setNFileName(u16 length) { mNFileName = length; }
64 void setNBaseName(u16 length) { mNBaseName = length; }
65 void setNExtensionName(u16 length) { mNExtensionName = length; }
67
68 virtual ~JORFile() {}
69 virtual int open(const char* path, u32 flags, const char* extMask, const char* defaultExt, const char*, const char* fileSuffix);
70 virtual int open(u32 flags, const char* extMask, const char* defaultExt, const char*, const char* fileSuffix);
71 virtual void close();
72 virtual s32 readData(void* buffer, s32 length);
73 virtual s32 writeData(const void* buffer, s32 length);
74 virtual void readBegin_(s32 len);
75 virtual void readLoop_();
76 virtual void writeBegin_(s32 len);
77 virtual void writeLoop_(const void* pBuffer, s32 size, u32 pos);
78 virtual void writeDone_(s32 len);
79 virtual void waitMessage_();
80 virtual s32 getFileSize() const;
81
82 /* 0x04 */ u32 mHandle;
83 /* 0x08 */ s32 mFileLength;
84 /* 0x0C */ s32 mStatus;
85 /* 0x10 */ u16 mNFileName;
86 /* 0x12 */ u16 mNBaseName;
87 /* 0x14 */ u16 mNExtensionName;
88 /* 0x16 */ u16 mFlags;
89 /* 0x18 */ int field_0x18;
91 /* 0x30 */ char mFilename[8];
92};
93
94#endif /* JORFILE_H */
OSTime time
Definition GXInit.c:61
static OSTime buffer
Definition ai.c:202
T cLib_calcTimer(T *value)
Definition c_lib.h:79
Definition JORFile.h:6
void setFindHandle(u32 handle)
Definition JORFile.h:9
u32 m_lowDateTime
Definition JORFile.h:19
char * getFilename()
Definition JORFile.h:14
u32 m_highDateTime
Definition JORFile.h:20
u32 m_status
Definition JORFile.h:16
void setHighDateTime(u32 time)
Definition JORFile.h:12
u32 m_findHandle
Definition JORFile.h:17
void setStatus(u32 status)
Definition JORFile.h:8
void setFileAttribute(u32 attribute)
Definition JORFile.h:10
void setLowDateTime(u32 time)
Definition JORFile.h:11
char * m_filename
Definition JORFile.h:21
u32 m_fileAttribute
Definition JORFile.h:18
Definition JORFile.h:24
JORFile()
Definition JORFile.cpp:5
virtual s32 writeData(const void *buffer, s32 length)
Definition JORFile.cpp:162
virtual void readLoop_()
Definition JORFile.cpp:100
virtual void readBegin_(s32 len)
Definition JORFile.cpp:91
virtual s32 readData(void *buffer, s32 length)
Definition JORFile.cpp:109
void setNExtensionName(u16 length)
Definition JORFile.h:65
virtual void writeLoop_(const void *pBuffer, s32 size, u32 pos)
Definition JORFile.cpp:144
void setBuffer(void *buffer, s32 length)
Definition JORFile.cpp:131
void setStatus(s32 status)
Definition JORFile.h:66
int field_0x18
Definition JORFile.h:89
u32 mHandle
Definition JORFile.h:82
u16 mNExtensionName
Definition JORFile.h:87
s32 mStatus
Definition JORFile.h:84
u16 mNBaseName
Definition JORFile.h:86
void setFileLength(s32 length)
Definition JORFile.h:62
char * getFilename()
Definition JORFile.h:56
void setHandle(u32 handle)
Definition JORFile.h:61
int countMaskSize(const char *mask)
Definition JORFile.cpp:12
u16 mFlags
Definition JORFile.h:88
void setNFileName(u16 length)
Definition JORFile.h:63
virtual void close()
Definition JORFile.cpp:79
virtual s32 getFileSize() const
EFlags
Definition JORFile.h:43
@ EFlags_READ
Definition JORFile.h:44
@ EFlags_WRITE
Definition JORFile.h:45
@ EFlags_HAS_SUFFIX
Definition JORFile.h:48
@ EFlags_UNK_0x20
Definition JORFile.h:47
@ EFlags_DEFAULT_EXT
Definition JORFile.h:46
virtual int open(const char *path, u32 flags, const char *extMask, const char *defaultExt, const char *, const char *fileSuffix)
Definition JORFile.cpp:52
virtual ~JORFile()
Definition JORFile.h:68
virtual void writeBegin_(s32 len)
Definition JORFile.cpp:135
char mFilename[8]
Definition JORFile.h:91
EStatus
Definition JORFile.h:33
@ EStatus_WRITE_DATA
Definition JORFile.h:39
@ EStatus_READ_END
Definition JORFile.h:37
@ EStatus_WAIT
Definition JORFile.h:34
@ EStatus_WRITE_END
Definition JORFile.h:40
@ EStatus_WRITE_BEGIN
Definition JORFile.h:38
@ EStatus_READ_BEGIN
Definition JORFile.h:35
@ EStatus_READ_DATA
Definition JORFile.h:36
ECommand
Definition JORFile.h:26
@ ECommand_READ
Definition JORFile.h:29
@ ECommand_WRITE
Definition JORFile.h:30
@ ECommand_OPEN
Definition JORFile.h:27
@ ECommand_CLOSE
Definition JORFile.h:28
void setNBaseName(u16 length)
Definition JORFile.h:64
virtual void waitMessage_()
Definition JORFile.cpp:46
u32 getHandle() const
Definition JORFile.h:57
JSUMemoryOutputStream & getDataStream()
Definition JORFile.h:59
u16 mNFileName
Definition JORFile.h:85
s32 mFileLength
Definition JORFile.h:83
JSUMemoryOutputStream mDataStream
Definition JORFile.h:90
virtual int open(u32 flags, const char *extMask, const char *defaultExt, const char *, const char *fileSuffix)
virtual void writeDone_(s32 len)
Definition JORFile.cpp:153
Definition JSUMemoryStream.h:32
static u8 pos[12]
Definition d_a_obj_kago.cpp:839
static s32 status
Definition fstload.c:6
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6