source: cpp/gdk/stdiofile.cpp @ 72

Last change on this file since 72 was 66, checked in by Maciej Komosinski, 14 years ago

set 'eol-style' to 'native'

  • Property svn:eol-style set to native
File size: 912 bytes
Line 
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.
4
5#include "stdiofile.h"
6#include "nonstd.h"
7#include "nonstd_io.h"
8
9VirtFILE* StdioFileSystem::Vfopen(const char* path,const char*mode)
10{
11FILE *f=fopen(path,mode);
12if (f) return new StdioFILE(f,path); else return 0;
13}
14
15VirtDIR* StdioFileSystem::Vopendir(const char* path)
16{
17#ifndef _MSC_VER
18DIR *d=opendir(path);
19if (d) return new StdioDIR(d); else
20#endif
21return 0;
22}
23
24int StdioFileSystem::Vfexists(const char* path)
25{return fileExists(path);}
26
27void StdioFILE::setStdio()
28{
29static StdioFILEDontClose si(stdin);
30static StdioFILEDontClose so(stdout);
31static StdioFILEDontClose se(stderr);
32setVstdin(&si);
33setVstdout(&so);
34setVstderr(&se);
35}
36
37#ifndef _MSC_VER
38dirent* StdioDIR::Vreaddir()
39{
40return readdir(dir);
41}
42#endif
Note: See TracBrowser for help on using the repository browser.