nis-util  1.0.D108
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
input_file Class Reference

#include <file.h>

Inheritance diagram for input_file:
input

Public Member Functions

virtual ~input_file ()

Static Public Member Functions

static input::pointer create (const rcstring &filename)

Private Member Functions

 input_file (const rcstring &filename)
size_t read_inner (source_location &data_locn, void *data, size_t data_size)
 input_file ()
 input_file (const input_file &rhs)
input_fileoperator= (const input_file &rhs)

Private Attributes

rcstring filename
int line_number
int fd

Detailed Description

The input_file class is used to represent the processing required to read input from a file.

Definition at line 29 of file file.h.


Constructor & Destructor Documentation

input_file::~input_file ( ) [virtual]

The destructor.

Definition at line 28 of file file.cc.

input_file::input_file ( const rcstring filename) [private]

The constructor. It is private on purpose, use the create class method instead.

Parameters:
filenameThe name of the file to be read. The empty string and the value "-" mean the standard input (stdin).

Definition at line 39 of file file.cc.

input_file::input_file ( ) [private]

The default constructor. Do not use.

input_file::input_file ( const input_file rhs) [private]

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

input::pointer input_file::create ( const rcstring filename) [static]

The create class method is used to create new dynamically allocated instances of this class.

Parameters:
filenameThe name of the file to be read. The empty string and the value "-" mean the standard input (stdin).

Definition at line 49 of file file.cc.

input_file& input_file::operator= ( const input_file rhs) [private]

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
size_t input_file::read_inner ( source_location data_locn,
void *  data,
size_t  data_size 
) [private, virtual]

The read_inner method is called byu the underflow method to fill the buffer buf with more data.

Parameters:
data_locnThe location of the beginning of the returned data. It is the first argument because it's position is immediately before the returned data.
datapointer to the base of an array to receive the data
data_sizethe maximum number of bytes of data than can be received into the data array.
Returns:
The nunber of bytes read into data, or 0 at end of file. always <= data_size

Implements input.

Definition at line 58 of file file.cc.


Field Documentation

int input_file::fd [private]

The fd instance variable is used to remember the open file descriptor of this input. We use file descriptors so that our error processing can be done by libexplain.

Definition at line 79 of file file.h.

The filename instance variable is used to remember the name of the file to be read.

Definition at line 63 of file file.h.

int input_file::line_number [private]

The line_number instance variable is used to remember the line number we are up to, relative to the read_inner method.

Definition at line 69 of file file.h.


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