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

#include <prefix.h>

Inheritance diagram for output_prefix:
output

Public Member Functions

virtual ~output_prefix ()

Static Public Member Functions

static pointer create (const output::pointer &deeper, const rcstring &prefix)
static pointer create (const output::pointer &deeper, int indent)

Protected Member Functions

void put (char c)
int get_line_width (void) const
int get_column (void) const

Private Member Functions

 output_prefix (const output::pointer &deeper, const rcstring &prefix)
 output_prefix (const output::pointer &deeper, int indent)
 output_prefix ()
 output_prefix (const output_prefix &rhs)
output_prefixoperator= (const output_prefix &rhs)

Private Attributes

output::pointer deeper
rcstring prefix
rcstring prefix0

Detailed Description

The output_prefix class is used to represent the processing required to add a prefix to the beginning of every output line.

Definition at line 28 of file prefix.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 24 of file prefix.cc.

output_prefix::output_prefix ( const output::pointer deeper,
const rcstring prefix 
) [private]

The constructor.

Parameters:
deeperwhen to send our indented output
prefixThe string prefix to add to each line. The only white space it is permitted to contain is the simple space character.

Definition at line 29 of file prefix.cc.

output_prefix::output_prefix ( const output::pointer deeper,
int  indent 
) [private]

The constructor.

Parameters:
deeperwhen to send our indented output
indentThe number of spaces to add to the start of each line

Definition at line 48 of file prefix.cc.

The default constructor. Do not use.

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

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

output_prefix::pointer output_prefix::create ( const output::pointer deeper,
const rcstring prefix 
) [static]

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

Parameters:
deeperwhen to send our indented output
prefixThe string prefix to add to each line. The only white space it is permitted to contain is the simple space character.

Definition at line 42 of file prefix.cc.

output_prefix::pointer output_prefix::create ( const output::pointer deeper,
int  indent 
) [static]

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

Parameters:
deeperwhen to send our indented output
indentThe number of spaces to add to the start of each line

Definition at line 60 of file prefix.cc.

int output_prefix::get_column ( void  ) const [protected, virtual]

The get_column method is used to obtain the current output column position.

Note:
It does not understand multi-byte character encodings.

Implements output.

Definition at line 81 of file prefix.cc.

int output_prefix::get_line_width ( void  ) const [protected, virtual]

The get_line_width method is used to obtain the width of lines in the output. This may vary depending on what filtering is present.

Implements output.

Definition at line 91 of file prefix.cc.

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

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
void output_prefix::put ( char  c) [protected, virtual]

The put method is used to write a character to the output file. Each derived class is required to override this with their own implementation.

Parameters:
cThe character to be written.

Implements output.

Definition at line 67 of file prefix.cc.


Field Documentation

The deeper instance variable is used to remember where to send ort filtered output.

Definition at line 97 of file prefix.h.

The prefix instance variable is used to remember the prefix to be added to each output line.

Definition at line 103 of file prefix.h.

The prefix0 instance variable i sused to remember the output line prefix, but with all trailing white space removed. This will be used to prefix empty output lines.

Definition at line 110 of file prefix.h.


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