Drag[en]gine Game Engine  1.0
decStringList Class Reference

Ordered list of strings. More...

#include <decStringList.h>

Public Member Functions

Constructors and Destructors
 decStringList ()
 Creates a new string list. More...
 
 decStringList (const decStringList &list)
 Creates a new string list as a copy of another string list. More...
 
 ~decStringList ()
 Cleans up the string list. More...
 
Management
int GetCount () const
 Retrieves the number of strings. More...
 
const decStringGetAt (int index) const
 Retrieves the string at the given index. More...
 
void SetAt (int index, const decString &string)
 Sets the string at the given index. More...
 
void SetAt (int index, const char *string)
 
int IndexOf (const decString &string) const
 Retrieves the 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
 Determines if the 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
 Retrieves the 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.

Author
Roland Pl├╝ss
Version
1.0
Date
2014

Constructor & Destructor Documentation

◆ decStringList() [1/2]

decStringList::decStringList ( )

Creates a new string list.

◆ decStringList() [2/2]

decStringList::decStringList ( const decStringList list)

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

◆ ~decStringList()

decStringList::~decStringList ( )

Cleans up the string list.

Member Function Documentation

◆ Add() [1/2]

void decStringList::Add ( const decString string)

Adds a string.

Referenced by GetCount().

◆ Add() [2/2]

void decStringList::Add ( const char *  string)

◆ GetAt()

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

Retrieves the string at the given index.

Referenced by GetCount().

◆ GetCount()

int decStringList::GetCount ( ) const
inline

◆ Has() [1/2]

bool decStringList::Has ( const decString string) const

Determines if the given string is found one or more times in the list.

Referenced by GetCount().

◆ Has() [2/2]

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

◆ IndexOf() [1/2]

int decStringList::IndexOf ( const decString string) const

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

Referenced by GetCount().

◆ IndexOf() [2/2]

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

◆ InsertAt() [1/2]

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

Inserts a string.

Referenced by GetCount().

◆ InsertAt() [2/2]

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

◆ Join() [1/2]

decString decStringList::Join ( const decString separator) const

Entries joined to a single string.

Referenced by GetCount().

◆ Join() [2/2]

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

Entries joined to a single string.

Exceptions
deeInvalidParamseparator is NULL.

◆ Move()

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

Moves a string to a new position.

Referenced by GetCount().

◆ operator!=()

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

Determines if this list is not equal to another list.

Referenced by GetCount().

◆ operator+() [1/3]

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

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

Referenced by GetCount().

◆ 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 char *  string) const

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

◆ operator+=() [1/3]

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

Appends another list to this list.

Referenced by GetCount().

◆ operator+=() [2/3]

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

Appends a string to this list.

◆ operator+=() [3/3]

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

Appends a string to this list.

◆ operator=()

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

Set this list to the content of another list.

Referenced by GetCount().

◆ operator==()

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

Determines if this list is equal to another list.

Referenced by GetCount().

◆ operator[]()

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

Retrieves the string at the given index.

Referenced by GetCount().

◆ RemoveAll()

void decStringList::RemoveAll ( )

Removes all strings.

Referenced by GetCount().

◆ RemoveFrom()

void decStringList::RemoveFrom ( int  index)

Removes the string from with the given index.

Referenced by GetCount().

◆ SetAt() [1/2]

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

Sets the string at the given index.

Referenced by GetCount().

◆ SetAt() [2/2]

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

◆ SortAscending()

void decStringList::SortAscending ( )

Sorts strings in ascending order.

Referenced by GetCount().

◆ SortDescending()

void decStringList::SortDescending ( )

Sorts strings in descending order.

Referenced by GetCount().

◆ Splice() [1/2]

decStringList decStringList::Splice ( int  first) const

Get sub range of string list.

Referenced by GetCount().

◆ 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: