source: cpp/common/virtfile/stdinoutfilesystem.cpp @ 1300

Last change on this file since 1300 was 1038, checked in by Maciej Komosinski, 4 years ago

Ensure that when stdin/stdout/stderr are not supported (e.g., Android apps), the source does not use them (conflicts with MFILE...)

File size: 661 bytes
Line 
1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
3// See LICENSE.txt for details.
4
5#include "stdinoutfilesystem.h"
6#include "stdiofile.h"
7
8
9VirtFILE *StdInOutFileSystem::Vfopen(const char* path, const char*mode)
10{
11#ifndef NO_STD_IN_OUT_ERR
12        if (isStdInOutPath(path))
13        {
14                if (*mode == 'r')
15                        return new StdioFILEDontClose(stdin);
16                else
17                        return new StdioFILEDontClose(stdout);
18        }
19#endif
20        return (chain != NULL) ? chain->Vfopen(path, mode) : NULL;
21}
22
23bool StdInOutFileSystem::isStdInOutPath(const char* path)
24{
25        return strcmp(path, "-") == 0;
26}
Note: See TracBrowser for help on using the repository browser.