src
Public Member Functions | Public Attributes | List of all members
re2c::Input Struct Reference

#include <input.h>

Public Member Functions

 Input (const char *fn)
 
 ~Input ()
 
bool open ()
 
 FORBID_COPY (Input)
 

Public Attributes

FILE * file
 
std::string file_name
 

Detailed Description

Definition at line 11 of file input.h.

Constructor & Destructor Documentation

re2c::Input::Input ( const char *  fn)

Definition at line 5 of file input.cc.

6  : file (NULL)
7  , file_name (fn)
8 {}
std::string file_name
Definition: input.h:14
FILE * file
Definition: input.h:13
re2c::Input::~Input ( )

Definition at line 23 of file input.cc.

24 {
25  if (file != NULL && file != stdin)
26  {
27  fclose (file);
28  }
29 }
FILE * file
Definition: input.h:13

Member Function Documentation

re2c::Input::FORBID_COPY ( Input  )
bool re2c::Input::open ( )

Definition at line 10 of file input.cc.

11 {
12  if (file_name == "<stdin>")
13  {
14  file = stdin;
15  }
16  else
17  {
18  file = fopen (file_name.c_str (), "rb");
19  }
20  return file != NULL;
21 }
std::string file_name
Definition: input.h:14
FILE * file
Definition: input.h:13

Here is the caller graph for this function:

Member Data Documentation

FILE* re2c::Input::file

Definition at line 13 of file input.h.

std::string re2c::Input::file_name

Definition at line 14 of file input.h.


The documentation for this struct was generated from the following files: