diff --git a/Core/ELF/PBPReader.cpp b/Core/ELF/PBPReader.cpp index de9c4452bd..55ea12131e 100644 --- a/Core/ELF/PBPReader.cpp +++ b/Core/ELF/PBPReader.cpp @@ -26,21 +26,21 @@ PBPReader::PBPReader(FileLoader *fileLoader) : file_(nullptr), header_(), isELF_(false) { if (!fileLoader->Exists()) { - ERROR_LOG(LOADER, "Failed to open PBP file %s", fileLoader->Path().c_str()); + ERROR_LOG(LOADER, "Failed to open PBP file %s", fileLoader->GetPath().c_str()); return; } fileSize_ = (size_t)fileLoader->FileSize(); if (fileLoader->ReadAt(0, sizeof(header_), (u8 *)&header_) != sizeof(header_)) { - ERROR_LOG(LOADER, "PBP is too small to be valid: %s", fileLoader->Path().c_str()); + ERROR_LOG(LOADER, "PBP is too small to be valid: %s", fileLoader->GetPath().c_str()); return; } if (memcmp(header_.magic, "\0PBP", 4) != 0) { if (memcmp(header_.magic, "\nFLE", 4) != 0) { - VERBOSE_LOG(LOADER, "%s: File actually an ELF, not a PBP", fileLoader->Path().c_str()); + VERBOSE_LOG(LOADER, "%s: File actually an ELF, not a PBP", fileLoader->GetPath().c_str()); isELF_ = true; } else { - ERROR_LOG(LOADER, "Magic number in %s indicated no PBP: %s", fileLoader->Path().c_str(), header_.magic); + ERROR_LOG(LOADER, "Magic number in %s indicated no PBP: %s", fileLoader->GetPath().c_str(), header_.magic); } return; } diff --git a/Core/FileLoaders/DiskCachingFileLoader.cpp b/Core/FileLoaders/DiskCachingFileLoader.cpp index f5cdff697c..8db137d327 100644 --- a/Core/FileLoaders/DiskCachingFileLoader.cpp +++ b/Core/FileLoaders/DiskCachingFileLoader.cpp @@ -133,7 +133,7 @@ std::vector DiskCachingFileLoader::GetCachedPathsInUse() { void DiskCachingFileLoader::InitCache() { std::lock_guard guard(cachesMutex_); - std::string path = ProxiedFileLoader::Path(); + std::string path = ProxiedFileLoader::GetPath(); auto &entry = caches_[path]; if (!entry) { entry = new DiskCachingFileLoaderCache(path, filesize_); @@ -149,7 +149,7 @@ void DiskCachingFileLoader::ShutdownCache() { if (cache_->Release()) { // If it ran out of counts, delete it. delete cache_; - caches_.erase(ProxiedFileLoader::Path()); + caches_.erase(ProxiedFileLoader::GetPath()); } cache_ = nullptr; } diff --git a/Core/FileLoaders/HTTPFileLoader.cpp b/Core/FileLoaders/HTTPFileLoader.cpp index 620b43c08d..d9497fccc0 100644 --- a/Core/FileLoaders/HTTPFileLoader.cpp +++ b/Core/FileLoaders/HTTPFileLoader.cpp @@ -172,7 +172,7 @@ s64 HTTPFileLoader::FileSize() { return filesize_; } -std::string HTTPFileLoader::Path() const { +std::string HTTPFileLoader::GetPath() const { return filename_; } diff --git a/Core/FileLoaders/HTTPFileLoader.h b/Core/FileLoaders/HTTPFileLoader.h index 6bbba43eff..345ffd147f 100644 --- a/Core/FileLoaders/HTTPFileLoader.h +++ b/Core/FileLoaders/HTTPFileLoader.h @@ -38,7 +38,7 @@ public: virtual bool ExistsFast() override; virtual bool IsDirectory() override; virtual s64 FileSize() override; - virtual std::string Path() const override; + virtual std::string GetPath() const override; virtual size_t ReadAt(s64 absolutePos, size_t bytes, size_t count, void *data, Flags flags = Flags::NONE) override { return ReadAt(absolutePos, bytes * count, data, flags) / bytes; diff --git a/Core/FileLoaders/LocalFileLoader.cpp b/Core/FileLoaders/LocalFileLoader.cpp index 8d6ea5a395..4ee2625e6d 100644 --- a/Core/FileLoaders/LocalFileLoader.cpp +++ b/Core/FileLoaders/LocalFileLoader.cpp @@ -130,7 +130,7 @@ s64 LocalFileLoader::FileSize() { return filesize_; } -std::string LocalFileLoader::Path() const { +std::string LocalFileLoader::GetPath() const { return filename_; } diff --git a/Core/FileLoaders/LocalFileLoader.h b/Core/FileLoaders/LocalFileLoader.h index d3933b55c4..7e28066124 100644 --- a/Core/FileLoaders/LocalFileLoader.h +++ b/Core/FileLoaders/LocalFileLoader.h @@ -33,7 +33,7 @@ public: virtual bool Exists() override; virtual bool IsDirectory() override; virtual s64 FileSize() override; - virtual std::string Path() const override; + virtual std::string GetPath() const override; virtual size_t ReadAt(s64 absolutePos, size_t bytes, size_t count, void *data, Flags flags = Flags::NONE) override; private: diff --git a/Core/FileSystems/BlobFileSystem.cpp b/Core/FileSystems/BlobFileSystem.cpp index 730dca7854..bde0a7fe99 100644 --- a/Core/FileSystems/BlobFileSystem.cpp +++ b/Core/FileSystems/BlobFileSystem.cpp @@ -129,7 +129,7 @@ bool BlobFileSystem::RemoveFile(const std::string &filename) { } bool BlobFileSystem::GetHostPath(const std::string &inpath, std::string &outpath) { - outpath = fileLoader_->Path(); + outpath = fileLoader_->GetPath(); return true; } diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index 5314fac125..0cbd59bb9a 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -202,7 +202,7 @@ CISOFileBlockDevice::CISOFileBlockDevice(FileLoader *fileLoader) u64 expectedFileSize = lastIndexPos << indexShift; if (expectedFileSize > fileSize) { ERROR_LOG(LOADER, "Expected CSO to at least be %lld bytes, but file is %lld bytes. File: '%s'", - expectedFileSize, fileSize, fileLoader->Path().c_str()); + expectedFileSize, fileSize, fileLoader->GetPath().c_str()); NotifyReadError(); } } diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index f61b499cdd..58bd65ac22 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -63,8 +63,8 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader) { ERROR_LOG(LOADER, "Invalid fileLoader"); return IdentifiedFileType::ERROR_IDENTIFYING; } - if (fileLoader->Path().size() == 0) { - ERROR_LOG(LOADER, "Invalid filename %s", fileLoader->Path().c_str()); + if (fileLoader->GetPath().size() == 0) { + ERROR_LOG(LOADER, "Invalid filename %s", fileLoader->GetPath().c_str()); return IdentifiedFileType::ERROR_IDENTIFYING; } @@ -101,7 +101,7 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader) { // First, check if it's a directory with an EBOOT.PBP in it. if (fileLoader->IsDirectory()) { - std::string filename = fileLoader->Path(); + std::string filename = fileLoader->GetPath(); if (filename.size() > 4) { // Check for existence of EBOOT.PBP, as required for "Directory games". if (File::Exists((filename + "/EBOOT.PBP").c_str())) { @@ -142,7 +142,7 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader) { } if (id == 'FLE\x7F') { - std::string filename = fileLoader->Path(); + std::string filename = fileLoader->GetPath(); // There are a few elfs misnamed as pbp (like Trig Wars), accept that. if (!strcasecmp(extension.c_str(), ".plf") || strstr(filename.c_str(),"BOOT.BIN") || !strcasecmp(extension.c_str(), ".elf") || !strcasecmp(extension.c_str(), ".prx") || @@ -177,7 +177,7 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader) { // Let's check if we got pointed to a PBP within such a directory. // If so we just move up and return the directory itself as the game. - std::string path = File::GetDir(fileLoader->Path()); + std::string path = File::GetDir(fileLoader->GetPath()); // If loading from memstick... size_t pos = path.find("/PSP/GAME/"); if (pos != std::string::npos) { @@ -207,8 +207,8 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader) { FileLoader *ResolveFileLoaderTarget(FileLoader *fileLoader) { IdentifiedFileType type = Identify_File(fileLoader); if (type == IdentifiedFileType::PSP_PBP_DIRECTORY) { - const std::string ebootFilename = ResolvePBPFile(fileLoader->Path()); - if (ebootFilename != fileLoader->Path()) { + const std::string ebootFilename = ResolvePBPFile(fileLoader->GetPath()); + if (ebootFilename != fileLoader->GetPath()) { // Switch fileLoader to the actual EBOOT. delete fileLoader; fileLoader = ConstructFileLoader(ebootFilename); @@ -262,7 +262,7 @@ bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string) { coreState = CORE_BOOT_ERROR; return false; } - std::string path = fileLoader->Path(); + std::string path = fileLoader->GetPath(); size_t pos = path.find("/PSP/GAME/"); if (pos != std::string::npos) { path = ResolvePBPDirectory(path); @@ -369,7 +369,7 @@ bool UmdReplace(std::string filepath, std::string &error) { if (!loadedFile->Exists()) { delete loadedFile; - error = loadedFile->Path() + " doesn't exist"; + error = loadedFile->GetPath() + " doesn't exist"; return false; } UpdateLoadedFile(loadedFile); diff --git a/Core/Loaders.h b/Core/Loaders.h index fecb941a6d..ae9673a52d 100644 --- a/Core/Loaders.h +++ b/Core/Loaders.h @@ -74,9 +74,9 @@ public: } virtual bool IsDirectory() = 0; virtual s64 FileSize() = 0; - virtual std::string Path() const = 0; + virtual std::string GetPath() const = 0; virtual std::string Extension() { - const std::string filename = Path(); + const std::string filename = GetPath(); size_t pos = filename.find_last_of('.'); if (pos == filename.npos) { return ""; @@ -121,8 +121,8 @@ public: s64 FileSize() override { return backend_->FileSize(); } - std::string Path() const override { - return backend_->Path(); + std::string GetPath() const override { + return backend_->GetPath(); } void Cancel() override { backend_->Cancel(); diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index 51cd0ed966..0a9b314b7b 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -84,7 +84,7 @@ void InitMemoryForGameISO(FileLoader *fileLoader) { IFileSystem *blockSystem = nullptr; if (fileLoader->IsDirectory()) { - fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->Path()); + fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->GetPath()); blockSystem = fileSystem; } else { auto bd = constructBlockDevice(fileLoader); @@ -152,7 +152,7 @@ bool ReInitMemoryForGameISO(FileLoader *fileLoader) { IFileSystem *blockSystem = nullptr; if (fileLoader->IsDirectory()) { - fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->Path()); + fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->GetPath()); blockSystem = fileSystem; } else { auto bd = constructBlockDevice(fileLoader); @@ -371,7 +371,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { } } - std::string full_path = fileLoader->Path(); + std::string full_path = fileLoader->GetPath(); std::string path, file, extension; SplitPath(ReplaceAll(full_path, "\\", "/"), &path, &file, &extension); diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 2f12fc8e08..a945c458dc 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -370,7 +370,7 @@ public: if (pbp.IsELF()) { goto handleELF; } - ERROR_LOG(LOADER, "invalid pbp %s\n", pbpLoader->Path().c_str()); + ERROR_LOG(LOADER, "invalid pbp %s\n", pbpLoader->GetPath().c_str()); info_->pending = false; info_->working = false; return; diff --git a/UWP/StorageFileLoader.cpp b/UWP/StorageFileLoader.cpp index 1a222255f9..dfc35d9f0c 100644 --- a/UWP/StorageFileLoader.cpp +++ b/UWP/StorageFileLoader.cpp @@ -131,7 +131,7 @@ s64 StorageFileLoader::FileSize() { return size_; } -std::string StorageFileLoader::Path() const { +std::string StorageFileLoader::GetPath() const { return path_; } diff --git a/UWP/StorageFileLoader.h b/UWP/StorageFileLoader.h index 0a85a533bd..82afa95f19 100644 --- a/UWP/StorageFileLoader.h +++ b/UWP/StorageFileLoader.h @@ -24,7 +24,7 @@ public: bool IsDirectory() override; s64 FileSize() override; - std::string Path() const override; + std::string GetPath() const override; std::string Extension() override; size_t ReadAt(s64 absolutePos, size_t bytes, size_t count, void *data, Flags flags = Flags::NONE) override; diff --git a/UWP/StorageFolderBrowser.h b/UWP/StorageFolderBrowser.h index d5da640fa4..b349b4636e 100644 --- a/UWP/StorageFolderBrowser.h +++ b/UWP/StorageFolderBrowser.h @@ -21,7 +21,7 @@ public: StorageFolderBrowser(Windows::Storage::StorageFolder ^folder); ~StorageFolderBrowser(); - std::string Path() const { + std::string GetPath() const { return path_; }