wxHashTable::~wxHashTable (void)
{
+ Destroy();
+}
+
+void wxHashTable::Destroy(void)
+{
+ if (!hash_table) return;
int i;
for (i = 0; i < n; i++)
if (hash_table[i])
delete hash_table[i];
delete[] hash_table;
+ hash_table = NULL;
}
bool wxHashTable::Create(int the_key_type, int size)
hash_table[position]->Append (value, object);
}
-void wxHashTable::Put (long key, const char *value, wxObject * object)
+void wxHashTable::Put (long key, const wxChar *value, wxObject * object)
{
// Should NEVER be
long k = (long) key;
hash_table[position]->Append (k, object);
}
-void wxHashTable::Put (const char *key, wxObject * object)
+void wxHashTable::Put (const wxChar *key, wxObject * object)
{
int position = (int) (MakeKey (key) % n);
}
}
-wxObject *wxHashTable::Get (long key, const char *value) const
+wxObject *wxHashTable::Get (long key, const wxChar *value) const
{
// Should NEVER be
long k = (long) key;
}
}
-wxObject *wxHashTable::Get (const char *key) const
+wxObject *wxHashTable::Get (const wxChar *key) const
{
int position = (int) (MakeKey (key) % n);
}
}
-wxObject *wxHashTable::Delete (const char *key)
+wxObject *wxHashTable::Delete (const wxChar *key)
{
int position = (int) (MakeKey (key) % n);
if (!hash_table[position])
}
}
-wxObject *wxHashTable::Delete (long key, const char *value)
+wxObject *wxHashTable::Delete (long key, const wxChar *value)
{
int position = (int) (key % n);
if (!hash_table[position])
}
}
-long wxHashTable::MakeKey (const char *string) const
+long wxHashTable::MakeKey (const wxChar *string) const
{
long int_key = 0;
while (*string)
- int_key += (unsigned char) *string++;
+ int_key += (wxUChar) *string++;
return int_key;
}