Changeset 374 for cpp/common/nonstd_stdio.cpp
- Timestamp:
- 04/23/15 03:18:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd_stdio.cpp
r372 r374 18 18 #endif 19 19 20 21 22 #ifdef _WIN32 23 FILE* mfile_wfopen(const char *path, const char *mode) //to avoid converting args into wide char in all occurrences of mfopen() 24 { 25 return _wfopen(Convert::utf8ToUtf16(path).c_str(), Convert::strTOwstr(mode).c_str()); 26 } 27 #endif 28 20 29 bool fileExists(const char* path) 21 30 { 22 31 //lepiej gdyby uzywalo stat bo mfopen mogloby cos niepotrzebnie wczytywac przy otwarciu pliku ale mfopen wiadomo ze zadziala wszedzie tak samo 23 #ifdef _WIN3224 MFILE *f = mfopen(Convert::utf8ToUtf16(path).c_str(), Convert::strTOwstr(FOPEN_READ_BINARY).c_str());25 #else26 32 MFILE *f = mfopen(path, FOPEN_READ_BINARY); 27 #endif28 33 if (f == NULL) return false; 29 34 mfclose(f); … … 105 110 { 106 111 int size; 107 #ifdef _WIN32108 MFILE *f = mfopen(Convert::utf8ToUtf16(path).c_str(), Convert::strTOwstr(FOPEN_READ_BINARY).c_str());109 #else110 112 MFILE *f = mfopen(path, FOPEN_READ_BINARY); 111 #endif112 113 if (f == NULL) return -1; 113 114 size = getFileSize(f);
Note: See TracChangeset
for help on using the changeset viewer.