Changeset 7225 in orxonox.OLD for trunk/src/lib/shell/shell_command.cc
- Timestamp:
- Mar 18, 2006, 12:04:39 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7221 r7225 36 36 * @param paramCount the count of parameters this command takes 37 37 */ 38 ShellCommand::ShellCommand(const char* commandName, const char*className, const Executor& executor)38 ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, const Executor& executor) 39 39 { 40 40 this->setClassID(CL_SHELL_COMMAND, "ShellCommand"); … … 66 66 * registers a new ShellCommand 67 67 */ 68 ShellCommand* ShellCommand::registerCommand(const char* commandName, const char*className, const Executor& executor)68 ShellCommand* ShellCommand::registerCommand(const std::string& commandName, const std::string& className, const Executor& executor) 69 69 { 70 70 if (ShellCommand::isRegistered(commandName, className)) … … 80 80 * @param commandName the name of the command itself 81 81 */ 82 void ShellCommand::unregisterCommand(const char* commandName, const char*className)82 void ShellCommand::unregisterCommand(const std::string& commandName, const std::string& className) 83 83 { 84 84 /// FIXME … … 118 118 * This is checked in the registerCommand-function. 119 119 */ 120 bool ShellCommand::isRegistered(const char* commandName, const char*className)120 bool ShellCommand::isRegistered(const std::string& commandName, const std::string& className) 121 121 { 122 122 if (ShellCommandClass::commandClassList == NULL) … … 132 132 for (elem = checkClass->commandList.begin(); elem != checkClass->commandList.end(); elem++) 133 133 { 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()); 137 137 return true; 138 138 } … … 272 272 * @returns itself 273 273 */ 274 ShellCommand* ShellCommand::setAlias(const char*alias)274 ShellCommand* ShellCommand::setAlias(const std::string& alias) 275 275 { 276 276 if (this == NULL) … … 352 352 { 353 353 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.