Drag[en]gine Game Engine  1.21
decStringList Class Reference

Ordered list of strings. More...

#include <decStringList.h>

Public Member Functions

Constructors and Destructors
 decStringList ()
 Create new string list. More...
 
 decStringList (const decStringList &list)
 Create new string list as a copy of another string list. More...
 
 ~decStringList ()
 Clean up string list. More...
 
Management
int GetCount () const
 Number of strings. More...
 
const decStringGetAt (int index) const
 String at the given index. More...
 
void SetAt (int index, const decString &string)
 Set string at the given index. More...
 
void SetAt (int index, const char *string)
 
int IndexOf (const decString &string) const
 Index of the first occurance of a string or -1 if not found. More...
 
int IndexOf (const char *string) const
 
bool Has (const decString &string) const
 Given string is found one or more times in the list. More...
 
bool Has (const char *string) const
 
void Add (const decString &string)
 Adds a string. More...
 
void Add (const char *string)
 
void InsertAt (const decString &string, int index)
 Inserts a string. More...
 
void InsertAt (const char *string, int index)
 
void Move (int from, int to)
 Moves a string to a new position. More...
 
void RemoveFrom (int index)
 Removes the string from with the given index. More...
 
void RemoveAll ()
 Removes all strings. More...
 
void SortAscending ()
 Sorts strings in ascending order. More...
 
void SortDescending ()
 Sorts strings in descending order. More...
 
decStringList Splice (int first) const
 Get sub range of string list. More...
 
decStringList Splice (int first, int last) const
 Get sub range of string list. More...
 
decString Join (const decString &separator) const
 Entries joined to a single string. More...
 
decString Join (const char *separator) const
 Entries joined to a single string. More...
 

Operators

const decStringoperator[] (int index) const
 String at the given index. More...
 
decStringListoperator= (const decStringList &list)
 Set this list to the content of another list. More...
 
bool operator== (const decStringList &list) const
 Determines if this list is equal to another list. More...
 
bool operator!= (const decStringList &list) const
 Determines if this list is not equal to another list. More...
 
decStringList operator+ (const decStringList &list) const
 Retrieves a new list containing the concatenation of this list and another one. More...
 
decStringListoperator+= (const decStringList &list)
 Appends another list to this list. More...
 
decStringList operator+ (const decString &string) const
 Retrieves a new list containing this list with the given string added to it. More...
 
decStringList operator+ (const char *string) const
 Retrieves a new list containing this list with the given string added to it. More...
 
decStringListoperator+= (const decString &string)
 Appends a string to this list. More...
 
decStringListoperator+= (const char *string)
 Appends a string to this list. More...
 

Detailed Description

Ordered list of strings.

The strings in the list are allowed the be duplicates of each other but can not be NULL.

Constructor & Destructor Documentation

◆ decStringList() [1/2]

decStringList::decStringList ( )

Create new string list.

◆ decStringList() [2/2]

decStringList::decStringList ( const decStringList list)

Create new string list as a copy of another string list.

◆ ~decStringList()

decStringList::~decStringList ( )

Clean up string list.

Member Function Documentation

◆ Add() [1/2]

void decStringList::Add ( const char *  string)

◆ Add() [2/2]

void decStringList::Add ( const decString string)

Adds a string.

◆ GetAt()

const decString& decStringList::GetAt ( int  index) const

String at the given index.

◆ GetCount()

int decStringList::GetCount ( ) const
inline

Number of strings.

◆ Has() [1/2]

bool decStringList::Has ( const char *  string) const

◆ Has() [2/2]

bool decStringList::Has ( const decString string) const

Given string is found one or more times in the list.

◆ IndexOf() [1/2]

int decStringList::IndexOf ( const char *  string) const

◆ IndexOf() [2/2]

int decStringList::IndexOf ( const decString string) const

Index of the first occurance of a string or -1 if not found.

◆ InsertAt() [1/2]

void decStringList::InsertAt ( const char *  string,
int  index 
)

◆ InsertAt() [2/2]

void decStringList::InsertAt ( const decString string,
int  index 
)

Inserts a string.

◆ Join() [1/2]

decString decStringList::Join ( const char *  separator) const

Entries joined to a single string.

Exceptions
deeInvalidParamseparator is NULL.

◆ Join() [2/2]

decString decStringList::Join ( const decString separator) const

Entries joined to a single string.

◆ Move()

void decStringList::Move ( int  from,
int  to 
)

Moves a string to a new position.

◆ operator!=()

bool decStringList::operator!= ( const decStringList list) const

Determines if this list is not equal to another list.

◆ operator+() [1/3]

decStringList decStringList::operator+ ( const char *  string) const

Retrieves a new list containing this list with the given string added to it.

◆ operator+() [2/3]

decStringList decStringList::operator+ ( const decString string) const

Retrieves a new list containing this list with the given string added to it.

◆ operator+() [3/3]

decStringList decStringList::operator+ ( const decStringList list) const

Retrieves a new list containing the concatenation of this list and another one.

◆ operator+=() [1/3]

decStringList& decStringList::operator+= ( const char *  string)

Appends a string to this list.

◆ operator+=() [2/3]

decStringList& decStringList::operator+= ( const decString string)

Appends a string to this list.

◆ operator+=() [3/3]

decStringList& decStringList::operator+= ( const decStringList list)

Appends another list to this list.

◆ operator=()

decStringList& decStringList::operator= ( const decStringList list)

Set this list to the content of another list.

◆ operator==()

bool decStringList::operator== ( const decStringList list) const

Determines if this list is equal to another list.

◆ operator[]()

const decString& decStringList::operator[] ( int  index) const

String at the given index.

◆ RemoveAll()

void decStringList::RemoveAll ( )

Removes all strings.

◆ RemoveFrom()

void decStringList::RemoveFrom ( int  index)

Removes the string from with the given index.

◆ SetAt() [1/2]

void decStringList::SetAt ( int  index,
const char *  string 
)

◆ SetAt() [2/2]

void decStringList::SetAt ( int  index,
const decString string 
)

Set string at the given index.

◆ SortAscending()

void decStringList::SortAscending ( )

Sorts strings in ascending order.

◆ SortDescending()

void decStringList::SortDescending ( )

Sorts strings in descending order.

◆ Splice() [1/2]

decStringList decStringList::Splice ( int  first) const

Get sub range of string list.

◆ Splice() [2/2]

decStringList decStringList::Splice ( int  first,
int  last 
) const

Get sub range of string list.


The documentation for this class was generated from the following file: