Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

pstring.h File Reference

#include <string>
#include <vector>

Go to the source code of this file.

Defines

#define PSTRING_DICTIONARY(cls, K)
#define PDECLARE_STRING_DICTIONARY(cls, K)


Define Documentation

#define PDECLARE_STRING_DICTIONARY cls,
 ) 
 

Value:

PSTRING_DICTIONARY(cls##_PTemplate, K); \
  PDECLARE_CLASS(cls, cls##_PTemplate) \
  protected: \
    cls(int dummy, const cls * c) \
      : cls##_PTemplate(dummy, c) { } \
  public: \
    cls() \
      : cls##_PTemplate() { } \
    virtual PObject * Clone() const \
      { return PNEW cls(0, this); } \

#define PSTRING_DICTIONARY cls,
 ) 
 

Value:

class cls : public PAbstractDictionary { \
  PCLASSINFO(cls, PAbstractDictionary) \
  protected: \
    inline cls(int dummy, const cls * c) \
      : PAbstractDictionary(dummy, c) { } \
  public: \
    inline cls() \
      : PAbstractDictionary() { } \
    inline PObject * Clone() const \
      { return PNEW cls(0, this); } \
    inline PString & operator[](const K & key) const \
      { return (PString &)GetRefAt(key); } \
    inline PString operator()(const K & key, const char * dflt = "") const \
      { if (Contains(key)) return (PString &)GetRefAt(key); return dflt; } \
    virtual BOOL Contains(const K & key) const \
      { return AbstractContains(key); } \
    virtual PString * RemoveAt(const K & key) \
      { PString * s = GetAt(key); AbstractSetAt(key, NULL); \
        return reference->deleteObjects ? (s ? (PString *)-1 : NULL) : s; } \
    virtual PString * GetAt(const K & key) const \
      { return (PString *)AbstractGetAt(key); } \
    virtual BOOL SetDataAt(PINDEX index, const PString & str) \
      { return PAbstractDictionary::SetDataAt(index,PNEW PString(str));} \
    virtual BOOL SetAt(const K & key, const PString & str) \
      { return AbstractSetAt(key, PNEW PString(str)); } \
    inline const K & GetKeyAt(PINDEX index) const \
      { return (const K &)AbstractGetKeyAt(index); } \
    inline PString & GetDataAt(PINDEX index) const \
      { return (PString &)AbstractGetDataAt(index); } \
  }


Generated on Mon Feb 21 20:43:10 2005 for PWLib by  doxygen 1.4.1