mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-04-05 06:26:38 +00:00
Add multi-selection context menu
fix compile errors on Mac and provide reviewed changes fix wrong resolved conflict removed duplicate cleanup after latest merged PRs minor cleanup rename and move get_existing_dir() to File.cpp apply reviewed changes
This commit is contained in:
parent
9b256d71a9
commit
9fb7c8f52c
10 changed files with 1393 additions and 521 deletions
|
|
@ -901,6 +901,22 @@ std::string_view fs::get_parent_dir_view(std::string_view path, u32 parent_level
|
|||
return result;
|
||||
}
|
||||
|
||||
std::string fs::get_path_if_dir(const std::string& path)
|
||||
{
|
||||
if (path.empty() || !fs::is_dir(path))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
// If delimiters are already present at the end of the string then nothing else to do
|
||||
if (usz sz = path.find_last_of(delim); sz != umax && (sz + 1) == path.size())
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
return path + '/';
|
||||
}
|
||||
|
||||
bool fs::get_stat(const std::string& path, stat_t& info)
|
||||
{
|
||||
// Ensure consistent information on failure
|
||||
|
|
|
|||
|
|
@ -195,6 +195,9 @@ namespace fs
|
|||
return std::string{get_parent_dir_view(path, parent_level)};
|
||||
}
|
||||
|
||||
// Return "path" plus an ending delimiter (if missing) if "path" is an existing directory. Otherwise, an empty string
|
||||
std::string get_path_if_dir(const std::string& path);
|
||||
|
||||
// Get file information
|
||||
bool get_stat(const std::string& path, stat_t& info);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue