Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5331 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Oct 8, 2005, 11:26:53 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: inition is our motto, so now the debug function of the ClassList really looks greate and is easy to use.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/functor_list.h

    r5329 r5331  
    150150  FUNCTOR_LIST(2)(l_STRING, l_FLOAT);
    151151  FUNCTOR_LIST(2)(l_UINT, l_LONG);
     152  FUNCTOR_LIST(2)(l_STRING, l_UINT);
    152153#endif /* FUNCTOR_LIST */
    153 
  • trunk/src/lib/lang/class_list.cc

    r5329 r5331  
    2828using namespace std;
    2929
    30 SHELL_COMMAND_STATIC(debug, ClassList, ClassList::debug);
     30SHELL_COMMAND_STATIC(debug, ClassList, ClassList::debugS)
     31    ->describe("Shows all registered classes, if param1: is a valid ClassName only values of this class are shown. param2: how much output")
     32    ->defaultValues(2, NULL, 1);
    3133
    3234/**
     
    379381  PRINT(0)("=======================CL=\n");
    380382}
     383
     384/**
     385 * Print out some very nice debug information
     386 * @param debugLevel the level of verbosity
     387 * @param className the class that should be displayed.
     388 * @see ClassList::debug
     389 */
     390void ClassList::debugS(const char* className, unsigned int debugLevel)
     391{
     392  ClassList::debug(debugLevel, ClassList::StringToID(className));
     393}
  • trunk/src/lib/lang/class_list.h

    r5194 r5331  
    4949    static long                     StringToID(const char* className);
    5050    static void                     debug(unsigned int debugLevel = 0, long classID = CL_NULL);
     51    static void                     debugS(const char* className = 0x0, unsigned int debugLevel = 0);
    5152
    5253
  • trunk/src/lib/util/helper_functions.cc

    r5329 r5331  
    2222
    2323/**
    24  * checks if the input was a Bool
    25  * @param BOOL a String that holds a bool: must be one of those: 1,0,true,false,TRUE,FALSE
     24 * checks if the input was a bool
     25 * @param BOOL a String that holds a bool: must be one of those: 1,0,true,false(case-insensitive)
    2626 * @param defaultValue a default value that is set, if BOOL is corrupt
    2727 * @return returns the bool, if BOOL was correct otherwise defaultValue
     
    3131  if (BOOL == NULL)
    3232    return defaultValue;
    33   if(!strcmp(BOOL, "1") || !strcmp( BOOL,"true") || !strcmp(BOOL,"TRUE"))
     33  if(!strcmp(BOOL, "1") || !strcasecmp( BOOL, "true") )
    3434    return true;
    35   else if (!strcmp(BOOL, "0") || !strcmp( BOOL,"false") || !strcmp(BOOL,"FALSE"))
     35  else if (!strcmp(BOOL, "0") || !strcasecmp( BOOL, "false"))
    3636    return false;
    3737  else
     
    4040}
    4141
     42
     43/**
     44 * checks if the input was a int
     45 * @param INT a String that holds an int.
     46 * @param defaultValue a default value that is set, if INT is corrupt
     47 * @return returns the contained int, if INT was correct otherwise defaultValue
     48 */
    4249int isInt(const char* INT, int defaultValue)
    4350{
     
    5461}
    5562
     63
     64/**
     65 * checks if the input was a float
     66 * @param FLOAT a String that holds an float.
     67 * @param defaultValue a default value that is set, if FLOAT is corrupt
     68 * @return returns the contained float, if FLOAT was correct otherwise defaultValue
     69 */
    5670float isFloat(const char* FLOAT, float defaultValue)
    5771{
     
    6882
    6983
     84/**
     85 * checks if the input was a string
     86 * @param STING a String(char-array) that holds an string.
     87 * @param defaultValue a default value that is set, if STRING is corrupt
     88 * @return returns the contained string (char-array), if STRING was correct otherwise defaultValue
     89 */
    7090const char* isString(const char* STRING, const char* defaultValue)
    7191{
Note: See TracChangeset for help on using the changeset viewer.