KCharPtrSet Class Reference

#include <kcharptrset.h>

List of all members.


Detailed Description

This class contains the data structure support for char pointer set.

Definition at line 52 of file kcharptrset.h.

Public Member Functions

 KCharPtrSet (int pItemPerBlock=20)
 Class constructor.
 ~KCharPtrSet ()
 Class destructor.
void Add (char *pReference, kReference pItem)
 Add a new item.
bool Remove (char *pReference)
 Removes an item.
kReference Get (char *pReference, int *PIndex=NULL)
 Get an item's reference.
kReferenceoperator[] (int pIndex)
 Get an item's reference from index.
kReference GetFromIndex (int pIndex, char **pReference=NULL)
 Get an item's reference from index.
void RemoveFromIndex (int pIndex)
 Removes an item by index.
int GetCount ()
 Get the number of item in the array.
void Sort ()
 Sorts the array.
void Clear ()
 Clears the array.


Constructor & Destructor Documentation

KCharPtrSet ( int  pItemPerBlock = 20  ) 

Class constructor.

Parameters:
pItemPerBlock Number of item per block. Default is 20.

~KCharPtrSet (  ) 

Class destructor.


Member Function Documentation

void Add ( char *  pReference,
kReference  pItem 
)

Add a new item.

Parameters:
pReference char pointer reference to the item.
kReference to the item.

bool Remove ( char *  pReference  ) 

Removes an item.

Parameters:
pReference char reference to the item.
Returns:
true if succes.

kReference Get ( char *  pReference,
int *  PIndex = NULL 
)

Get an item's reference.

Parameters:
pReference char reference to the item.
PIndex index to the item.
Returns:
kReference to the item, NULL if fails.

kReference& operator[] ( int  pIndex  ) 

Get an item's reference from index.

Parameters:
PIndex index to the item.
Returns:
kReference to the item, NULL if fails.

kReference GetFromIndex ( int  pIndex,
char **  pReference = NULL 
)

Get an item's reference from index.

Parameters:
PIndex index to the item.
Returns:
kReference to the item, NULL if fails.

void RemoveFromIndex ( int  pIndex  ) 

Removes an item by index.

Parameters:
pReference char reference to the item.
Returns:
true if succes.

int GetCount (  )  [inline]

Get the number of item in the array.

Definition at line 103 of file kcharptrset.h.

void Sort (  ) 

Sorts the array.

void Clear (  ) 

Clears the array.