Contents Up Previous Next

wxStringList: wxList

A string list is a list which is assumed to contain strings, with a specific member functions. Memory is allocated when strings are added to the list, and deallocated by the destructor or by the Delete member.

wxStringList::wxStringList
wxStringList::~wxStringList
wxStringList::Add
wxStringList::Delete
wxStringList::ListToArray
wxStringList::Member
wxStringList::Sort


wxStringList::wxStringList

void wxStringList(void)

Constructor.

void wxStringList(char *first, ...)

Constructor, taking NULL-terminated string argument list. wxStringList allocates memory for the strings.


wxStringList::~wxStringList

void ~wxStringList(void)

Deletes string list, deallocating strings.


wxStringList::Add

wxNode * Add(char *s)

Adds string to list, allocating memory.


wxStringList::Delete

void Delete(char *s)

Searches for string and deletes from list, deallocating memory.


wxStringList::ListToArray

char ** ListToArray(Bool new_copies = FALSE)

Converts the list to an array of strings, only allocating new memory if new_copies is TRUE.


wxStringList::Member

Bool Member(char *s)

Returns TRUE if s is a member of the list (tested using strcmp).


wxStringList::Sort

void Sort(void)

Sorts the strings in ascending alphabetical order. Note that all nodes (but not strings) get deallocated and new ones allocated.