CLI: Fix problem building in Windows.
This commit is contained in:
parent
babfba53fb
commit
c6c5ada8da
|
@ -107,6 +107,15 @@ static HANDLE MyFindFirstFile(std::string path, LPWIN32_FIND_DATA findData)
|
||||||
return hFind;
|
return hFind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL MyFileExists(std::string path)
|
||||||
|
{
|
||||||
|
WCHAR * unicodeOss = new wchar_t[path.size() + 1];
|
||||||
|
TransformAnsiToUcs2(path.c_str(), unicodeOss, (path.size() + 1) * sizeof(WCHAR));
|
||||||
|
BOOL result = PathFileExists(unicodeOss);
|
||||||
|
delete [] unicodeOss;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#else // defined(UNICODE)
|
#else // defined(UNICODE)
|
||||||
|
|
||||||
static BOOL MyIsDirectory(std::string path)
|
static BOOL MyIsDirectory(std::string path)
|
||||||
|
@ -125,6 +134,12 @@ static HANDLE MyFindFirstFile(std::string path, LPWIN32_FIND_DATA findData)
|
||||||
return hFind;
|
return hFind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL MyFileExists(std::string path)
|
||||||
|
{
|
||||||
|
BOOL result = PathFileExists(path.c_str());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // defined(UNICODE)
|
#endif // defined(UNICODE)
|
||||||
|
|
||||||
void FileLister::recursiveAddFiles(std::vector<std::string> &filenames, std::map<std::string, long> &filesizes, const std::string &path)
|
void FileLister::recursiveAddFiles(std::vector<std::string> &filenames, std::map<std::string, long> &filesizes, const std::string &path)
|
||||||
|
@ -228,7 +243,7 @@ bool FileLister::isDirectory(const std::string &path)
|
||||||
|
|
||||||
bool FileLister::fileExists(const std::string &path)
|
bool FileLister::fileExists(const std::string &path)
|
||||||
{
|
{
|
||||||
if (PathFileExists(path.c_str()) == TRUE)
|
if (MyFileExists(path) == TRUE)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue