mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-09 00:11:17 +12:00
Fixed some dumb mistakes.
This commit is contained in:
parent
d5f6cd5bd6
commit
b1b6a5d8c3
5 changed files with 13 additions and 24 deletions
|
@ -1,11 +1,15 @@
|
|||
#include "FSPath.h"
|
||||
|
||||
#ifndef BOOST_OS_UNIX
|
||||
FSPath& FSPath::operator/= (const FSPath & other)
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -9,10 +9,10 @@ class FSPath : public fs::path {
|
|||
FSPath(const T & other) : fs::path(other) {};
|
||||
|
||||
template <class T>
|
||||
static FSPath Convert(const T& input) {
|
||||
FSPath p;
|
||||
p /= input;
|
||||
return p;
|
||||
static FSPath Convert(const T& input)
|
||||
{
|
||||
return FSPath{} / input;
|
||||
}
|
||||
FSPath& operator/= (const FSPath & other);
|
||||
FSPath& operator/ (const FSPath & other);
|
||||
};
|
|
@ -222,25 +222,10 @@ FSCVirtualFile* FSCVirtualFile_Host::OpenFile(const FSPath& path, FSC_ACCESS_FLA
|
|||
class fscDeviceHostFSC : public fscDeviceC {
|
||||
public:
|
||||
|
||||
FSCVirtualFile* fscDeviceOpenByPathIgnoreCase(std::wstring_view pathString, FSC_ACCESS_FLAG accessFlags, sint32* fscStatus)
|
||||
{
|
||||
*fscStatus = FSC_STATUS_OK;
|
||||
|
||||
FSPath correctedPath = FSPath::Convert(pathString);
|
||||
return FSCVirtualFile_Host::OpenFile(correctedPath, accessFlags, *fscStatus);
|
||||
}
|
||||
|
||||
FSCVirtualFile* fscDeviceOpenByPath(std::wstring_view path, FSC_ACCESS_FLAG accessFlags, void* ctx, sint32* fscStatus) override
|
||||
{
|
||||
*fscStatus = FSC_STATUS_OK;
|
||||
FSCVirtualFile* vf = FSCVirtualFile_Host::OpenFile(path, accessFlags, *fscStatus);
|
||||
#ifdef BOOST_OS_UNIX
|
||||
// failed to open file. maybe the case is different?
|
||||
if (!vf)
|
||||
{
|
||||
vf = fscDeviceOpenByPathIgnoreCase(path, accessFlags, fscStatus);
|
||||
}
|
||||
#endif
|
||||
FSCVirtualFile* vf = FSCVirtualFile_Host::OpenFile(FSPath::Convert(path), accessFlags, *fscStatus);
|
||||
cemu_assert_debug((bool)vf == (*fscStatus == FSC_STATUS_OK));
|
||||
return vf;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue