Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5105 in orxonox.OLD for trunk/src/lib/lang


Ignore:
Timestamp:
Aug 22, 2005, 7:29:27 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some completion of ObjectNames

Location:
trunk/src/lib/lang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/class_list.cc

    r5103 r5105  
    285285}
    286286
     287const 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
     302long 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
    287319/**
    288320 * Print out some very nice debug information
  • trunk/src/lib/lang/class_list.h

    r5103 r5105  
    4545
    4646    static void                     whatIs(const BaseObject* object);
     47
     48    static const char*              IDToString(ClassID classID = CL_NULL);
     49    static long                     StringToID(const char* className);
    4750    static void                     debug(unsigned int debugLevel = 0, long classID = CL_NULL);
     51
    4852
    4953  private:
Note: See TracChangeset for help on using the changeset viewer.