# PStringSet Class Reference

This is a set collection class of `PString` objects. More...

`#include <pstring.h>`

Inheritance diagram for PStringSet:

List of all members.

## 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.
| PStringSet (const PStringArray &strArray)
| Create a PStringSet containing the strings.
| PStringSet (const PStringList &strList)
| Create a PStringSet containing the strings.
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.

## Detailed Description

This is a set collection class of `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.

## Constructor & Destructor Documentation

PStringSet::PStringSet | ( | PINDEX | count,
|  | char const *const * | strarr,
|  | PBoolean | caseless = `false` |
| ) |  |  |

Create a PStringArray from the array of C strings.

Parameters:

  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.

Parameters:

  str | Single string to convert to a set of one.

PStringSet::PStringSet | ( | const PStringArray & | strArray | ) |

Create a PStringSet containing the strings.

Parameters:

  strArray | String to convert to a set.

PStringSet::PStringSet | ( | const PStringList & | strList | ) |

Create a PStringSet containing the strings.

Parameters:

  strList | String to convert to a set.

## Member Function Documentation

void PStringSet::Exclude | ( | const PString & | key | ) |

Exclude the spcified string value from the set.

Parameters:

  key | String value to remove from set.

void PStringSet::Include | ( | const PString & | key | ) |

Include the spcified string value into the set.

Parameters:

  key | String value to add to set.

PStringSet& PStringSet::operator+= | ( | const PString & | key | ) |

Include the spcified string value into the set.

Parameters:

  key | String value to add to set.

PStringSet& PStringSet::operator-= | ( | const PString & | key | ) |

Exclude the spcified string value from the set.

Parameters:

  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()`.

Parameters:

  strm | Stream to read the objects contents from.

Reimplemented from PObject.

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

- pstring.h