- Timestamp:
- Nov 18, 2005, 7:29:10 PM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r5639 r5640 264 264 if (!strcmp(enumCMD->getName(), inputSplits.getString(fktPos))) 265 265 { 266 if (objectPointer == NULL && enumCMD-> functorType == ShellCommand_Objective)266 if (objectPointer == NULL && enumCMD->executor->getType() == Executor_Objective) 267 267 { 268 268 delete itCMD; … … 339 339 if (this == NULL) 340 340 return NULL; 341 if (count == 0) 342 return this; 343 if (count > this->paramCount) 344 count = this->paramCount; 345 346 va_list defaultList; 347 va_start(defaultList, count); 348 349 for (unsigned int i = 0; i < count; i++) 350 { 351 352 353 switch (this->parameters[i]) 354 { 355 case MT_BOOL: 356 this->defaultValue[i].setInt(va_arg(defaultList, int)); 357 break; 358 case MT_CHAR: 359 this->defaultValue[i].setChar((char)va_arg(defaultList, int)); 360 break; 361 case MT_STRING: 362 this->defaultValue[i].setString(va_arg(defaultList, char*)); 363 break; 364 case MT_INT: 365 this->defaultValue[i].setInt(va_arg(defaultList, int)); 366 break; 367 /* case MT_UINT: 368 this->defaultValue[i].setInt((int)va_arg(defaultList, unsigned int)); 369 break;*/ 370 case MT_FLOAT: 371 this->defaultValue[i].setFloat(va_arg(defaultList, double)); 372 break; 373 /* case MT_LONG: 374 this->defaultValue[i].setInt((int) va_arg(defaultList, long)); 375 break;*/ 376 default: 377 break; 378 } 379 } 341 342 va_list values; 343 va_start(values, count); 344 345 this->executor->defaultValues(count, values); 346 380 347 return this; 381 348 } -
trunk/src/lib/shell/shell_command.h
r5639 r5640 60 60 61 61 62 //! an enumerator for the definition of the Type.63 typedef enum {64 ShellCommand_Objective = 1,65 ShellCommand_Static = 2,66 } ShellCommand_Type;67 62 68 63 //! a baseClass for all possible ShellCommands … … 87 82 ~ShellCommand(); 88 83 89 /** @returns the Type of this Function (either static or objective) */90 inline ShellCommand_Type getType() { return this->functorType; };91 92 84 static bool isRegistered(const char* commandName, const char* className, Executor* executor); 93 85 static const char* paramToString(long parameter); 94 86 95 87 protected: 96 ShellCommand_Type functorType; //!< The type of Function we've got (either static or objective).97 88 void* functionPointer; //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL ) 98 89 unsigned int paramCount; //!< the count of parameters.
Note: See TracChangeset
for help on using the changeset viewer.