raze-gles/tools/re2c/src/parse/input.cc
Christoph Oelckers 8c95516224 - added compile tools from GZDoom repo:
- updaterevision for automated revision string generation
- re2c as a prerequisite to use sc_man in the future
- zipdir to automatically generate an engine resource file.
2019-09-22 08:52:30 +02:00

31 lines
370 B
C++

#include "src/parse/input.h"
namespace re2c {
Input::Input (const char * fn)
: file (NULL)
, file_name (fn)
{}
bool Input::open ()
{
if (file_name == "<stdin>")
{
file = stdin;
}
else
{
file = fopen (file_name.c_str (), "rb");
}
return file != NULL;
}
Input::~Input ()
{
if (file != NULL && file != stdin)
{
fclose (file);
}
}
} // namespace re2c