Gadget
charptrvector.h
Go to the documentation of this file.
1 #ifndef charptrvector_h
2 #define charptrvector_h
3 
8 class CharPtrVector {
9 public:
13  CharPtrVector() { size = 0; v = 0; };
18  CharPtrVector(const CharPtrVector& initial);
28  void resizeBlank(int addsize);
33  void resize(char* value);
39  void Delete(int pos);
44  int Size() const { return size; };
50  char*& operator [] (int pos) { return v[pos]; };
56  char* const& operator [] (int pos) const { return v[pos]; };
61  void Reset();
67 protected:
71  char** v;
75  int size;
76 };
77 
78 #endif
This class implements a dynamic vector of char values.
Definition: charptrvector.h:8
char ** v
This is the vector of char values.
Definition: charptrvector.h:71
int size
This is the size of the vector.
Definition: charptrvector.h:75
void Reset()
This will reset the vector.
Definition: charptrvector.cc:72
~CharPtrVector()
This is the CharPtrVector destructor.
Definition: charptrvector.cc:15
CharPtrVector & operator=(const CharPtrVector &cv)
This operator will set the vector equal to an existing CharPtrVector.
Definition: charptrvector.cc:80
void resizeBlank(int addsize)
This will add new blank (ie. NULL) entries to the vector.
Definition: charptrvector.cc:37
void resize(char *value)
This will add one new entry to the vector.
Definition: charptrvector.cc:22
CharPtrVector()
This is the default CharPtrVector constructor.
Definition: charptrvector.h:13
int Size() const
This will return the size of the vector.
Definition: charptrvector.h:44
void Delete(int pos)
This will delete an entry from the vector.
Definition: charptrvector.cc:54
char *& operator[](int pos)
This will return the value of an element of the vector.
Definition: charptrvector.h:50