PStringSet Class Reference

#include <pstring.h>

List of all members.

Public Member Functions

Construction
 PStringSet (PINDEX count, char const *const *strarr, BOOL caseless=FALSE)
 PStringSet (const PString &str)
Overrides from class PObject
virtual void ReadFrom (istream &strm)
Operations
void Include (const PString &key)
PStringSetoperator+= (const PString &key)
void Exclude (const PString &key)
PStringSetoperator-= (const PString &key)


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,
BOOL  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 list of one.


Member Function Documentation

PINLINE void PStringSet::Exclude ( const PString key  ) 

Exclude the spcified string value from the set.

Parameters:
key String value to remove from set.

References PAbstractSet::Remove().

PINLINE void PStringSet::Include ( const PString key  ) 

Include the spcified string value into the set.

Parameters:
key String value to add to set.

References PAbstractSet::Append(), and PString::Clone().

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

Include the spcified string value into the set.

Parameters:
key String value to add to set.

References PAbstractSet::Append(), and PString::Clone().

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

Exclude the spcified string value from the set.

Parameters:
key String value to remove from set.

References PAbstractSet::Remove().

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

Parameters:
strm Stream to read the objects contents from.


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

Generated on Thu Aug 20 12:07:41 2009 for PWLib by  doxygen 1.5.9