Changeset 5642 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- Nov 19, 2005, 12:16:12 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r5641 r5642 42 42 this->description = NULL; 43 43 this->alias = NULL; 44 this->executor = executor.clone(); 44 45 45 46 // this->classID = classID; … … 47 48 if (this->shellClass != NULL) 48 49 this->shellClass->commandList->add(this); 49 // handling parameters, and storing them:50 if (paramCount > FUNCTOR_MAX_ARGUMENTS)51 paramCount = FUNCTOR_MAX_ARGUMENTS;52 this->paramCount = paramCount;53 this->parameters = new unsigned int[paramCount];54 this->defaultValue = new MultiType[paramCount];55 56 this->executor = executor.clone();57 50 } 58 51 … … 62 55 ShellCommand::~ShellCommand() 63 56 { 64 delete[] this->parameters;65 delete[] this->defaultValue;66 57 if (this->alias != NULL && ShellCommandClass::aliasList != NULL) 67 58 { … … 369 360 while(elem != NULL) 370 361 { 371 PRINT(0)(" command:'%s' : params:%d: ", elem->getName(), elem->paramCount); 372 for (unsigned int i = 0; i< elem->paramCount; i++) 373 printf("%s ", ShellCommand::paramToString(elem->parameters[i])); 362 PRINT(0)(" command:'%s' : params:%d: ", elem->getName(), elem->executor->getParamCount()); 363 /// FIXME 364 /* for (unsigned int i = 0; i< elem->paramCount; i++) 365 printf("%s ", ShellCommand::paramToString(elem->parameters[i]));*/ 374 366 if (elem->description != NULL) 375 367 printf("- %s", elem->description); -
trunk/src/lib/shell/shell_command.h
r5641 r5642 86 86 87 87 protected: 88 unsigned int paramCount; //!< the count of parameters.89 unsigned int* parameters; //!< Parameters the function of this Command takes.90 88 MultiType* defaultValue; //!< Default Values. 91 89 … … 95 93 96 94 const char* description; //!< A description for this commnand. (initially NULL). Assigned with (create)->describe("blablabla"); 97 Executor* executor; 95 Executor* executor; //!< The Executor, that really executes the Function. 98 96 99 97 }; -
trunk/src/lib/shell/shell_command_class.cc
r5641 r5642 238 238 while(elem != NULL) 239 239 { 240 PRINT(0)(" command:'%s' : params:%d: ", elem->getName(), elem->paramCount); 241 for (unsigned int i = 0; i< elem->paramCount; i++) 242 PRINT(0)("%s ", ShellCommand::paramToString(elem->parameters[i])); 240 PRINT(0)(" command:'%s' : params:%d: ", elem->getName(), elem->executor->getParamCount()); 241 /// FIXME 242 /* for (unsigned int i = 0; i< elem->paramCount; i++) 243 PRINT(0)("%s ", ShellCommand::paramToString(elem->parameters[i]));*/ 243 244 if (elem->description != NULL) 244 245 PRINT(0)("- %s", elem->description);
Note: See TracChangeset
for help on using the changeset viewer.