X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fcommon%2Ffile.cpp;h=9e4e448cf5a2912c75e62ef5e60dd824dd4fafd2;hp=076752d0a4ba4c5992ea0fa75f5960d62ffafe1c;hb=49789773e2797383c866dca470fb99e80cb49e41;hpb=a191ad71a0d6823b9710067c7cccf8905290dc9c diff --git a/source/common/file.cpp b/source/common/file.cpp index 076752d..9e4e448 100644 --- a/source/common/file.cpp +++ b/source/common/file.cpp @@ -22,7 +22,7 @@ using namespace std; bool FileExists(std::string filename){ -#if defined (__WIN32__) +#if defined (WIN32) #else @@ -36,4 +36,24 @@ bool FileExists(std::string filename){ return true; +} + +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; + } + +#endif + + return true; + } \ No newline at end of file