Drag[en]gine Game Engine  1.0
decStringSet Class Reference

Unordered set of strings. More...

#include <decStringSet.h>

Public Member Functions

Constructors and Destructors
 decStringSet ()
 Creates a new string set. More...
 
 decStringSet (const decStringSet &set)
 Creates a new string set as a copy of another string list. More...
 
 ~decStringSet ()
 Cleans up the string set. More...
 
Management
int GetCount () const
 Retrieves the number of strings. More...
 
const decStringGetAt (int index) const
 Retrieves the string at the given index. More...
 
int IndexOf (const decString &string) const
 Retrieves the index of the 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 part of the set. More...
 
bool Has (const char *string) const
 
void Add (const decString &string)
 Adds a string if not already part of the set. More...
 
void Add (const char *string)
 
void Remove (const decString &string)
 Removes the string if part of the set. More...
 
void Remove (const char *string)
 
void RemoveAll ()
 Removes all strings. More...
 
void SortAscending ()
 Sorts strings in ascending order. More...
 
void SortDescending ()
 Sorts strings in descending order. More...
 
Operators
const decStringoperator[] (int index) const
 Retrieves the string at the given index. More...
 
decStringSetoperator= (const decStringSet &set)
 Set this list to the content of another set. More...
 
bool operator== (const decStringSet &set) const
 Determines if this set is equal to another set. More...
 
bool operator!= (const decStringSet &set) const
 Determines if this set is not equal to another set. More...
 
decStringSet operator+ (const decStringSet &set) const
 Retrieves a new list containing the concatenation of this set and another one. More...
 
decStringSetoperator+= (const decStringSet &set)
 Appends another list to this set. More...
 
decStringSet operator+ (const decString &string) const
 Retrieves a new list containing this set with the given string added to it. More...
 
decStringSet operator+ (const char *string) const
 Retrieves a new list containing this set with the given string added to it. More...
 
decStringSetoperator+= (const decString &string)
 Appends a string to this set. More...
 
decStringSetoperator+= (const char *string)
 Appends a string to this set. More...
 

Detailed Description

Unordered set of strings.

The strings in the set are not allowed to be duplicates of each other and can not be NULL. The set is ordered.

Author
Roland Pl├╝ss
Version
1.0
Date
2014

Constructor & Destructor Documentation

◆ decStringSet() [1/2]

decStringSet::decStringSet ( )

Creates a new string set.

◆ decStringSet() [2/2]

decStringSet::decStringSet ( const decStringSet set)

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

◆ ~decStringSet()

decStringSet::~decStringSet ( )

Cleans up the string set.

Member Function Documentation

◆ Add() [1/2]

void decStringSet::Add ( const decString string)

Adds a string if not already part of the set.

Referenced by GetCount().

◆ Add() [2/2]

void decStringSet::Add ( const char *  string)

◆ GetAt()

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

Retrieves the string at the given index.

Referenced by GetCount().

◆ GetCount()

int decStringSet::GetCount ( ) const
inline

◆ Has() [1/2]

bool decStringSet::Has ( const decString string) const

Determines if the given string is part of the set.

Referenced by GetCount().

◆ Has() [2/2]

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

◆ IndexOf() [1/2]

int decStringSet::IndexOf ( const decString string) const

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

Referenced by GetCount().

◆ IndexOf() [2/2]

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

◆ operator!=()

bool decStringSet::operator!= ( const decStringSet set) const

Determines if this set is not equal to another set.

Referenced by GetCount().

◆ operator+() [1/3]

decStringSet decStringSet::operator+ ( const decStringSet set) const

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

Referenced by GetCount().

◆ operator+() [2/3]

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

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

◆ operator+() [3/3]

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

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

◆ operator+=() [1/3]

decStringSet& decStringSet::operator+= ( const decStringSet set)

Appends another list to this set.

Referenced by GetCount().

◆ operator+=() [2/3]

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

Appends a string to this set.

◆ operator+=() [3/3]

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

Appends a string to this set.

◆ operator=()

decStringSet& decStringSet::operator= ( const decStringSet set)

Set this list to the content of another set.

Referenced by GetCount().

◆ operator==()

bool decStringSet::operator== ( const decStringSet set) const

Determines if this set is equal to another set.

Referenced by GetCount().

◆ operator[]()

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

Retrieves the string at the given index.

Referenced by GetCount().

◆ Remove() [1/2]

void decStringSet::Remove ( const decString string)

Removes the string if part of the set.

Referenced by GetCount().

◆ Remove() [2/2]

void decStringSet::Remove ( const char *  string)

◆ RemoveAll()

void decStringSet::RemoveAll ( )

Removes all strings.

Referenced by GetCount().

◆ SortAscending()

void decStringSet::SortAscending ( )

Sorts strings in ascending order.

Referenced by GetCount().

◆ SortDescending()

void decStringSet::SortDescending ( )

Sorts strings in descending order.

Referenced by GetCount().


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