The TextTable class has an iterator called TextTableIter, where the next method and ++ operator return a pointer to class TextEntry. This class inherits the const char* key() method from the HashEntry class which returns the key for the entry. But it implements its own value() method that returns a const char*.
Method |
Parameter |
Description |
---|---|---|
void clear () |
|
empty the table |
void cleanup (...) |
|
deallocate the string pointed to by p |
|
Pointer p |
|
int hasKey (...) |
|
create an entry containing a copy of string; a previous entry with the same key is replaced and the cleanup method is called to deallocate its memory |
|
const char* key |
|
|
const char* string |
|
const char* lookup (...) |
|
loop up an entry with the given key; return 0 if there is no such entry |
|
const char* key |
|
int remove (...) |
|
remove the entry with the given key from the table and deallocate its memory |
|
const char* key |
|
int size () |
|
return the number of entries in the hash table |