Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

CharArrayArrayBeautifier Class Reference

#include <CharArrayArrayBeautifier.hpp>

List of all members.

Public Member Functions

 CharArrayArrayBeautifier (int num_)
 ~CharArrayArrayBeautifier ()
void set (int i, const char *cstr)
char ** getArray ()
void add (const char *cstr)

Private Member Functions

char * newCopy (const char *cstr)

Private Attributes

char ** array
int num
int addedTokens


Detailed Description

CharArrayArrayBeautifier :-)

"Arrays are evil" is an old? saying. However, in some situations we still need them. This class safely allocates a char ** array, allows one to add C-like strings to it, and so on, encapsulating problems related to direct array manipulation.

Special thanks to the author who contributed with this class.

Author:
Wagner Cesar Bruna (C++ & all-around Guru (in constant training))


Constructor & Destructor Documentation

CharArrayArrayBeautifier::CharArrayArrayBeautifier int  num_  ) 
 

Constructs a CharArrayArrayBeautifier.

Parameters:
num_ - size of the array that will be allocated.

CharArrayArrayBeautifier::~CharArrayArrayBeautifier  ) 
 

Destructor.


Member Function Documentation

void CharArrayArrayBeautifier::add const char *  cstr  )  [inline]
 

char ** CharArrayArrayBeautifier::getArray  ) 
 

Returns the resulting array.

char * CharArrayArrayBeautifier::newCopy const char *  cstr  )  [private]
 

Copies an array.

Parameters:
cstr - The source array to be copied.
Returns:
a pointer to the new allocated array/

void CharArrayArrayBeautifier::set int  i,
const char *  cstr
 

Adds another cstring to our char ** array.

Parameters:
i - the index where the string should be added.
cstr - the string to be added


Member Data Documentation

int CharArrayArrayBeautifier::addedTokens [private]
 

number of tokens already added to the beautifier

char** CharArrayArrayBeautifier::array [private]
 

our array

int CharArrayArrayBeautifier::num [private]
 

array size


The documentation for this class was generated from the following files:
Generated on Mon Sep 6 16:13:10 2004 by doxygen 1.3.3