## wxStringList

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

Derived from

wxList
wxObject

Include files

<wx/list.h>

See also

wxString, wxList

Members

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

### wxStringList::wxStringList

wxStringList()

Constructor.

void wxStringList(char* first, ...)

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

### wxStringList::~wxStringList

~wxStringList()

Deletes string list, deallocating strings.

### wxStringList::Add

wxNode * Add(const wxString& s)

Adds string to list, allocating memory.

### wxStringList::Clear

void Clear()

Clears all strings from the list.

### wxStringList::Delete

void Delete(const wxString& 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(const wxString& s)

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

### wxStringList::Sort

void Sort()

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