mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Common: Remove File::GetFilename().
This commit is contained in:
parent
b74ecd5fa0
commit
a097403298
5 changed files with 4 additions and 15 deletions
|
@ -578,14 +578,6 @@ std::string GetDir(const std::string &path) {
|
|||
return cutpath;
|
||||
}
|
||||
|
||||
std::string GetFilename(std::string path) {
|
||||
size_t off = GetDir(path).size() + 1;
|
||||
if (off < path.size())
|
||||
return path.substr(off);
|
||||
else
|
||||
return path;
|
||||
}
|
||||
|
||||
std::string GetFileExtension(const std::string & fn) {
|
||||
size_t pos = fn.rfind(".");
|
||||
if (pos == std::string::npos) {
|
||||
|
|
|
@ -59,9 +59,6 @@ std::string GetFileExtension(const std::string &filename);
|
|||
// Extracts the directory from a path.
|
||||
std::string GetDir(const std::string &path);
|
||||
|
||||
// Extracts the filename from a path.
|
||||
std::string GetFilename(std::string path);
|
||||
|
||||
// Returns struct with modification date of file
|
||||
bool GetModifTime(const Path &filename, tm &return_time);
|
||||
|
||||
|
|
|
@ -209,9 +209,9 @@ bool PathBrowser::IsListingReady() {
|
|||
}
|
||||
|
||||
std::string PathBrowser::GetFriendlyPath() const {
|
||||
std::string str = GetPath().ToString();
|
||||
std::string str = GetPath().ToVisualString();
|
||||
// Show relative to memstick root if there.
|
||||
std::string root = GetSysDirectory(DIRECTORY_MEMSTICK_ROOT).ToString();
|
||||
std::string root = GetSysDirectory(DIRECTORY_MEMSTICK_ROOT).ToVisualString();
|
||||
|
||||
if (startsWith(str, root)) {
|
||||
return std::string("ms:/") + str.substr(root.size());
|
||||
|
|
|
@ -206,7 +206,7 @@ bool DiscIDFromGEDumpPath(const Path &path, FileLoader *fileLoader, std::string
|
|||
}
|
||||
|
||||
// Fall back to using the filename.
|
||||
std::string filename = File::GetFilename(path.ToString());
|
||||
std::string filename = path.GetFilename();
|
||||
// Could be more discerning, but hey..
|
||||
if (filename.size() > 10 && filename[0] == 'U' && filename[9] == '_') {
|
||||
*id = filename.substr(0, 9);
|
||||
|
|
|
@ -206,7 +206,7 @@ bool GameInfo::LoadFromPath(const Path &gamePath) {
|
|||
filePath_ = gamePath;
|
||||
|
||||
// This is a fallback title, while we're loading / if unable to load.
|
||||
title = File::GetFilename(filePath_.ToString());
|
||||
title = filePath_.GetFilename();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue