Changeset 820 for cpp/common/virtfile/stdiofile.cpp
- Timestamp:
- 10/09/18 02:00:49 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/virtfile/stdiofile.cpp
r425 r820 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-201 5Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2018 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 29 29 //log_printf("Vopendir %s",path); 30 30 #ifdef __ANDROID__ 31 int resources_prefix_length =getAppResourcesDir().length();31 int resources_prefix_length = getAppResourcesDir().length(); 32 32 if (strncmp(path, getAppResourcesDir().c_str(), resources_prefix_length) == 0) //it is a resources dir 33 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.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 35 return vd; 36 36 } … … 51 51 } 52 52 53 bool StdioFileSystem::Vdirexists(const char* path, bool is_writable) 54 { 55 #ifdef __ANDROID__ 56 int resources_prefix_length = getAppResourcesDir().length(); 57 if (strncmp(path, getAppResourcesDir().c_str(), resources_prefix_length) == 0) //it is a resources dir 58 { 59 if (is_writable) 60 return false; 61 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. 62 if (vd != NULL) 63 { 64 delete vd; 65 return true; 66 } 67 else 68 { 69 return false; 70 } 71 } 72 #endif 73 return directoryExists(path, is_writable); 74 } 75 76 77 78 79 80 53 81 #ifndef NO_STD_IN_OUT_ERR 54 82 void StdioFILE::setStdio() … … 67 95 //log_printf("Vreaddir %s",dir); 68 96 #ifdef _WIN32 69 wdirent *wde =wreaddir(dir);70 if (wde ==NULL) return NULL;97 wdirent *wde = wreaddir(dir); 98 if (wde == NULL) return NULL; 71 99 strcpy(de.d_name, Convert::wstrToUtf8(wde->d_name).c_str()); 72 100 return &de;
Note: See TracChangeset
for help on using the changeset viewer.