Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
CharPtrHash.ccGo to the documentation of this file.00001 #include "CharPtrHash.h" 00002 #include <cstring> 00003 00004 bool CharPtrKeyEquals(CharPtrKey* k1, CharPtrKey* k2){ 00005 return (strcmp(k1->key, k2->key) == 0); 00006 } 00007 00008 size_t hashCharPtrKey(CharPtrKey *k){ 00009 size_t hashVal = 0; 00010 int i = 0; 00011 while (k->key[i] != '\0'){ 00012 hashVal += (255 * k->key[i]); 00013 i++; 00014 } 00015 return hashVal; 00016 } 00017 00018 CharPtrKey::CharPtrKey(const char* Key) : key(new char[2048]) { 00019 strcpy(key, Key); 00020 } 00021 00022 CharPtrKey::~CharPtrKey(){ 00023 delete [] key; 00024 } |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:58:36 2016 by Doxygen 1.6.3 |