#include <pstring.h>
Public Member Functions | |
Overrides from class PObject | |
virtual void | ReadFrom (istream &strm) |
Operations | |
void | Include (const PString &key) |
PStringSet & | operator+= (const PString &key) |
void | Exclude (const PString &key) |
PStringSet & | operator-= (const PString &key) |
In addition some addition functions are added that take a const PString# reference instead of a pointer as most standard collection functions do. This is more convenient for when string expressions are used as parameters to function in the collection.
Unlike the normal sets, this will delete the PStrings removed from it. This complements the automatic creation of new PString objects when literals or expressions are used.
See the PAbstractSet# and PSet# classes and PDECLARE_SET# macro for more information.
PStringSet::PStringSet | ( | PINDEX | count, | |
char const *const * | strarr, | |||
BOOL | caseless = FALSE | |||
) |
Create a PStringArray from the array of C strings.
count | Count of strings in array |
strarr | Array of C strings |
caseless | New strings are to be PCaselessStrings |
PStringSet::PStringSet | ( | const PString & | str | ) |
Create a PStringSet containing the single string.
str | Single string to convert to a list of one. |
PStringSet::PStringSet | ( | PINDEX | count, | |
char const *const * | strarr, | |||
BOOL | caseless = FALSE | |||
) |
Create a PStringArray from the array of C strings.
count | Count of strings in array |
strarr | Array of C strings |
caseless | New strings are to be PCaselessStrings |
PStringSet::PStringSet | ( | const PString & | str | ) |
Create a PStringSet containing the single string.
str | Single string to convert to a list of one. |
virtual void PStringSet::ReadFrom | ( | istream & | strm | ) | [virtual] |
Input the contents of the object from the stream. This is primarily used by the standard operator>># function.
The default behaviour reads '
' separated strings until !strm.good().
strm | Stream to read the objects contents from. |
PINLINE void PStringSet::Include | ( | const PString & | key | ) |
Include the spcified string value into the set.
key | String value to add to set. |
PINLINE PStringSet & PStringSet::operator+= | ( | const PString & | key | ) |
Include the spcified string value into the set.
key | String value to add to set. |
PINLINE void PStringSet::Exclude | ( | const PString & | key | ) |
Exclude the spcified string value from the set.
key | String value to remove from set. |
PINLINE PStringSet & PStringSet::operator-= | ( | const PString & | key | ) |
Exclude the spcified string value from the set.
key | String value to remove from set. |