Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXStringDict Class Reference

String dictionary maps a character string to a character string. More...

#include <FXStringDict.h>

Inheritance diagram for FX::FXStringDict:
FX::FXDict FX::FXObject

List of all members.

Public Member Functions

 FXStringDict ()
 Construct a string dictionary.
const FXchar * insert (const FXchar *ky, const FXchar *str, FXbool mrk=false)
 Insert a new string indexed by key, with given mark flag.
const FXchar * replace (const FXchar *ky, const FXchar *str, FXbool mrk=false)
 Replace or insert a new string indexed by key, unless given mark is lower that the existing mark.
const FXchar * remove (const FXchar *ky)
 Remove entry indexed by key.
const FXchar * find (const FXchar *ky) const
 Return the entry indexed by key, or return NULL if the key does not exist.
const FXchar * data (FXival pos) const
 Return the string at position pos.
virtual ~FXStringDict ()
 Destructor.
- Public Member Functions inherited from FX::FXDict
 FXDict ()
 Construct an empty dictionary.
FXbool size (FXival m)
 Resize the table to the given size.
FXival size () const
 Return the size of the table, including the empty slots.
FXival no () const
 Return the total number of entries in the table.
void * insert (const FXchar *ky, void *ptr=NULL, FXbool mrk=false)
 Insert a new entry into the table given key and mark.
void * replace (const FXchar *ky, void *ptr=NULL, FXbool mrk=false)
 Replace data at key, if the entry's mark is less than or equal to the given mark.
FXbool empty (FXival pos) const
 Return true if slot is empty.
const FXchar * key (FXival pos) const
 Return key at position pos.
FXbool mark (FXival pos) const
 Return mark flag of entry at position pos.
FXival first () const
 Return position of first filled slot, or >= total.
FXival last () const
 Return position of last filled slot or -1.
FXival next (FXival pos) const
 Return position of next filled slot in hash table or a value greater than or equal to total if no filled slot was found.
FXival prev (FXival pos) const
 Return position of previous filled slot in hash table or a -1 if no filled slot was found.
void clear ()
 Clear all entries.
virtual ~FXDict ()
 Destructor.
- Public Member Functions inherited from FX::FXObject
const FXchar * getClassName () const
 Get class name of some object.
FXbool isMemberOf (const FXMetaClass *metaclass) const
 Check if object is member of metaclass.
virtual long tryHandle (FXObject *sender, FXSelector sel, void *ptr)
 Try handle message safely, catching certain exceptions.
virtual long onDefault (FXObject *, FXSelector, void *)
 Called for unhandled messages.
virtual void save (FXStream &store) const
 Save object to stream.
virtual void load (FXStream &store)
 Load object from stream.
virtual ~FXObject ()
 Virtual destructor.

Protected Member Functions

virtual void * createData (void *)
 Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer.
virtual void deleteData (void *)
 Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing.

Additional Inherited Members

- Static Protected Member Functions inherited from FX::FXDict
static FXuint hash (const FXchar *str)
- Protected Attributes inherited from FX::FXDict
FXArray< Entrytable
FXival used
FXival free
- Static Protected Attributes inherited from FX::FXDict
static const Entry init

Detailed Description

String dictionary maps a character string to a character string.

The inserted strings are copied when they're inserted.


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

Copyright © 1997-2013 Jeroen van der Zijp