Class StringList.

Inherits List

The StringList class is a List of String object, offering a few convenience functions such as join() and removeDuplicates().

StringList::StringList()

Constructs an empty List of (pointers to) String objects.

Reimplements List::List().

void StringList::append( String * s )

Appends the String s to this StringList. (Inline reimplementation to work around the shadowing rules of C++.)

void StringList::append( const String & s )

This version of append() makes a copy of s and appends that copy to the list.

void StringList::append( const char * s )

This version of append() makes a String copy of s and appends that copy to the list.

bool StringList::contains( const String & s ) const

Returns true if s occurs in this string list, and false if not.

String StringList::join( const String & separator )

Returns a string containing every String in this list, with separator between the items.

If this List isEmpty(), this function returns an empty String.

void StringList::removeDuplicates( bool caseSensitive )

Removes duplicate entries from the list. If caseSensitive is true (this is the default), strings are compared exactly. If caseSensitive is false, ASCII A-Z are treated as equal to a-z.

When two more more strings are equal, removeDuplicates() leaves the first and removes the second and later copies.

static StringList * StringList::split( char c, const String & s )

This function splits s on the separator c, and returns a non-0 pointer to a list of the resulting strings. Consecutive occurrences of c cause the list to contain empty elements.

This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.