From: Steve Brokenshire Date: Sun, 4 Feb 2018 05:38:23 +0000 (+0000) Subject: file.cpp/.h: wstring version of FileExists for Win32 only X-Git-Tag: release-0.06~2 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=e1f41a323159828fef7a3319768d1bc34fc127d3;p=xestiacalendar%2F.git file.cpp/.h: wstring version of FileExists for Win32 only --- diff --git a/source/common/file.cpp b/source/common/file.cpp index 9e4e448..515ceb9 100644 --- a/source/common/file.cpp +++ b/source/common/file.cpp @@ -38,22 +38,12 @@ bool FileExists(std::string filename){ } -bool FileExists(std::wstring filename) { - #if defined (WIN32) - return PathFileExists(filename.c_str()); - -#else - - struct stat bufferData; - - if (stat(filename.c_str(), &bufferData) == -1) { - return false; - } +bool FileExists(std::wstring filename) { -#endif + return PathFileExists(filename.c_str()); - return true; +} -} \ No newline at end of file +#endif \ No newline at end of file diff --git a/source/common/file.h b/source/common/file.h index 69303d7..65410fa 100644 --- a/source/common/file.h +++ b/source/common/file.h @@ -29,6 +29,8 @@ #endif bool FileExists(std::string filename); +#if defined(WIN32) bool FileExists(std::wstring filename); +#endif #endif \ No newline at end of file