kmail

kmdict.h

Go to the documentation of this file.
00001 /*
00002  * simple hash table for kmail.  inspired by QDict
00003  */
00004 
00005 #ifndef __KMDICT
00006 #define __KMDICT
00007 
00011 class KMDictItem
00012 {
00013 public:
00014   long key;
00015   KMDictItem *next;
00016 };
00017 
00026 class KMDict
00027 {
00028   friend class MessageDictTester;
00029 public:
00031   KMDict(int size = 17);
00032   
00034   ~KMDict();
00035 
00037   void clear();
00038   
00040   int size() { return mSize; }
00041   
00043   void replace(long key, KMDictItem *item);
00044  
00046   void insert(long key, KMDictItem *item);
00047  
00049   void remove(long key);
00050   
00052   KMDictItem *find(long key);
00053   
00054 private:
00056   void removeFollowing(KMDictItem *item, long key);
00057 
00059   void init(int size);
00060 
00062   int mSize;
00063   
00065   KMDictItem **mVecs;
00066 };
00067 
00068 #endif /* __KMDICT */