Changeset 81 for cpp/gdk/stdiofile.cpp
- Timestamp:
- 02/08/13 03:29:17 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/gdk/stdiofile.cpp
r66 r81 4 4 5 5 #include "stdiofile.h" 6 #include "nonstd.h" 7 #include "nonstd_io.h" 6 #include "nonstd_dir.h" 7 #include "nonstd_stdio.h" 8 #include "framsg.h" 8 9 9 10 VirtFILE* StdioFileSystem::Vfopen(const char* path,const char*mode) 10 11 { 11 FILE *f=fopen(path,mode); 12 if (f) return new StdioFILE(f,path); else return 0; 12 //FMprintf("Vfopen %s %s",path,mode); 13 FILE *f=fopen(path,mode); 14 //FMprintf("%p",f); 15 if (f) return new StdioFILE(f,path); else return 0; 13 16 } 14 17 15 18 VirtDIR* StdioFileSystem::Vopendir(const char* path) 16 19 { 17 #ifndef _MSC_VER 18 DIR *d=opendir(path); 19 if (d) return new StdioDIR(d); else 20 #endif 21 return 0; 20 //FMprintf("Vopendir %s",path); 21 DIR *d=opendir(path); 22 //FMprintf("%p",d); 23 if (d) return new StdioDIR(d); else return 0; 22 24 } 23 25 24 26 int StdioFileSystem::Vfexists(const char* path) 25 {return fileExists(path);} 27 { 28 return fileExists(path); 29 } 26 30 27 31 void StdioFILE::setStdio() 28 32 { 29 static StdioFILEDontClose si(stdin);30 static StdioFILEDontClose so(stdout);31 static StdioFILEDontClose se(stderr);32 setVstdin(&si);33 setVstdout(&so);34 setVstderr(&se);33 static StdioFILEDontClose si(stdin); 34 static StdioFILEDontClose so(stdout); 35 static StdioFILEDontClose se(stderr); 36 setVstdin(&si); 37 setVstdout(&so); 38 setVstderr(&se); 35 39 } 36 40 37 #ifndef _MSC_VER38 41 dirent* StdioDIR::Vreaddir() 39 42 { 40 return readdir(dir); 43 //FMprintf("Vreaddir %s",dir); 44 return readdir(dir); 41 45 } 42 #endif
Note: See TracChangeset
for help on using the changeset viewer.