Changeset 5197 in orxonox.OLD
- Timestamp:
- Sep 18, 2005, 2:57:20 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell.h
r5183 r5197 42 42 void activate(); 43 43 void deactivate(); 44 /** @returns true if the Shell is active, false otherwise. */ 44 45 inline bool isActive() const { return this->bActive; }; 45 46 … … 82 83 83 84 // HANDLING TEXT INPUT 84 ShellInput* shellInput; 85 ShellInput* shellInput; //!< The inputLine of the Shell. 85 86 // BUFFER 86 87 unsigned int bufferDisplaySize; //!< The Size of the Display-buffer, in lines (not in characters) -
trunk/src/lib/shell/shell_command.cc
r5196 r5197 61 61 } 62 62 63 /** 64 * collects the Commands registered to some class. 65 * @param className the name of the Class to collect the Commands from. 66 * @param stringList a List to paste the Commands into. 67 * @returns true on success, false otherwise 68 */ 63 69 bool ShellCommandClass::getCommandListOfClass(const char* className, tList<const char>* stringList) 64 70 { … … 88 94 } 89 95 96 /** 97 * collects the Aliases registered to the ShellCommands 98 * @param stringList a List to paste the Aliases into. 99 * @returns true on success, false otherwise 100 */ 90 101 bool ShellCommandClass::getCommandListOfAlias(tList<const char>* stringList) 91 102 { … … 104 115 } 105 116 106 107 117 /** 108 118 * unregisters all Commands that exist … … 127 137 if (ShellCommandClass::aliasList != NULL) 128 138 { 129 tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator(); 130 ShellCommandAlias* elemAL = itAL->firstElement(); 131 while(elemAL != NULL) 132 { 133 delete elemAL; 134 elemAL = itAL->nextElement(); 135 } 136 delete itAL; 137 delete ShellCommandClass::aliasList; 138 ShellCommandClass::aliasList = NULL; 139 } 140 } 141 139 tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator(); 140 ShellCommandAlias* elemAL = itAL->firstElement(); 141 while(elemAL != NULL) 142 { 143 delete elemAL; 144 elemAL = itAL->nextElement(); 145 } 146 delete itAL; 147 delete ShellCommandClass::aliasList; 148 ShellCommandClass::aliasList = NULL; 149 } 150 } 151 152 /** 153 * checks if a Class is already registered to the Commands' class-stack 154 * @param className the Name of the Class to check for 155 * @returns the CommandClass if found, NULL otherwise 156 */ 142 157 const ShellCommandClass* ShellCommandClass::isRegistered(const char* className) 143 158 { … … 468 483 } 469 484 485 /** 486 * adds an Alias to this Command 487 * @param alias the name of the Alias to set 488 * @returns itself 489 */ 470 490 ShellCommandBase* ShellCommandBase::setAlias(const char* alias) 471 491 { -
trunk/src/lib/shell/shell_command.h
r5196 r5197 51 51 52 52 public: 53 /** @returns the CommandClassList */ 53 54 static const tList<ShellCommandClass>* getCommandClassList() { return ShellCommandClass::commandClassList; }; 54 55 static bool getCommandListOfClass(const char* className, tList<const char>* stringList); … … 317 318 }; 318 319 320 //! A Class, that handles aliases. 319 321 class ShellCommandAlias 320 322 { 321 323 friend class ShellCommandBase; 322 324 public: 325 /** @returns the Name of the Alias. */ 323 326 const char* getName() const { return this->aliasName; }; 327 /** @returns the Command, this Alias is asociated with */ 324 328 ShellCommandBase* getCommand() const { return this->command; }; 325 329 326 330 private: 331 /** @param aliasName the name of the Alias @param command the Command, to associate this alias with */ 327 332 ShellCommandAlias(const char* aliasName, ShellCommandBase* command) { this->aliasName = aliasName; this->command = command; }; 328 333 329 334 private: 330 const char* aliasName; 331 ShellCommandBase* command; 335 const char* aliasName; //!< the name of the Alias 336 ShellCommandBase* command; //!< a pointer to the command, this alias executes. 332 337 }; 333 338 334 335 339 #endif /* _SHELL_COMMAND_H */ -
trunk/src/lib/shell/shell_completion.cc
r5195 r5197 202 202 * completes a Function 203 203 * @param functionBegin the beginning of the function String 204 * @param classID the class' ID to complete the function of 204 205 */ 205 206 bool ShellCompletion::functionComplete(const char* functionBegin, long classID) … … 215 216 } 216 217 218 /** 219 * completes an Alias 220 * @param aliasBegin the beginning of the Alias-String to complete 221 * @returns true on succes, false if something went wrong 222 */ 217 223 bool ShellCompletion::aliasComplete(const char* aliasBegin) 218 224 { … … 352 358 } 353 359 354 360 /** 361 * deletes the Completion List. 362 * 363 * This is done at the beginning of each completion-run 364 */ 355 365 void ShellCompletion::emptyCompletionList() 356 366 { -
trunk/src/lib/shell/shell_completion.h
r5195 r5197 15 15 #endif 16 16 17 //! an enumerator for different types the Shell can complete. 17 18 typedef enum { 18 19 SHELLC_NONE = 0, … … 23 24 } SHELLC_TYPE; 24 25 26 //! A struct for ShellElements (these are used as containers to identify an Input for what it is) 25 27 struct ShellC_Element{ 26 const char* name; //!< 27 SHELLC_TYPE type; 28 const char* name; //!< the Name of the Element to be completed. 29 SHELLC_TYPE type; //!< the type of the Element 28 30 }; 29 31 … … 37 39 bool autoComplete(ShellInput* input = NULL); 38 40 bool classComplete(const char* classBegin); 39 long classMatch(const char* input, unsigned int* length);41 // long classMatch(const char* input, unsigned int* length); 40 42 bool objectComplete(const char* objectBegin, long classID); 41 bool objectMatch(const char* objectBegin, long classID, unsigned int* length);43 // bool objectMatch(const char* objectBegin, long classID, unsigned int* length); 42 44 bool functionComplete(const char* functionBegin, long classID); 43 bool functionMatch(const char* functionBegin, long classID, unsigned int* length);45 // bool functionMatch(const char* functionBegin, long classID, unsigned int* length); 44 46 bool aliasComplete(const char* aliasBegin); 45 47 … … 52 54 private: 53 55 tList<ShellC_Element>* completionList; //!< A list of completions, that are io. 54 ShellInput* input; 56 ShellInput* input; //!< the input this completion works on. 55 57 }; 56 58 -
trunk/src/lib/shell/shell_input.cc
r5184 r5197 182 182 } 183 183 184 /** 185 * ticks the ShellInput 186 * @param dt the time passed since the last update 187 */ 184 188 void ShellInput::tick(float dt) 185 189 {
Note: See TracChangeset
for help on using the changeset viewer.