Changeset 281 for cpp/frams/virtfile/stdiofile.cpp
- Timestamp:
- 12/27/14 01:01:43 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/virtfile/stdiofile.cpp
r227 r281 7 7 #include <common/nonstd_stdio.h> 8 8 #include <common/framsg.h> 9 #include <common/Convert.h> 9 10 10 VirtFILE* StdioFileSystem::Vfopen(const char * path,const char*mode)11 VirtFILE* StdioFileSystem::Vfopen(const char *path, const char *mode) 11 12 { 12 13 //printFM("Vfopen %s %s",path,mode); 13 14 #ifdef USE_MFILE 14 MFILE *f =mfopen(path,mode);15 MFILE *f = mfopen(path, mode); 15 16 #else 16 FILE *f=fopen(path,mode); 17 #ifdef _WIN32 18 FILE *f = _wfopen(Convert::utf8ToUtf16(path).c_str(), Convert::strTOwstr(mode).c_str()); 19 #else 20 FILE *f = fopen(path, mode); 21 #endif 17 22 #endif 18 23 //printFM("%p",f); 19 if (f) return new StdioFILE(f, path); else return 0;24 if (f) return new StdioFILE(f, path); else return 0; 20 25 } 21 26 … … 23 28 { 24 29 //printFM("Vopendir %s",path); 25 DIR *d=opendir(path); 30 #ifdef _WIN32 31 DIRTYPE *d = wopendir(Convert::utf8ToUtf16(path).c_str()); 32 #else 33 DIR *d = opendir(path); 34 #endif 26 35 //printFM("%p",d); 27 36 if (d) return new StdioDIR(d); else return 0; … … 48 57 { 49 58 //printFM("Vreaddir %s",dir); 59 #ifdef _WIN32 60 wdirent *wde=wreaddir(dir); 61 if (wde==NULL) return NULL; 62 strcpy(de.d_name, Convert::wstrToUtf8(wde->d_name).c_str()); 63 return &de; 64 #else 50 65 return readdir(dir); 66 #endif 51 67 }
Note: See TracChangeset
for help on using the changeset viewer.