source: cpp/gdk/stdiofile.cpp @ 105

Last change on this file since 105 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
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_dir.h"
7#include "nonstd_stdio.h"
8#include "framsg.h"
9
10VirtFILE* StdioFileSystem::Vfopen(const char* path,const char*mode)
11{
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;
16}
17
18VirtDIR* StdioFileSystem::Vopendir(const char* path)
19{
20        //FMprintf("Vopendir %s",path);
21        DIR *d=opendir(path);
22        //FMprintf("%p",d);
23        if (d) return new StdioDIR(d); else return 0;
24}
25
26int StdioFileSystem::Vfexists(const char* path)
27{
28        return fileExists(path);
29}
30
31void StdioFILE::setStdio()
32{
33        static StdioFILEDontClose si(stdin);
34        static StdioFILEDontClose so(stdout);
35        static StdioFILEDontClose se(stderr);
36        setVstdin(&si);
37        setVstdout(&so);
38        setVstderr(&se);
39}
40
41dirent* StdioDIR::Vreaddir()
42{
43        //FMprintf("Vreaddir %s",dir);
44        return readdir(dir);
45}
Note: See TracBrowser for help on using the repository browser.