Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7225 in orxonox.OLD for trunk/src/lib/shell/shell_command.cc


Ignore:
Timestamp:
Mar 18, 2006, 12:04:39 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: more std::string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r7221 r7225  
    3636 * @param paramCount the count of parameters this command takes
    3737 */
    38 ShellCommand::ShellCommand(const char* commandName, const char* className, const Executor& executor)
     38ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, const Executor& executor)
    3939{
    4040  this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
     
    6666 * registers a new ShellCommand
    6767 */
    68 ShellCommand* ShellCommand::registerCommand(const char* commandName, const char* className, const Executor& executor)
     68ShellCommand* ShellCommand::registerCommand(const std::string& commandName, const std::string& className, const Executor& executor)
    6969{
    7070  if (ShellCommand::isRegistered(commandName, className))
     
    8080 * @param commandName the name of the command itself
    8181 */
    82 void ShellCommand::unregisterCommand(const char* commandName, const char* className)
     82void ShellCommand::unregisterCommand(const std::string& commandName, const std::string& className)
    8383{
    8484  /// FIXME
     
    118118 * This is checked in the registerCommand-function.
    119119 */
    120 bool ShellCommand::isRegistered(const char* commandName, const char* className)
     120bool ShellCommand::isRegistered(const std::string& commandName, const std::string& className)
    121121{
    122122  if (ShellCommandClass::commandClassList == NULL)
     
    132132    for (elem = checkClass->commandList.begin(); elem != checkClass->commandList.end(); elem++)
    133133    {
    134       if (!strcmp(commandName, (*elem)->getName()))
    135       {
    136         PRINTF(2)("Command '%s::%s' already registered\n", className, commandName);
     134      if (commandName == (*elem)->getName())
     135      {
     136        PRINTF(2)("Command '%s::%s' already registered\n", className.c_str(), commandName.c_str());
    137137        return true;
    138138      }
     
    272272 * @returns itself
    273273 */
    274 ShellCommand* ShellCommand::setAlias(const char* alias)
     274ShellCommand* ShellCommand::setAlias(const std::string& alias)
    275275{
    276276  if (this == NULL)
     
    352352{
    353353  return MultiType::MultiTypeToString((MT_Type)parameter);
    354 // FIXME
    355   /*  switch (parameter)
    356   {
    357     case ParameterBool:
    358       return "BOOL";
    359       break;
    360     case ParameterChar:
    361       return "CHAR";
    362       break;
    363     case ParameterString:
    364       return "STRING";
    365       break;
    366     case ParameterInt:
    367       return "INT";
    368       break;
    369     case ParameterUInt:
    370       return "UINT";
    371       break;
    372     case ParameterFloat:
    373       return "FLOAT";
    374       break;
    375     case ParameterLong:
    376       return "LONG";
    377       break;
    378     default:
    379       return "NULL";
    380       break;
    381   }*/
    382 }
     354}
Note: See TracChangeset for help on using the changeset viewer.