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

#include <string.h>

Inheritance diagram for input_string:
input

Public Member Functions

virtual ~input_string ()

Static Public Member Functions

static pointer create (const rcstring &filename, const rcstring &text)
static pointer create (const rcstring &filename, const char *text)
static pointer create_env (const rcstring &environment_variable_name)

Protected Member Functions

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

Private Member Functions

 input_string (const rcstring &filename, const rcstring &text)
 input_string ()
 input_string (const input_string &rhs)
input_stringoperator= (const input_string &rhs)

Private Attributes

rcstring filename
int line_number
rcstring text
size_t tpos

Detailed Description

The input_string class is used to represent reading data from an in-memory string.

Definition at line 29 of file string.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 25 of file string.cc.

input_string::input_string ( const rcstring filename,
const rcstring text 
) [private]

The constructor.

Parameters:
filenameThe pseudo-name we are to return when read_inner returns a source file name.
textThe full text of the input data.

Definition at line 30 of file string.cc.

The default constructor. Do not use.

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

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

input::pointer input_string::create ( const rcstring filename,
const rcstring text 
) [static]

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

Parameters:
filenameThe pseudo-name we are to return when read_inner returns a source file name.
textThe full text of the input data.

Definition at line 40 of file string.cc.

input_string::pointer input_string::create ( const rcstring filename,
const char *  text 
) [static]

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

Parameters:
filenameThe pseudo-name we are to return when read_inner returns a source file name.
textThe full text of the input data. A copy will be taken.

Definition at line 49 of file string.cc.

input_string::pointer input_string::create_env ( const rcstring environment_variable_name) [static]

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

Parameters:
environment_variable_nameThe name of the environment variable to read.

Definition at line 58 of file string.cc.

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

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
size_t input_string::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 71 of file string.cc.


Field Documentation

The fubar instance variable is used to remember the pseudo-name we are to return when read_inner returns a source file name.

Definition at line 93 of file string.h.

The line_number instance variable is used to remember the line we are up to, reading out pseudo-file.

Definition at line 99 of file string.h.

The text instance variable is used to remember the full text of the input.

Definition at line 105 of file string.h.

size_t input_string::tpos [private]

The tpos instance variable is used to remember the next read position within the input, used by the read_inner method. If tpos >= text.size(), then we are at "end of file".

Definition at line 112 of file string.h.


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