PStringToString Class Reference

#include <pstring.h>

Inheritance diagram for PStringToString:
PStringDictionary< K > PAbstractDictionary PHashTable PCollection PContainer PObject PMIMEInfo

List of all members.

Classes

struct  Initialiser
 Structure for static array initialiser for class. More...

Public Member Functions

char ** ToCharArray (bool withEqualSign, PCharArray *storage=NULL) const
Construction

 PStringToString (PINDEX count, const Initialiser *init, PBoolean caselessKeys=PFalse, PBoolean caselessValues=PFalse)
Overrides from class PObject

virtual void ReadFrom (istream &strm)

Detailed Description

This is a dictionary collection class of PString# objects, keyed by another string. 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.

See the PAbstractDictionary# and PStringDictionary# classes and PDECLARE_DICTIONARY# and PDECLARE_STRING_DICTIONARY# macros for more information.


Constructor & Destructor Documentation

PStringToString::PStringToString ( PINDEX  count,
const Initialiser init,
PBoolean  caselessKeys = PFalse,
PBoolean  caselessValues = PFalse 
)

Initialise the string dictionary of strings from the static array.

Parameters:
count Count of strings in initialiser array
init Array of Initialiser structures
caselessKeys New keys are to be PCaselessStrings
caselessValues New values are to be PCaselessStrings

Member Function Documentation

virtual void PStringToString::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().

Reimplemented from PObject.

Reimplemented in PMIMEInfo.

char** PStringToString::ToCharArray ( bool  withEqualSign,
PCharArray storage = NULL 
) const

Create an array of C strings. If withEqualSign is true then array is GetSize()+1 strings of the form key=value. If false then the array is GetSize()*2+1 strings where consecutive pointers are the key and option respecitively of each entry in the dictionary.

If storage is NULL then this returns a single pointer that must be disposed of using free(). Note that each of the strings are part of the same memory allocation so only one free() is required.

If storage is not null then that is used to allocate the memory.


The documentation for this class was generated from the following file:
Generated on Fri May 28 07:32:36 2010 for PTLib by  doxygen 1.6.3