mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 22:11:18 +12:00
That should do it
This commit is contained in:
parent
b1b6a5d8c3
commit
37cfd78afd
9 changed files with 22 additions and 29 deletions
|
@ -1,16 +1,13 @@
|
|||
#include "FSPath.h"
|
||||
|
||||
#ifdef BOOST_OS_LINUX
|
||||
|
||||
FSPath& FSPath::operator/ (const FSPath & other)
|
||||
{
|
||||
*this /= other;
|
||||
return *this;
|
||||
}
|
||||
#ifndef BOOST_OS_UNIX
|
||||
FSPath& FSPath::operator/= (const FSPath & other)
|
||||
{
|
||||
fs::path::operator/=(other);
|
||||
}
|
||||
#else
|
||||
|
||||
FSPath& FSPath::operator/= (const FSPath & other)
|
||||
{
|
||||
// todo: implement caching.
|
||||
|
@ -20,9 +17,9 @@ FSPath& FSPath::operator/= (const FSPath & other)
|
|||
fs::path correctedPath = empty() ? other.root_path() : *this;
|
||||
|
||||
// helper function to convert a path's alphabet characters to lowercase.
|
||||
auto static lowercase_path = [](fs::path const & path)
|
||||
auto static lowercase_path = [](FSPath const & path)
|
||||
{
|
||||
std::wstring string = path.wstring();
|
||||
std::string string = path.string();
|
||||
for (auto& i : string)
|
||||
{
|
||||
i = std::isalpha(i) ? std::tolower(i) : i;
|
||||
|
@ -47,19 +44,13 @@ FSPath& FSPath::operator/= (const FSPath & other)
|
|||
}
|
||||
|
||||
// if we can't iterate directory, just copy the original case.
|
||||
if(listErr)
|
||||
if(listErr || !found)
|
||||
{
|
||||
correctedPath /= it;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
break;
|
||||
}
|
||||
|
||||
if (found)
|
||||
*this = correctedPath;
|
||||
|
||||
*this = FSPath(correctedPath);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue