resonance 1.0.1
Loading...
Searching...
No Matches
loadfilemct.h
Go to the documentation of this file.
1#pragma once
2
4#include "os/hxstr.h"
5
22
40class LoadFileMCT : public MemcardTask {
41public:
53 LoadFileMCT(MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie);
54
59 virtual ~LoadFileMCT();
60
70 void Load(const HxStr &path, void *pBuffer, int nLength);
71
78 void RunStep();
79
91 void SetState(int nState);
92
97 virtual void OnCheckInfo(CheckInfoOp *pOp);
98
103 virtual void OnRead(ReadOp *pOp);
104
109 virtual void OnOpenRead(OpenReadOp *pOp);
110
115 virtual void OnClose(CloseOp *pOp);
116
121 virtual void Finish();
122
127 virtual void Execute();
128
138
139protected:
140 // One of LoadFileState. +0x1c
142
143 // The destination. +0x20
144 void *mBuffer;
145
146 // The number of bytes to read. +0x24
148
149 // The file to read. +0x28
151
152 // The descriptor the read and the close use. +0x30
153 int mFile;
154};
Enquiry about the card in one slot.
Definition checkinfoop.h:13
Close of an open memory-card file.
Definition closeop.h:14
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
virtual void OnRead(ReadOp *pOp)
void * mBuffer
Definition loadfilemct.h:144
int mLength
Definition loadfilemct.h:147
LoadFileMCT(MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie)
Construct an idle load task.
virtual ~LoadFileMCT()
void Load(const HxStr &path, void *pBuffer, int nLength)
Record what to read and start the sequence.
void SetState(int nState)
Record the next state.
int mFile
Definition loadfilemct.h:153
virtual void Execute()
virtual void OnClose(CloseOp *pOp)
HxStr mPath
Definition loadfilemct.h:150
virtual void Finish()
void RunStep()
Run the step mState selects and advance to the state after it.
virtual void OnOpenRead(OpenReadOp *pOp)
int mState
Definition loadfilemct.h:141
virtual void OnCheckInfo(CheckInfoOp *pOp)
int mBytesRead
Bytes the read transferred, valid once the task has reported kMemcardStatusOk.
Definition loadfilemct.h:137
MemcardTask(MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie)
Construct an idle task against one card slot.
Receiver notified once a memory-card task has finished.
Definition memcarduser.h:24
Queue of memory-card operations, with one entry point per libmc call.
Definition memcard.h:29
Open of one memory-card file for reading.
Definition openreadop.h:15
Read from an open memory-card file.
Definition readop.h:14
LoadFileState
States LoadFileMCT::mState selects between.
Definition loadfilemct.h:16
@ kLoadFileStateReport
Definition loadfilemct.h:19
@ kLoadFileStateOpen
Definition loadfilemct.h:17
@ kLoadFileStateDone
Definition loadfilemct.h:20
@ kLoadFileStateRead
Definition loadfilemct.h:18