CharAccumulator Class Reference
 
 
 
CharAccumulator Class Reference

#include <maxchar.h>

Inheritance diagram for CharAccumulator:
MaxHeapOperators

Class Description

Character accumulator.

Concatenate "Char" object to form a character string.

Public Member Functions

  CharAccumulator ()
  Construct a new empty character accumulator.
  ~CharAccumulator ()
  Destructor.
  operator MCHAR * () const
  Get the string pointer.
MCHAR *  Get () const
  Get the string pointer.
CharAccumulator operator+= (const Char &)
  Add a character at the end of this string.
void  Reset ()
  Reset this accumulator.
Char  LastCharacter () const
  Obtain the last character in this accumulator.
Char  RemoveLastCharacter ()
  Remove the last character of this accumulator.
size_t  Length () const
  Return the number of MCHAR already in the accumulator.

Protected Attributes

MCHAR *  _buf
size_t  _len
size_t  _allocated

Constructor & Destructor Documentation

Construct a new empty character accumulator.

Destructor.

During cleanup the underlying string is freed.


Member Function Documentation

operator MCHAR * ( ) const

Get the string pointer.

MCHAR* Get ( ) const

Get the string pointer.

CharAccumulator& operator+= ( const Char )

Add a character at the end of this string.

void Reset ( )

Reset this accumulator.

Char LastCharacter ( ) const

Obtain the last character in this accumulator.

Char RemoveLastCharacter ( )

Remove the last character of this accumulator.

size_t Length ( ) const [inline]

Return the number of MCHAR already in the accumulator.

{ return _len; }

Member Data Documentation

MCHAR* _buf [protected]
size_t _len [protected]