Gyoji Compiler
|
This is an input source for files. More...
#include <input-source-file.hpp>
Public Member Functions | |
InputSourceFile (int _fd) | |
Create input source by file descriptor. | |
~InputSourceFile () | |
Move along, nothing to see here. | |
void | read (char *buf, int &result, int max_size) |
Method to read input from the file. | |
![]() | |
InputSource () | |
Constructor just provides an interface. | |
~InputSource () | |
Move along, nothing to see here. | |
This is an input source for files.
This is an implementation of an input source based on a stdio FILE* descriptor, reading the data from the given file.
InputSourceFile::InputSourceFile | ( | int | _fd | ) |
Create input source by file descriptor.
Constructs an input source reader for the given file. Note that the caller is responsible for opening and closing the file. This reader merely uses the file provided to gather the data, but assumes no responsibility for its overall lifetime.
InputSourceFile::~InputSourceFile | ( | ) |
Move along, nothing to see here.
Move along, nothing to see here.
|
virtual |
Method to read input from the file.
This provides the parser with data from the given file using 'fread' to read from the file and provide data directly to the buffer. The 'result' represents the number of bytes actually read.
Implements Gyoji::misc::InputSource.