resonance 1.0.1
Loading...
Searching...
No Matches
loadremixmct.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
8#include "os/hxstr.h"
10
33class LoadRemixMCT : public MemcardTask, public MemcardUser {
34public:
50 MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, const HxStr &remixName);
51
56 virtual ~LoadRemixMCT();
57
67
78 virtual void OnCheckInfo(CheckInfoOp *pOp);
79
86 virtual void Finish();
87
94 virtual void Execute();
95
107 virtual void OnListDir(ListDirOp *pOp);
108
122 virtual void OnFileLoaded(int nStatus);
123
124private:
125 // Selects the step OnListDir() and OnFileLoaded() run next. ListRemixDir() clears it and the
126 // constructor does not write it. +0x20
127 int mStep;
128
129 // The remix to read, as the constructor received it. +0x24
130 HxStr mRemixName;
131
132 // The directory the index is being read out of. +0x2c
133 HxStr mCurrentDir;
134
135 // Every remix save directory the listing found, consumed one per step. +0x34
136 std::vector<HxStr> mDirNames;
137
138 // The inner read, of an index or of the payload. OnListDir() and OnFileLoaded() delete the
139 // previous one before creating the next, and the destructor does not release it. +0x40
140 LoadFileMCT *mLoadTask;
141
142 // One index file is read into this stream's buffer at a time. +0x44
143 IOBPreallocMemStream mStream;
144
145 // The stream the payload lands in, Globals::GetResetLog() at construction. +0x64
146 IOBPreallocMemStream *mPayload;
147
148 // mStream.mBuffer, cached by the constructor. +0x68
149 char *mBuffer;
150};
Enquiry about the card in one slot.
Definition checkinfoop.h:13
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Bidirectional stream over a caller-supplied byte buffer.
Definition iobpreallocmemstream.h:32
Listing of one directory on a card.
Definition listdirop.h:20
Read one file from a card into a caller-supplied buffer.
Definition loadfilemct.h:40
LoadRemixMCT(MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, const HxStr &remixName)
Construct an idle load of one remix.
virtual void Finish()
Report the finished load through MemcardUser::OnRemixLoaded().
virtual void Execute()
Enquire about the card and start the load.
virtual void OnCheckInfo(CheckInfoOp *pOp)
Start the listing unless the card reported that it cannot be read.
virtual ~LoadRemixMCT()
virtual void OnListDir(ListDirOp *pOp)
Collect the listed directories and read the first one's index.
virtual void OnFileLoaded(int nStatus)
Search one index for the remix, or finish the payload read.
void ListRemixDir()
List every remix save directory on the card.
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