ExtSaveData work

This commit is contained in:
wheremyfoodat 2023-01-22 14:23:28 +02:00
parent 902b877c40
commit 995dfb81df
12 changed files with 68 additions and 28 deletions

View file

@ -24,6 +24,9 @@ class IOFile {
public:
IOFile() {}
IOFile(FILE* handle) : handle(handle) {}
IOFile(const std::filesystem::path& path, const char* permissions = "rb") {
open(path, permissions);
}
bool isOpen() {
return handle != nullptr;
@ -86,6 +89,10 @@ public:
return seek(0, SEEK_SET);
}
FILE* getHandle() {
return handle;
}
static void setAppDataDir(const char* dir) {
if (!dir) Helpers::panic("Failed to set app data directory");
appData = std::filesystem::path(dir);