Use std::replace rather than string::replace
This commit is contained in:
parent
5d663a7969
commit
c87b4ecc33
1 changed files with 5 additions and 3 deletions
|
|
@ -16,12 +16,14 @@
|
|||
#if defined(_WIN32)
|
||||
const fs::path toPlatformAgnosticPath(std::string& filePath)
|
||||
{
|
||||
return fs::u8path(filePath.replace(filePath.begin(), filePath.end(), '\\', '/'));
|
||||
std::replace(filePath.begin(), filePath.end(), '\\', '/');
|
||||
return fs::u8path(filePath);
|
||||
}
|
||||
const fs::path fromPlatformAgnosticPath(const char *filePath)
|
||||
{
|
||||
std::string p{filePath};
|
||||
return fs::u8path(p.replace(p.begin(), p.end(), '/', '\\'));
|
||||
std::string p { filePath };
|
||||
std::replace(p.begin(), p.end(), '/', '\\');
|
||||
return fs::u8path(p);
|
||||
}
|
||||
#else
|
||||
const fs::path toPlatformAgnosticPath(std::string& filePath)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue