Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 12, 2006, 8:54:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/std:: compile and run again, with many more std::strings….

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/shell/shell_command_class.cc

    r5780 r7216  
    3636 * @param className the Name of the command-class to create
    3737 */
    38 ShellCommandClass::ShellCommandClass(const char* className)
     38ShellCommandClass::ShellCommandClass(const std::string& className)
     39  : className(className)
    3940{
    4041  this->setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass");
    4142  this->setName(className);
    4243
    43   this->className = className;
    4444  this->classID = CL_NULL;
    4545
     
    6565 * @returns true on success, false otherwise
    6666 */
    67 bool ShellCommandClass::getCommandListOfClass(const char* className, std::list<const char*>* stringList)
    68 {
    69   if (stringList == NULL || className == NULL)
     67bool ShellCommandClass::getCommandListOfClass(const std::string& className, std::list<std::string>* stringList)
     68{
     69  if (stringList == NULL)
    7070    return false;
    7171
     
    7373  for(elem = ShellCommandClass::commandClassList->begin(); elem != ShellCommandClass::commandClassList->end(); elem++)
    7474  {
    75     if (!strcmp ((*elem)->getName(), className))
     75    if (className == (*elem)->getName())
    7676    {
    7777      list<ShellCommand*>::iterator command;
     
    8888 * @returns true on success, false otherwise
    8989 */
    90 bool ShellCommandClass::getCommandListOfAlias(std::list<const char*>* stringList)
     90bool ShellCommandClass::getCommandListOfAlias(std::list<std::string>* stringList)
    9191{
    9292  if (stringList == NULL || ShellCommandClass::aliasList == NULL)
     
    138138  for (classIT = ShellCommandClass::commandClassList->begin(); classIT != ShellCommandClass::commandClassList->end(); classIT++)
    139139  {
    140     if (!strcmp(className, (*classIT)->className))
     140    if (className == (*classIT)->className)
    141141    {
    142142      if ((*classIT)->classID == CL_NULL)
     
    154154 * @returns the CommandClass if found, or a new CommandClass if not
    155155 */
    156 ShellCommandClass* ShellCommandClass::getCommandClass(const char* className)
     156ShellCommandClass* ShellCommandClass::getCommandClass(const std::string& className)
    157157{
    158158  if (ShellCommandClass::commandClassList == NULL)
     
    162162  for (classIT = ShellCommandClass::commandClassList->begin(); classIT != ShellCommandClass::commandClassList->end(); classIT++)
    163163  {
    164     if (!strcmp(className, (*classIT)->className))
     164    if (className == (*classIT)->className)
    165165    {
    166166      return (*classIT);
     
    186186 * @param className: the Class of Commands to show help about
    187187 */
    188 void ShellCommandClass::help(const char* className)
    189 {
    190   if (className == NULL)
    191     return;
     188void ShellCommandClass::help(const std::string& className)
     189{
    192190  if (likely(ShellCommandClass::commandClassList != NULL))
    193191  {
     
    195193    for (classIT = ShellCommandClass::commandClassList->begin(); classIT != ShellCommandClass::commandClassList->end(); classIT++)
    196194    {
    197       if ((*classIT)->className && !strcasecmp(className, (*classIT)->className))
     195      if (className == (*classIT)->className)
    198196      {
    199         PRINT(0)("Class:'%s' registered %d commands: \n", (*classIT)->className, (*classIT)->commandList.size());
     197        PRINT(0)("Class:'%s' registered %d commands: \n", (*classIT)->className.c_str(), (*classIT)->commandList.size());
    200198        list<ShellCommand*>::const_iterator cmdIT;
    201199        for (cmdIT = (*classIT)->commandList.begin(); cmdIT != (*classIT)->commandList.end(); cmdIT++)
     
    212210      }
    213211    }
    214     PRINTF(3)("Class %s not found in Command's classes\n", className);
     212    PRINTF(3)("Class %s not found in Command's classes\n", className.c_str());
    215213  }
    216214  else
Note: See TracChangeset for help on using the changeset viewer.