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

#include <stdin.h>

Inheritance diagram for input_stdin:
input

Public Member Functions

virtual ~input_stdin ()

Static Public Member Functions

static pointer create (void)
static bool candidate (const rcstring &filename)

Protected Member Functions

size_t read_inner (source_location &data_locn, void *data, size_t data_size)

Private Member Functions

 input_stdin ()
 input_stdin (const input_stdin &rhs)
input_stdinoperator= (const input_stdin &rhs)

Private Attributes

rcstring filename
int line_number

Detailed Description

The input_stdin class is used to represent an input that reads from the standard input (stdin).

Definition at line 29 of file stdin.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 26 of file stdin.cc.

input_stdin::input_stdin ( ) [private]

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

Definition at line 31 of file stdin.cc.

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

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

bool input_stdin::candidate ( const rcstring filename) [static]

The candidate class method is sued to determine whether or not the given file name is actually refering to the standard input.

Definition at line 44 of file stdin.cc.

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

Definition at line 61 of file stdin.cc.

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

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
size_t input_stdin::read_inner ( source_location data_locn,
void *  data,
size_t  data_size 
) [protected, 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 68 of file stdin.cc.


Field Documentation

The file instance variable is used to remember the name of the file we are reading, usually "stdin". Saves constructing the string repeatedly.

Definition at line 66 of file stdin.h.

int input_stdin::line_number [private]

The line_number instance variable is used to remember the lien number we have read to, so far.

Definition at line 72 of file stdin.h.


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