MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DirectoryExists

Method DirectoryExists

common/FileSystem.cpp:1760–1780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1758}
1759
1760bool FileSystem::DirectoryExists(const char* path)
1761{
1762 // has a path
1763 if (path[0] == '\0')
1764 return false;
1765
1766 // convert to wide string
1767 const std::wstring wpath = GetWin32Path(path);
1768 if (wpath.empty())
1769 return false;
1770
1771 // determine attributes for the path. if it's a directory, things have to be handled differently..
1772 DWORD fileAttributes = GetFileAttributesW(wpath.c_str());
1773 if (fileAttributes == INVALID_FILE_ATTRIBUTES)
1774 return false;
1775
1776 if (fileAttributes & FILE_ATTRIBUTE_DIRECTORY)
1777 return true;
1778 else
1779 return false;
1780}
1781
1782bool FileSystem::DirectoryIsEmpty(const char* path)
1783{

Callers

nothing calls this directly

Calls 4

GetFileAttributesWFunction · 0.85
statClass · 0.70
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected