Last change
on this file since 50 was
5,
checked in by sz, 16 years ago
|
added the GDK (Genotype Development Kit)
|
File size:
908 bytes
|
Line | |
---|
1 | // This file is a part of Framsticks GDK library. |
---|
2 | // Copyright (C) 2002-2006 Szymon Ulatowski. See LICENSE.txt for details. |
---|
3 | // Refer to http://www.frams.alife.pl/ for further information. |
---|
4 | |
---|
5 | #include "stdiofile.h" |
---|
6 | #include "nonstd.h" |
---|
7 | #include "nonstd_io.h" |
---|
8 | |
---|
9 | VirtFILE* StdioFileSystem::Vfopen(const char* path,const char*mode) |
---|
10 | { |
---|
11 | FILE *f=fopen(path,mode); |
---|
12 | if (f) return new StdioFILE(f,path); else return 0; |
---|
13 | } |
---|
14 | |
---|
15 | VirtDIR* StdioFileSystem::Vopendir(const char* path) |
---|
16 | { |
---|
17 | #ifndef _MSC_VER |
---|
18 | DIR *d=opendir(path); |
---|
19 | if (d) return new StdioDIR(d); else |
---|
20 | #endif |
---|
21 | return 0; |
---|
22 | } |
---|
23 | |
---|
24 | int StdioFileSystem::Vfexists(const char* path) |
---|
25 | {return fileExists(path);} |
---|
26 | |
---|
27 | void StdioFILE::setStdio() |
---|
28 | { |
---|
29 | static StdioFILEDontClose si(stdin); |
---|
30 | static StdioFILEDontClose so(stdout); |
---|
31 | static StdioFILEDontClose se(stderr); |
---|
32 | setVstdin(&si); |
---|
33 | setVstdout(&so); |
---|
34 | setVstderr(&se); |
---|
35 | } |
---|
36 | |
---|
37 | #ifndef _MSC_VER |
---|
38 | dirent* StdioDIR::Vreaddir() |
---|
39 | { |
---|
40 | return readdir(dir); |
---|
41 | } |
---|
42 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.