Changeset 425 for cpp/common/virtfile/stdiofile.cpp
- Timestamp:
- 08/27/15 00:05:32 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/virtfile/stdiofile.cpp
r375 r425 8 8 #include <common/log.h> 9 9 #include <common/Convert.h> 10 #ifdef __ANDROID__ 11 #include <common/dirs.h> 12 #include <common/platform/android/AndroidAPK_DIR.h> 13 #endif 10 14 11 15 VirtFILE* StdioFileSystem::Vfopen(const char *path, const char *mode) … … 24 28 { 25 29 //log_printf("Vopendir %s",path); 30 #ifdef __ANDROID__ 31 int resources_prefix_length=getAppResourcesDir().length(); 32 if (strncmp(path, getAppResourcesDir().c_str(), resources_prefix_length) == 0) //it is a resources dir 33 { 34 VirtDIR *vd = AndroidAPK_DIR::opendir(path+resources_prefix_length+1); //+1 because we also skip '/' and start with a "relative" dir, otherwise it does not work. 35 return vd; 36 } 37 #endif 38 26 39 #ifdef _WIN32 27 40 DIRTYPE *d = wopendir(Convert::utf8ToUtf16(path).c_str()); … … 38 51 } 39 52 53 #ifndef NO_STD_IN_OUT_ERR 40 54 void StdioFILE::setStdio() 41 55 { 42 #ifndef NO_STD_IN_OUT_ERR43 56 static StdioFILEDontClose si(stdin); 44 57 static StdioFILEDontClose so(stdout); … … 47 60 setVstdout(&so); 48 61 setVstderr(&se); 62 } 49 63 #endif 50 }51 64 52 65 dirent* StdioDIR::Vreaddir()
Note: See TracChangeset
for help on using the changeset viewer.