Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBosFill Class Reference

I/O appicator to generate fill characters. More...

#include "CTBosFill.hxx"

List of all members.

Public Methods

 CTBosFill (CTBint i_count=0, char c_fill='')
CTBint Count () const
char Fill () const

Private Attributes

CTBint mi_count
char mc_fill

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &os, const CTBosFill &osf)


Detailed Description

I/O appicator to generate fill characters.

An CTBosFill object will add a given number of fill characters to an output stream each time the object is inserted into the stream. The fill character and the repeat count are specified when the object is constructed.

A typical usage of CTBosFill is to implement indention, especially when the amount of indention is only known at runtime. The Dump() functions of many CTB classes use CTBosFill following the pattern:

void xyz::Dump(int i_indent,ostream& os) const
{
  CTBosFill bl(i_indent);
  
  os << bl << "-- xyz " << " @ " << this << endl;
  os << bl << "  mi_v1:       " << mi_v1 << endl;
  os << bl << "  mi_v1:       " << mi_v1 << endl;
  m_embed.Dump(i_indent+2,os);
  return;
}

The indention is passed with i_indent. The object bl is setup to create i_indent blanks and thrown into the outstream os at the start of each output line. The Dump() function of member variables of class type is called with a increamented indention (here i_indent+2). This finally produces a nicely structured output.

Definition at line 16 of file CTBosFill.hxx.


Constructor & Destructor Documentation

CTBosFill::CTBosFill CTBint i_count = 0,
char c_fill = ' '
[inline]
 

Constructor.

The fill character is specified with c_fill, the repeat count is specified with i_count. Note, that CTBosFill does not have a default constructor and that this constructor is the only means to set this object up. Note also, that the c_fill argument can be omitted, the default fill character is a blank.

Definition at line 23 of file CTBosFill.icc.


Member Function Documentation

CTBint CTBosFill::Count const [inline]
 

Get repeat count.

Definition at line 31 of file CTBosFill.icc.

Referenced by operator<<().

char CTBosFill::Fill const [inline]
 

Get fill character.

Definition at line 39 of file CTBosFill.icc.

Referenced by operator<<().


Friends And Related Function Documentation

ostream & operator<< ostream & os,
const CTBosFill & osf
[related]
 

ostream insertion operator.

Definition at line 53 of file CTBosFill.cxx.


Member Data Documentation

CTBint CTBosFill::mi_count [private]
 

Definition at line 26 of file CTBosFill.hxx.

char CTBosFill::mc_fill [private]
 

Definition at line 27 of file CTBosFill.hxx.


The documentation for this class was generated from the following files:
Generated at Fri Oct 24 18:13:57 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001