Class EStringList.

Inherits List

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

EStringList::EStringList()

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

Reimplements List::List().

void EStringList::append( EString * s )

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

void EStringList::append( const EString & s )

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

void EStringList::append( const EStringList & l )

Appends the contents of the EStringList l to this EStringList.

void EStringList::append( const char * s )

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

bool EStringList::contains( const EString & s ) const

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

EString EStringList::join( const EString & separator ) const

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

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

void EStringList::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.

EStringList * EStringList::sorted() const

Returns a new list containing the same items as this, but sorted. The sorting is case sensitive.

static EStringList * EStringList::split( char c, const EString & 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 The Archiveopteryx Developers. All rights reserved.