Changeset 7411 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Apr 27, 2006, 11:23:55 PM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7409 r7411 114 114 if (likely(checkClass != NULL)) 115 115 { 116 printf("TEST\n");117 116 std::vector<ShellCommand*>::const_iterator elem; 118 117 for (elem = checkClass->commandList.begin(); elem != checkClass->commandList.end(); elem++) … … 123 122 } 124 123 } 125 return NULL;124 return NULL; 126 125 } 127 126 … … 153 152 const std::list<BaseObject*>* objectList = NULL; //< the list of Objects stored in classID 154 153 BaseObject* objectPointer = NULL; //< a pointer to th Object to Execute the command on 155 bool emptyComplete = false; //< if the completion input is empty string. e.g ""154 // bool emptyComplete = false; //< if the completion input is empty string. e.g "" 156 155 // long completeType = SHELLC_NONE; //< the Type we'd like to complete. 157 156 … … 241 240 } 242 241 242 243 243 /** 244 244 * @brief lets a command be described -
trunk/src/lib/shell/shell_command.h
r7409 r7411 62 62 friend class ShellCommandClass; 63 63 public: 64 //! an enumerator for different types the Shell parses. 65 typedef enum { 66 NullRecognition = 0, 67 ClassRecognition = 1, 68 ObjectRecognition = 2, 69 FunctionRecognition = 4, 70 AliasRecognition = 8, 71 ParameterRecognition = 16, 72 } RecognitionType; 73 64 74 static bool execute (const std::string& executionString); 65 75 -
trunk/src/lib/shell/shell_command_class.cc
r7408 r7411 114 114 std::vector<ShellCommandClass*>::const_iterator classIT; 115 115 for (classIT = ShellCommandClass::commandClassList.begin(); classIT != ShellCommandClass::commandClassList.end(); classIT++) 116 {117 116 if (className == (*classIT)->className) 118 {119 if ((*classIT)->classID == CL_NULL)120 (*classIT)->classID = ClassList::StringToID(className);121 122 117 return (*classIT); 123 }124 }125 118 return NULL; 126 119 } … … 131 124 * @returns the CommandClass if found, NULL otherwise 132 125 */ 133 /*bool ShellCommandClass::exists(const std::string& className)126 bool ShellCommandClass::exists(const std::string& className) 134 127 { 128 return (ShellCommandClass::getCommandClass(className) != NULL); 129 } 135 130 136 }*/ 131 ClassID ShellCommandClass::getClassID() 132 { 133 if (this->classID == CL_NULL) 134 this->classID = ClassList::StringToID(this->className); 135 return this->classID; 136 } 137 137 138 138 139 /** -
trunk/src/lib/shell/shell_command_class.h
r7408 r7411 30 30 static void unregisterAllCommands(); 31 31 static const ShellCommandClass* getCommandClass(const std::string& className); 32 ClassID getClassID(); 32 33 static bool exists(const std::string& className); 33 34 … … 45 46 private: 46 47 const std::string className; //!< The Name of the Class. This should match the ClassName of the Commands Class. 47 longclassID; //!< The classID of this Class48 ClassID classID; //!< The classID of this Class 48 49 std::vector<ShellCommand*> commandList; //!< A list of Commands from this Class 49 50
Note: See TracChangeset
for help on using the changeset viewer.