mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-07 15:52:59 +12:00
Some checks are pending
Android Build / x64 (release) (push) Waiting to run
Android Build / arm64 (release) (push) Waiting to run
HTTP Server Build / build (push) Waiting to run
Hydra Core Build / Windows (push) Waiting to run
Hydra Core Build / MacOS (push) Waiting to run
Hydra Core Build / Linux (push) Waiting to run
Hydra Core Build / Android-x64 (push) Waiting to run
Hydra Core Build / ARM-Libretro (push) Waiting to run
Linux AppImage Build / build (push) Waiting to run
Linux Build / build (push) Waiting to run
MacOS Build / MacOS-arm64 (push) Waiting to run
MacOS Build / MacOS-x86_64 (push) Waiting to run
MacOS Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Windows (push) Waiting to run
Qt Build / MacOS-arm64 (push) Waiting to run
Qt Build / MacOS-x86_64 (push) Waiting to run
Qt Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Linux (push) Waiting to run
Windows Build / build (push) Waiting to run
iOS Simulator Build / build (push) Waiting to run
35 lines
No EOL
1.7 KiB
C++
35 lines
No EOL
1.7 KiB
C++
#pragma once
|
|
#include "archive_base.hpp"
|
|
|
|
class ExtSaveDataArchive : public ArchiveBase {
|
|
public:
|
|
ExtSaveDataArchive(Memory& mem, const std::string& folder, bool isShared = false) : ArchiveBase(mem), isShared(isShared), backingFolder(folder) {}
|
|
|
|
u64 getFreeBytes() override {
|
|
Helpers::panic("ExtSaveData::GetFreeBytes unimplemented");
|
|
return 0;
|
|
}
|
|
std::string name() override { return "ExtSaveData::" + backingFolder; }
|
|
|
|
HorizonResult createDirectory(const FSPath& path) override;
|
|
HorizonResult createFile(const FSPath& path, u64 size) override;
|
|
HorizonResult deleteFile(const FSPath& path) override;
|
|
HorizonResult renameFile(const FSPath& oldPath, const FSPath& newPath) override;
|
|
|
|
Rust::Result<ArchiveBase*, HorizonResult> openArchive(const FSPath& path) override;
|
|
Rust::Result<DirectorySession, HorizonResult> openDirectory(const FSPath& path) override;
|
|
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
|
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
|
|
|
Rust::Result<FormatInfo, HorizonResult> getFormatInfo(const FSPath& path) override {
|
|
Helpers::warn("Stubbed ExtSaveData::GetFormatInfo");
|
|
return Ok(FormatInfo{.size = 1_GB, .numOfDirectories = 255, .numOfFiles = 255, .duplicateData = false});
|
|
}
|
|
|
|
// Takes in a binary ExtSaveData path, outputs a combination of the backing folder with the low and high save entries of the path
|
|
// Used for identifying the archive format info files
|
|
std::string getExtSaveDataPathFromBinary(const FSPath& path);
|
|
|
|
bool isShared = false;
|
|
std::string backingFolder; // Backing folder for the archive. Can be NAND, Gamecard or SD depending on the archive path.
|
|
}; |