PString
objects.
More...
#include <pstring.h>
Inheritance diagram for PStringSet:
Public Member Functions | |
Construction | |
PStringSet (PINDEX count, char const *const *strarr, PBoolean caseless=false) | |
Create a PStringArray from the array of C strings. | |
PStringSet (const PString &str) | |
Create a PStringSet containing the single string. | |
Overrides from class PObject | |
virtual void | ReadFrom (istream &strm) |
Input the contents of the object from the stream. | |
Operations | |
void | Include (const PString &key) |
Include the spcified string value into the set. | |
PStringSet & | operator+= (const PString &key) |
Include the spcified string value into the set. | |
void | Exclude (const PString &key) |
Exclude the spcified string value from the set. | |
PStringSet & | operator-= (const PString &key) |
Exclude the spcified string value from the set. |
PString
objects.
It has all the usual functions for a collection, with the object types set to PString
pointers.
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, | |||
PBoolean | 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. |
void PStringSet::Exclude | ( | const PString & | key | ) |
Exclude the spcified string value from the set.
key | String value to remove from set. |
void PStringSet::Include | ( | const PString & | key | ) |
Include the spcified string value into the set.
key | String value to add to set. |
PStringSet& PStringSet::operator+= | ( | const PString & | key | ) |
Include the spcified string value into the set.
key | String value to add to set. |
PStringSet& PStringSet::operator-= | ( | const PString & | key | ) |
Exclude the spcified string value from the set.
key | String value to remove from set. |
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 '\n' separated strings until !strm.good()
.
strm | Stream to read the objects contents from. |
Reimplemented from PObject.