|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CHashTable { public: CHashTable(); ~CHashTable(); public: void Create(int nSize); void Set(const CString &strKey, int nValue); bool Find(const CString &strKey, int &nValue); void Remove(const CString &strKey); int GetCount(); };
The hash table which accepts strings as keys and integers as values.
Constructor/Destructor Summary | |
CHashTable
();
����������Constructs the hash table. |
|
~CHashTable
();
����������Destroys the hash table. |
Function Summary | |
void
|
Create
(int nSize);
����������Creates the hash table with the specified size. |
void
|
Set
(const CString &strKey, int nValue);
����������Sets the new key/value association. |
bool
|
Find
(const CString &strKey, int &nValue);
����������Looks up the specified key in this hash table. |
void
|
Remove
(const CString &strKey);
����������Removes the specified key from this hash table. |
int
|
GetCount
();
����������Returns a number of keys in this hash table. |
Constructor/Destructor Detail |
CHashTable();
Constructs the hash table.
~CHashTable();
Destroys the hash table.
Function Detail |
void Create(int nSize);
Creates the hash table with the specified size.
nSize
- the size of the hash tablevoid Set(const CString &strKey, int nValue);
Sets the new key/value association.
If the specified key is already present in this hash table, its value is replaced by the specified value; otherwise the specified key/value pair is added to the hash table.
strKey
- the keynValue
- the valuebool Find(const CString &strKey, int &nValue);
Looks up the specified key in this hash table.
strKey
- the key to look upnValue
- on return, the value corresponding
to the specified key; undefined if the key is not foundtrue
if the specified key is
found in this hash table;
false
otherwisevoid Remove(const CString &strKey);
Removes the specified key from this hash table.
The function has no effect is the specified key is not found in this hash table.
strKey
- the key to removeint GetCount();
Returns a number of keys in this hash table.
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |