Class StringSet

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class StringSet

Summary
Public Methods
StringSet()
inline StringSet& operator+=(a)
inline const StringSet operator-(a) const
inline StringSet& operator-=(a)
const bool operator==(b)
Private Methods
static bool gt(a, b)

#include <StringSet.h >

Super class: string

Summary

A class to manage an set of strings. This is not a list; a string may not appear on the list multiple times, only once.

Note: by default, a string must not contain a comma to leverage this class's full functionality. A different separator character can be used if commas are needed in the strings.

Public Methods

StringSet()

Constructor. Create an empty set of strings.

inline StringSet& operator+=(a)

const StringSet& a

other string list to add


Add/Append a set of strings to this set of strings. Duplicates are ignored.

Return value: combined string list

inline const StringSet operator-(a) const

const StringSet& a

other string list to remove


Remove a set of strings from this set of strings. All strings found in a will be removed from this set of strings, if present.

Return value: combined string list

inline StringSet& operator-=(a)

const StringSet& a

other string list to remove


Remove a set of strings from this set of strings. All strings found in a will be removed from this set of strings, if present.

Return value: combined string list

const bool operator==(b)

const StringSet& b

other string list


Compare two string lists to determine if they are the same.

The order of the strings in the set does not matter.

Return value: true if the lists are the same; false if they are not

Private Methods

static bool gt(a, b)

const string& a

left string to compare

const string& b

right string to compare


Compare two strings to determine if a > b.

Return value: true if a is lexicographically later/bigger than b