Public Types | |
typedef CamResourceFixNameEntry * | pCamResourceFixNameEntry |
Public Member Functions | |
CamResourceFixNameEntry () | |
Static Public Member Functions | |
static UINT32 | MakeHash (const TCHAR *k) |
static const TCHAR * | Find (const TCHAR *from, const TCHAR *to=NULL) |
static void | MakeResources () |
Public Attributes | |
const TCHAR * | MapFrom |
const TCHAR * | MapTo |
CamResourceFixNameEntry * | pNext |
Static Public Attributes | |
static pCamResourceFixNameEntry * | pArray = NULL |
Definition at line 249 of file camresource.cpp.
|
Definition at line 268 of file camresource.cpp. |
|
Definition at line 325 of file camresource.cpp.
|
|
Definition at line 270 of file camresource.cpp. 00271 { 00272 // Ensure we have an array 00273 if (!pArray) 00274 { 00275 pArray=new pCamResourceFixNameEntry[CRFNH_BUCKETS]; 00276 UINT32 i; 00277 for (i=0; i<CRFNH_BUCKETS; i++) pArray[i]=NULL; 00278 } 00279 if (!pArray) return from; 00280 UINT32 h = MakeHash(from); 00281 pCamResourceFixNameEntry * pPoint = &(pArray[h]); 00282 while (*pPoint) // while we have a valid pointer to a "next" item 00283 { 00284 if (!camStrcmp( (*pPoint)->MapFrom, from ) ) return ( (*pPoint)->MapTo ); 00285 pPoint = &((*pPoint)->pNext); 00286 } 00287 00288 // no match - if they have not asked us to insert, return it unaltered 00289 if (!to) return from; 00290 // We now knonw pPoint is a pointer to a NULL CamResourceFixedNameEntry *, where we will insert ourselves 00291 *pPoint = new(CamResourceFixNameEntry); 00292 if (*pPoint) 00293 { 00294 // No need to strdup these as we know this map is only created with constants, because 00295 // the map is created in init phase 00296 (*pPoint)->MapFrom = from; 00297 (*pPoint)->MapTo = to; 00298 } 00299 return to; 00300 }
|
|
Definition at line 252 of file camresource.cpp. 00253 { 00254 UINT32 hash = 0; 00255 00256 while( *k ) 00257 { 00258 hash += *k++; 00259 hash += (hash << 10); 00260 hash ^= (hash >> 6); 00261 } 00262 hash += (hash << 3); 00263 hash ^= (hash >> 11); 00264 00265 return (hash + (hash << 15)) % CRFNH_BUCKETS; 00266 }
|
|
Definition at line 302 of file camresource.cpp. 00303 { 00304 if (pArray) 00305 { 00306 INT32 i; 00307 for (i=0; i<CRFNH_BUCKETS; i++) 00308 { 00309 pCamResourceFixNameEntry p=pArray[i]; 00310 while (p) 00311 { 00312 CamResource::GetResourceID(p->MapFrom); 00313 p = p->pNext; 00314 } 00315 } 00316 } 00317 }
|
|
Definition at line 319 of file camresource.cpp. |
|
Definition at line 320 of file camresource.cpp. |
|
Definition at line 323 of file camresource.cpp. |
|
Definition at line 321 of file camresource.cpp. |