ircproxy  The Ultimate Cyborg

Indentation Class Reference

#include <PersistXML.h>

List of all members.


Detailed Description

A class to control output indentation.

Definition at line 64 of file PersistXML.h.


Public Member Functions

 Indentation (void)
 Construct a new indentation object of zero spaces.
 Indentation (Indentation const &indent)
 Copy constructor.
Indentationoperator++ (void)
 Pre-increment indentation with two spaces.
Indentation operator++ (int)
 Post-increment indentation with two spaces.
Indentationoperator-- (void)
 Pre-decrement indentation by two spaces.
Indentation operator-- (int)
 Post-decrement indentation by two spaces.

Private Attributes

int M_spaces
 The number of spaces to indent.

Friends

std::ostream & operator<< (std::ostream &os, Indentation const &indentation)
 Print object to ostream.

Constructor & Destructor Documentation

Indentation::Indentation ( void   )  [inline]

Construct a new indentation object of zero spaces.

Definition at line 69 of file PersistXML.h.

00069 : M_spaces(0) { }

Indentation::Indentation ( Indentation const &  indent  )  [inline]

Copy constructor.

Definition at line 71 of file PersistXML.h.

00071 : M_spaces(indent.M_spaces) { }


Member Function Documentation

Indentation& Indentation::operator++ ( void   )  [inline]

Pre-increment indentation with two spaces.

Definition at line 73 of file PersistXML.h.

References M_spaces.

00073 { M_spaces += 2; return *this; }

Indentation Indentation::operator++ ( int   )  [inline]

Post-increment indentation with two spaces.

Definition at line 75 of file PersistXML.h.

References M_spaces.

00075 { Indentation tmp(*this); M_spaces += 2; return tmp; }

Indentation& Indentation::operator-- ( void   )  [inline]

Pre-decrement indentation by two spaces.

Definition at line 77 of file PersistXML.h.

References M_spaces.

00077 { M_spaces -= 2; return *this; }

Indentation Indentation::operator-- ( int   )  [inline]

Post-decrement indentation by two spaces.

Definition at line 79 of file PersistXML.h.

References M_spaces.

00079 { Indentation tmp(*this); M_spaces -= 2; return tmp; }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
Indentation const &  indentation 
) [friend]

Print object to ostream.

Definition at line 81 of file PersistXML.h.

00082   {
00083     for (int i = 0; i < indentation.M_spaces; ++i)
00084       os << ' ';
00085     return os;
00086   }


Member Data Documentation

int Indentation::M_spaces [private]

The number of spaces to indent.

Definition at line 66 of file PersistXML.h.

Referenced by operator++(), and operator--().


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

Copyright © 2005-2007 Carlo Wood.  All rights reserved.