diff --git a/Common/File/VFS/AssetReader.cpp b/Common/File/VFS/AssetReader.cpp index ab3a861885..e1571be2bc 100644 --- a/Common/File/VFS/AssetReader.cpp +++ b/Common/File/VFS/AssetReader.cpp @@ -64,7 +64,7 @@ uint8_t *ZipAssetReader::ReadAsset(const char *path, size_t *size) { return ReadFromZip(zip_file_, temp_path, size); } -bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector *listing, const char *filter = 0) { +bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector *listing, const char *filter = 0) { char path[1024]; strcpy(path, in_zip_path_); strcat(path, orig_path); @@ -111,7 +111,7 @@ bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector } for (auto diter = directories.begin(); diter != directories.end(); ++diter) { - FileInfo info; + File::FileInfo info; info.name = *diter; info.fullName = std::string(path); if (info.fullName[info.fullName.size() - 1] == '/') @@ -127,7 +127,7 @@ bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector } for (auto fiter = files.begin(); fiter != files.end(); ++fiter) { - FileInfo info; + File::FileInfo info; info.name = *fiter; info.fullName = std::string(path); if (info.fullName[info.fullName.size() - 1] == '/') @@ -137,7 +137,7 @@ bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector info.exists = true; info.isWritable = false; info.isDirectory = false; - std::string ext = getFileExtension(info.fullName); + std::string ext = File::GetFileExtension(info.fullName); if (filter) { if (filters.find(ext) == filters.end()) continue; @@ -149,7 +149,7 @@ bool ZipAssetReader::GetFileListing(const char *orig_path, std::vector return true; } -bool ZipAssetReader::GetFileInfo(const char *path, FileInfo *info) { +bool ZipAssetReader::GetFileInfo(const char *path, File::FileInfo *info) { struct zip_stat zstat; char temp_path[1024]; strcpy(temp_path, in_zip_path_); diff --git a/Common/File/VFS/AssetReader.h b/Common/File/VFS/AssetReader.h index 1e756d8fe5..2b78941f59 100644 --- a/Common/File/VFS/AssetReader.h +++ b/Common/File/VFS/AssetReader.h @@ -30,8 +30,8 @@ public: ~ZipAssetReader(); // use delete[] virtual uint8_t *ReadAsset(const char *path, size_t *size); - virtual bool GetFileListing(const char *path, std::vector *listing, const char *filter); - virtual bool GetFileInfo(const char *path, FileInfo *info); + virtual bool GetFileListing(const char *path, std::vector *listing, const char *filter); + virtual bool GetFileInfo(const char *path, File::FileInfo *info); virtual std::string toString() const { return in_zip_path_; } diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index b654fd8d26..1a6e375dce 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -552,7 +552,7 @@ namespace Reporting if (!File::Exists(g_Config.flash0Directory + "/font/jpn0.pgf")) return false; #else - FileInfo fo; + File::FileInfo fo; if (!VFSGetFileInfo("flash0/font/jpn0.pgf", &fo)) return false; #endif diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 690451ff93..db0d4ebd4a 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1293,7 +1293,6 @@ void GameSettingsScreen::sendMessage(const char *message, const char *value) { } } -#if PPSSPP_PLATFORM(ANDROID) void GameSettingsScreen::CallbackMemstickFolder(bool yes) { auto sy = GetI18NCategory("System"); @@ -1305,20 +1304,19 @@ void GameSettingsScreen::CallbackMemstickFolder(bool yes) { if (!File::Exists(pendingMemstickFolder_)) { File::CreateFullPath(pendingMemstickFolder_); } - if (!writeDataToFile(true, "1", 1, testWriteFile.c_str())) { + if (!File::writeDataToFile(true, "1", 1, testWriteFile.c_str())) { settingInfo_->Show(sy->T("ChangingMemstickPathInvalid", "That path couldn't be used to save Memory Stick files."), nullptr); return; } File::Delete(testWriteFile); - writeDataToFile(true, pendingMemstickFolder_.c_str(), pendingMemstickFolder_.size(), memstickDirFile.c_str()); + File::writeDataToFile(true, pendingMemstickFolder_.c_str(), pendingMemstickFolder_.size(), memstickDirFile.c_str()); // Save so the settings, at least, are transferred. g_Config.memStickDirectory = pendingMemstickFolder_ + "/"; g_Config.Save("MemstickPathChanged"); screenManager()->RecreateAllViews(); } } -#endif void GameSettingsScreen::TriggerRestart(const char *why) { // Extra save here to make sure the choice really gets saved even if there are shutdown bugs in diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index ec7542f483..7544c1b8b8 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -43,9 +43,7 @@ protected: void CallbackRenderingBackend(bool yes); void CallbackRenderingDevice(bool yes); void CallbackInflightFrames(bool yes); -#if PPSSPP_PLATFORM(ANDROID) void CallbackMemstickFolder(bool yes); -#endif bool UseVerticalLayout() const; private: @@ -137,9 +135,8 @@ private: //edit the game-specific settings and restore the global settings after exiting bool editThenRestore_; -#if PPSSPP_PLATFORM(ANDROID) + // Android-only std::string pendingMemstickFolder_; -#endif }; class SettingInfoMessage : public UI::LinearLayout { diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index ed5cc4169b..4e94d6ca6a 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -502,7 +502,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch std::string memstickDirFile = g_Config.internalDataDirectory + "/memstick_dir.txt"; if (File::Exists(memstickDirFile)) { std::string memstickDir; - readFileToString(true, memstickDirFile.c_str(), memstickDir); + File::readFileToString(true, memstickDirFile.c_str(), memstickDir); if (!memstickDir.empty() && File::Exists(memstickDir)) { g_Config.memStickDirectory = memstickDir + "/"; }