mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-31 22:00:46 +00:00
8c95516224
- 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.
31 lines
370 B
C++
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
|