mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Use existing File::IsDirectory() function. Thanks to nakee for pointing this out.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@639 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
385e3276bb
commit
6bffd4d4bb
@ -20,14 +20,12 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "VolumeDirectory.h"
|
#include "VolumeDirectory.h"
|
||||||
#include "FileBlob.h"
|
#include "FileBlob.h"
|
||||||
|
#include "FileUtil.h"
|
||||||
|
|
||||||
namespace DiscIO
|
namespace DiscIO
|
||||||
{
|
{
|
||||||
@ -76,22 +74,7 @@ CVolumeDirectory::~CVolumeDirectory()
|
|||||||
bool CVolumeDirectory::IsValidDirectory(const std::string& _rDirectory)
|
bool CVolumeDirectory::IsValidDirectory(const std::string& _rDirectory)
|
||||||
{
|
{
|
||||||
std::string directoryName = ExtractDirectoryName(_rDirectory);
|
std::string directoryName = ExtractDirectoryName(_rDirectory);
|
||||||
|
return File::IsDirectory(directoryName.c_str());
|
||||||
#ifdef _WIN32
|
|
||||||
WIN32_FIND_DATA ffd;
|
|
||||||
HANDLE hFind = FindFirstFile(directoryName.c_str(), &ffd);
|
|
||||||
|
|
||||||
if (hFind == INVALID_HANDLE_VALUE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
struct stat info;
|
|
||||||
if (!stat(directoryName.c_str(), &info))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return S_ISDIR(info.st_mode);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
|
bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
|
||||||
|
Loading…
Reference in New Issue
Block a user