Changeset 5105 in orxonox.OLD for trunk/src/lib/lang
- Timestamp:
- Aug 22, 2005, 7:29:27 PM (19 years ago)
- Location:
- trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/class_list.cc
r5103 r5105 285 285 } 286 286 287 const char* ClassList::IDToString(ClassID classID) 288 { 289 if(likely(ClassList::first != NULL)) 290 { 291 ClassList* tmpCL = ClassList::first; 292 while (likely(tmpCL != NULL)) 293 { 294 if (tmpCL->classID == classID) 295 return tmpCL->className; 296 tmpCL = tmpCL->next; 297 } 298 } 299 return NULL; 300 } 301 302 long ClassList::StringToID(const char* className) 303 { 304 if(likely(ClassList::first != NULL)) 305 { 306 ClassList* tmpCL = ClassList::first; 307 while (likely(tmpCL != NULL)) 308 { 309 if (!strcasecmp(tmpCL->className, className)) 310 return tmpCL->classID; 311 tmpCL = tmpCL->next; 312 } 313 } 314 return CL_NULL; 315 } 316 317 318 287 319 /** 288 320 * Print out some very nice debug information -
trunk/src/lib/lang/class_list.h
r5103 r5105 45 45 46 46 static void whatIs(const BaseObject* object); 47 48 static const char* IDToString(ClassID classID = CL_NULL); 49 static long StringToID(const char* className); 47 50 static void debug(unsigned int debugLevel = 0, long classID = CL_NULL); 51 48 52 49 53 private:
Note: See TracChangeset
for help on using the changeset viewer.