Class UStringList.

Inherits List

The UStringList class is a List of UString object, offering a few convenience functions such as join() and split().

UStringList::UStringList()

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

Reimplements List::List().

void UStringList::append( UString * s )

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

void UStringList::append( const UString & s )

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

bool UStringList::contains( const UString & s ) const

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

UString UStringList::join( const UString & separator )

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

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

UString UStringList::join( const char * separator )

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

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

void UStringList::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 UStringList * UStringList::split( char c, const UString & 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.