resonance 1.0.1
Loading...
Searching...
No Matches
memcard.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5class HxStr;
7class MemcardOp;
8
29class Memcard {
30public:
38
48 virtual ~Memcard();
49
59 virtual void Update();
60
70 void CheckInfo(MemcardCBHandler *pHandler, int nPortSlot, int nCookie);
71
84 void EntSpace(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie);
85
95 void Format(MemcardCBHandler *pHandler, int nPortSlot, int nCookie);
96
106 void Unformat(MemcardCBHandler *pHandler, int nPortSlot, int nCookie);
107
118 void CreateDir(MemcardCBHandler *pHandler, int nPortSlot, HxStr path, int nCookie);
119
132 MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie, unsigned nMode);
133
146 void Read(MemcardCBHandler *pHandler,
147 int nPortSlot,
148 int nFile,
149 void *pBuffer,
150 int nLength,
151 int nCookie);
152
165 void Write(MemcardCBHandler *pHandler,
166 int nPortSlot,
167 int nFile,
168 const void *pBuffer,
169 int nLength,
170 int nCookie);
171
185 void Seek(MemcardCBHandler *pHandler, int nFile, int nOffset, int nOrigin, int nCookie);
186
197 void OpenWrite(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie);
198
209 void OpenRead(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie);
210
220 void Close(MemcardCBHandler *pHandler, int nFile, int nCookie);
221
232 void DeleteFile(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie);
233
248 int nPortSlot,
249 const HxStr &oldPath,
250 const HxStr &newPath,
251 int nCookie);
252
263 void Cancel(int nCookie);
264
265protected:
266 // Operations in the order they were queued. Update() services the front of it. +0x00
267 std::list<MemcardOp *> mOps;
268};
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Receiver notified once a queued memory-card operation has finished.
Definition memcardcbhandler.h:34
One queued memory-card operation.
Definition memcardop.h:64
virtual ~Memcard()
Release the queue.
void DeleteFile(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie)
Queue the deletion of one file or directory.
void Close(MemcardCBHandler *pHandler, int nFile, int nCookie)
Queue a close of an open descriptor.
void Read(MemcardCBHandler *pHandler, int nPortSlot, int nFile, void *pBuffer, int nLength, int nCookie)
Queue a read from an open descriptor.
void EntSpace(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie)
Queue an enquiry about the free directory entries under one path.
void CreateDir(MemcardCBHandler *pHandler, int nPortSlot, HxStr path, int nCookie)
Queue the creation of one directory.
void RenameFile(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &oldPath, const HxStr &newPath, int nCookie)
Queue a rename.
void Write(MemcardCBHandler *pHandler, int nPortSlot, int nFile, const void *pBuffer, int nLength, int nCookie)
Queue a write to an open descriptor.
void Seek(MemcardCBHandler *pHandler, int nFile, int nOffset, int nOrigin, int nCookie)
Queue a move of the position of an open descriptor.
void Format(MemcardCBHandler *pHandler, int nPortSlot, int nCookie)
Queue a format of the card in one slot.
void Unformat(MemcardCBHandler *pHandler, int nPortSlot, int nCookie)
Queue an unformat of the card in one slot.
void OpenWrite(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie)
Queue an open for writing.
void ListDir(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie, unsigned nMode)
Queue a listing of one directory.
std::list< MemcardOp * > mOps
Definition memcard.h:267
void OpenRead(MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie)
Queue an open for reading.
Memcard()
Construct an empty queue.
virtual void Update()
Advance the head of the queue by one step.
void Cancel(int nCookie)
Discard every queued operation that was queued with one tag.
void CheckInfo(MemcardCBHandler *pHandler, int nPortSlot, int nCookie)
Queue an enquiry about the card in one slot.