nis-util  1.0.D108
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions
output Class Reference

#include <output.h>

Inheritance diagram for output:
output_file output_prefix output_string

Public Types

typedef boost::shared_ptr< outputpointer

Public Member Functions

virtual ~output ()
virtual void put (char c)=0
void put (const char *text)
void put (const rcstring &text)
void indent_to (int column)
bool fits_on_current_line (int width) const
virtual int get_column (void) const =0
virtual int get_line_width (void) const =0

Protected Member Functions

 output ()

Private Member Functions

 output (const output &rhs)
outputoperator= (const output &rhs)

Detailed Description

The output abstract base class is used to represent the processing required to write some output. It could be to a simple file, or it could be filtered in various ways.

Definition at line 31 of file output.h.


Member Typedef Documentation

typedef boost::shared_ptr<output> output::pointer

Reimplemented in output_string.

Definition at line 34 of file output.h.


Constructor & Destructor Documentation

output::~output ( ) [virtual]

The destructor.

Definition at line 24 of file output.cc.

output::output ( ) [protected]

The default constructor. For use by derived classes only.

Definition at line 29 of file output.cc.

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

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

bool output::fits_on_current_line ( int  width) const

The fits_on_current_line method is used to determine whether or not a string of the given width would fit on the current line.

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

Definition at line 63 of file output.cc.

virtual int output::get_column ( void  ) const [pure virtual]

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

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

Implemented in output_prefix, output_file, and output_string.

virtual int output::get_line_width ( void  ) const [pure 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.

Implemented in output_prefix, output_file, and output_string.

void output::indent_to ( int  column)

The indent_to method is used to advance the writing position to the given column, but put(char) space characters. If the writing position is already at or past the given column, it will put(char) one space.

Definition at line 50 of file output.cc.

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

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
virtual void output::put ( char  c) [pure 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.

Implemented in output_prefix, output_string, and output_file.

void output::put ( const char *  text)

The put method is used to write a NUL terminated C string to the output, by calling put(char) once for each non-NULL character.

Parameters:
textThe string to put sent to the output.

Definition at line 35 of file output.cc.

void output::put ( const rcstring text)

The put method is used to write a rcstring to the output, by calling put(char) once for each character.

Parameters:
textThe string to put sent to the output.

Definition at line 43 of file output.cc.


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