resonance 1.0.1
Loading...
Searching...
No Matches
deleteremixmct.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
9#include "os/hxstr.h"
11
35class DeleteRemixMCT : public MemcardTask, public MemcardUser {
36public:
52 MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, const HxStr &remixName);
53
58 virtual ~DeleteRemixMCT();
59
69
84
94 virtual void OnListDir(ListDirOp *pOp);
95
103 virtual void OnCheckInfo(CheckInfoOp *pOp);
104
115 virtual void OnDeleteFile(DeleteFileOp *pOp);
116
123 virtual void Finish();
124
131 virtual void Execute();
132
146 virtual void OnFileLoaded(int nStatus);
147
155 virtual void OnFileSaved(int nStatus);
156
157private:
158 // Selects the step the three step bodies run next. ListRemixDir() clears it and the
159 // constructor does not write it. +0x20
160 int mStep;
161
162 // The directory the index is being read out of. +0x24
163 HxStr mCurrentDir;
164
165 // Every remix save directory the listing found, consumed one per step. +0x2c
166 std::vector<HxStr> mDirNames;
167
168 // The payload file of the remix, copied from its index element by OnFileLoaded(). +0x38
169 HxStr mFileName;
170
171 // The remix to remove, as the constructor received it. +0x40
172 HxStr mRemixName;
173
174 // Constructed empty and destroyed, and never otherwise read or written. +0x48
175 HxStr mUnusedString;
176
177 // The inner read of each index. The destructor deletes it. +0x50
178 LoadFileMCT *mLoadTask;
179
180 // The inner save that rewrites the shortened index. The destructor deletes it. +0x54
181 SaveFileMCT *mSaveTask;
182
183 // One index or payload file passes through this stream's buffer at a time. +0x58
184 IOBPreallocMemStream mStream;
185
186 // mStream.mBuffer, cached by the constructor. +0x78
187 char *mBuffer;
188};
Enquiry about the card in one slot.
Definition checkinfoop.h:13
Deletion of one file or directory on a card.
Definition deletefileop.h:12
void DeleteNextFile()
Run the deletion step mStep selects.
virtual void OnDeleteFile(DeleteFileOp *pOp)
Advance the deletion, abandoning the task first when the deletion failed.
virtual void OnFileLoaded(int nStatus)
Search one index for the remix.
virtual ~DeleteRemixMCT()
virtual void OnCheckInfo(CheckInfoOp *pOp)
Start the listing unless the card reported that it cannot be read.
void ListRemixDir()
List every remix save directory on the card.
virtual void OnFileSaved(int nStatus)
Record the status of the index rewrite and advance to the next step.
DeleteRemixMCT(MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, const HxStr &remixName)
Construct an idle deletion.
virtual void Execute()
Enquire about the card and start the deletion.
virtual void OnListDir(ListDirOp *pOp)
Collect the listed directories and read the first one's index.
virtual void Finish()
Report the finished deletion through MemcardUser::OnRemixDeleted().
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
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
Write one payload to a card, together with the save directory and its browser icon.
Definition savefilemct.h:114