[FS] Implement GetFileSize [PTM] Stub step functions
This commit is contained in:
@@ -75,17 +75,17 @@ public:
|
||||
return write(data, count, sizeof(std::uint8_t));
|
||||
}
|
||||
|
||||
std::uint64_t size() {
|
||||
if (!isOpen()) return 0;
|
||||
std::optional<std::uint64_t> size() {
|
||||
if (!isOpen()) return {};
|
||||
|
||||
std::uint64_t pos = ftello(handle);
|
||||
if (fseeko(handle, 0, SEEK_END) != 0) {
|
||||
return 0;
|
||||
return {};
|
||||
}
|
||||
|
||||
std::uint64_t size = ftello(handle);
|
||||
if ((size != pos) && (fseeko(handle, pos, SEEK_SET) != 0)) {
|
||||
return 0;
|
||||
return {};
|
||||
}
|
||||
|
||||
return size;
|
||||
|
||||
@@ -120,6 +120,7 @@ private:
|
||||
void handleFileOperation(u32 messagePointer, Handle file);
|
||||
void closeFile(u32 messagePointer, Handle file);
|
||||
void readFile(u32 messagePointer, Handle file);
|
||||
void writeFile(u32 messagePointer, Handle file);
|
||||
void getFileSize(u32 messagePointer, Handle file);
|
||||
|
||||
public:
|
||||
|
||||
@@ -10,6 +10,8 @@ class PTMService {
|
||||
MAKE_LOG_FUNCTION(log, ptmLogger)
|
||||
|
||||
// Service commands
|
||||
void getStepHistory(u32 messagePointer);
|
||||
void getTotalStepCount(u32 messagePointer);
|
||||
|
||||
public:
|
||||
PTMService(Memory& mem) : mem(mem) {}
|
||||
|
||||
Reference in New Issue
Block a user