#include <Strings.hh>
The Strings class implements an arbitrary size array of strings. It is not very efficient as it internally allocates memory for array storage, but it is convenient for passing arrays of strings to and from functions.
Public Member Functions | |
Strings (int in_count, const char *n=NULL) | |
Strings (char **in_array, int size, const char *n=NULL) | |
Strings (const char *n=NULL) | |
Strings (const Strings &in) | |
~Strings (void) | |
Strings & | operator= (const Strings &rhs) |
char * | get (int index) const |
void | set (int index, char *s) |
int | getCount (void) const |
char ** | getArray (void) const |
void | print (void) |
|
This constructor creates an array of size "in_count", with name "n" |
|
This constructor creates an array of size "size", with name "n" whose contents are copied from the contents of "in_array". Strings in "in_array" are duplicated. |
|
This constructor creates an array of size 0, with name "n" |
|
This is the copy constructor |
|
The destructor frees up all the internal memory allocated at creation or resizing |
|
This method returns a pointer to the string at location "index" in the string array |
|
This method returns a pointer to the internal array of strings. Use with caution, preferably for read-only purposes. |
|
This method returns the number of strings in the array |
|
Assignment operator |
|
Debugging method to print out contents of array |
|
This method sets the string at location "index" to the string in "s". The input string is duplicated and the old string is deleted, so this is an expensive function call. |