Last change
on this file since 97 was
81,
checked in by Maciej Komosinski, 12 years ago
|
improved parsing of properties (e.g. in f0 genotypes)
|
-
Property svn:eol-style set to
native
|
File size:
1.0 KB
|
Rev | Line | |
---|
[64] | 1 | // This file is a part of the Framsticks GDK library. |
---|
| 2 | // Copyright (C) 2002-2011 Szymon Ulatowski. See LICENSE.txt for details. |
---|
| 3 | // Refer to http://www.framsticks.com/ for further information. |
---|
[5] | 4 | |
---|
| 5 | #include "stdiofile.h" |
---|
[81] | 6 | #include "nonstd_dir.h" |
---|
| 7 | #include "nonstd_stdio.h" |
---|
| 8 | #include "framsg.h" |
---|
[5] | 9 | |
---|
| 10 | VirtFILE* StdioFileSystem::Vfopen(const char* path,const char*mode) |
---|
| 11 | { |
---|
[81] | 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; |
---|
[5] | 16 | } |
---|
| 17 | |
---|
| 18 | VirtDIR* StdioFileSystem::Vopendir(const char* path) |
---|
| 19 | { |
---|
[81] | 20 | //FMprintf("Vopendir %s",path); |
---|
| 21 | DIR *d=opendir(path); |
---|
| 22 | //FMprintf("%p",d); |
---|
| 23 | if (d) return new StdioDIR(d); else return 0; |
---|
[5] | 24 | } |
---|
| 25 | |
---|
| 26 | int StdioFileSystem::Vfexists(const char* path) |
---|
[81] | 27 | { |
---|
| 28 | return fileExists(path); |
---|
| 29 | } |
---|
[5] | 30 | |
---|
| 31 | void StdioFILE::setStdio() |
---|
| 32 | { |
---|
[81] | 33 | static StdioFILEDontClose si(stdin); |
---|
| 34 | static StdioFILEDontClose so(stdout); |
---|
| 35 | static StdioFILEDontClose se(stderr); |
---|
| 36 | setVstdin(&si); |
---|
| 37 | setVstdout(&so); |
---|
| 38 | setVstderr(&se); |
---|
[5] | 39 | } |
---|
| 40 | |
---|
| 41 | dirent* StdioDIR::Vreaddir() |
---|
| 42 | { |
---|
[81] | 43 | //FMprintf("Vreaddir %s",dir); |
---|
| 44 | return readdir(dir); |
---|
[5] | 45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.