Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Gyoji::misc::InputSourceFile Class Reference

This is an input source for files. More...

#include <input-source-file.hpp>

Inheritance diagram for Gyoji::misc::InputSourceFile:
Inheritance graph
[legend]
Collaboration diagram for Gyoji::misc::InputSourceFile:
Collaboration graph
[legend]

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.
 
- Public Member Functions inherited from Gyoji::misc::InputSource
 InputSource ()
 Constructor just provides an interface.
 
 ~InputSource ()
 Move along, nothing to see here.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ InputSourceFile()

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::~InputSourceFile ( )

Move along, nothing to see here.

Move along, nothing to see here.

Member Function Documentation

◆ read()

void InputSourceFile::read ( char *  buf,
int &  result,
int  max_size 
)
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.


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