Changeset 301
- Timestamp:
- 01/19/15 01:50:31 (10 years ago)
- Location:
- cpp/frams/virtfile
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/virtfile/virtfile.cpp
r298 r301 12 12 VirtFileSystem *VirtFILE::vfs = NULL; 13 13 14 VirtFILE *Vfopen(const char* path,const char*mode) 15 { 14 //#define DEBUG_DLL_CALLS 15 16 VirtFILE *Vfopen(const char* path,const char* mode) 17 { 18 #ifdef DEBUG_DLL_CALLS 19 printf("VirtFILE::Vfopen %s %s (vfs=%p)\n",path,mode,VirtFILE::vfs); 20 #endif 16 21 return VirtFILE::vfs ? VirtFILE::vfs->Vfopen(path,mode) : NULL; 17 22 } … … 19 24 VirtDIR *Vopendir(const char* path) 20 25 { 26 #ifdef DEBUG_DLL_CALLS 27 printf("VirtFILE::Vfopendir %s (vfs=%p)\n",path,VirtFILE::vfs); 28 #endif 21 29 return VirtFILE::vfs ? VirtFILE::vfs->Vopendir(path) : NULL; 22 30 } … … 45 53 {} 46 54 47 void VirtFILE::selectFileSystem(VirtFileSystem *s) {vfs=s;} 55 void VirtFILE::selectFileSystem(VirtFileSystem *s) 56 { 57 vfs=s; 58 #ifdef DEBUG_DLL_CALLS 59 ::printf("VirtFILE::selectFileSystem: %p := %p\n",vfs,s); 60 #endif 61 } 48 62 49 63 int VirtFILE::Vprintf(const char *format, va_list args) … … 80 94 81 95 // base class only returns NULL/false/not supported - implementations perform the actual work 82 VirtFILE* VirtFileSystem::Vfopen(const char* path,const char* mode) {return NULL;}96 VirtFILE* VirtFileSystem::Vfopen(const char* path,const char* mode) {return NULL;} 83 97 bool VirtFileSystem::Vfexists(const char* path) {return false;} 84 98 VirtDIR* VirtFileSystem::Vopendir(const char* path) {return NULL;} … … 147 161 ////////// 148 162 149 VirtFILE *ChainFileSystem::Vfopen(const char* path, const char*mode) 150 { 163 164 ChainFileSystem::ChainFileSystem(VirtFileSystem *_chain) 165 { 166 chain=_chain; 167 #ifdef DEBUG_DLL_CALLS 168 printf("ChainFileSystem constructor: %p := %p\n",chain,_chain); 169 #endif 170 } 171 172 173 VirtFILE *ChainFileSystem::Vfopen(const char* path, const char* mode) 174 { 175 #ifdef DEBUG_DLL_CALLS 176 printf("ChainFileSystem::Vfopen %s %s (chain=%p)\n",path,mode,chain); 177 #endif 151 178 return (chain != NULL) ? chain->Vfopen(path, mode) : NULL; 152 179 } … … 159 186 VirtDIR *ChainFileSystem::Vopendir(const char* path) 160 187 { 188 #ifdef DEBUG_DLL_CALLS 189 printf("ChainFileSystem::Vfopendir %s (chain=%p)\n",path,chain); 190 #endif 161 191 return (chain != NULL) ? chain->Vopendir(path) : NULL; 162 192 } -
cpp/frams/virtfile/virtfile.h
r295 r301 11 11 #include <string> 12 12 using std::string; 13 //#include <dirent.h> //to jest inkludowane przez powyzsze14 //struct dirent; //kiedys byla ta linia jak nie bylo jeszcze implementacji windowsowej dirent, ale borlandowi sie nie podoba jak s¹ obie15 13 16 #ifdef DLLEXPORTACTIVE // tylko w tym pliku uzyte14 #ifdef DLLEXPORTACTIVE //defined in the project that makes the DLL 17 15 #define DLLEXP __declspec(dllexport) 18 16 #else 17 #ifdef __BORLANDC__ //assuming that all executables produced by borland use the DLL 18 #define DLLEXP __declspec(dllimport) //without dllimport, fields in objects would have separate instances in DLL and in EXE 19 #else 19 20 #define DLLEXP 21 #endif 20 22 #endif 21 23 … … 102 104 public: 103 105 VirtFileSystem *chain; 104 ChainFileSystem(VirtFileSystem *_chain = NULL) :chain(_chain) {}106 ChainFileSystem(VirtFileSystem *_chain = NULL); 105 107 VirtFILE *Vfopen(const char* path, const char*mode); 106 108 bool Vfexists(const char* path);
Note: See TracChangeset
for help on using the changeset viewer.