Changeset 7414 in orxonox.OLD for trunk/src/lib/shell/shell_command.cc
- Timestamp:
- Apr 28, 2006, 1:12:28 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7413 r7414 136 136 /** 137 137 * @brief takes out an InputLine, searching for a Command. 138 * @see const ShellCommand* const ShellCommand::getCommandFromInput(const SubString& strings) 138 139 * @param inputLine: the Input to analyse. 140 * @param paramBegin: The begin of the Splitted SubStrings entry of the Parameters section. 139 141 * @returns: The ShellCommand if found. 140 142 */ 141 const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine) 142 { 143 SubString strings(inputLine, SubString::WhiteSpaces); 143 const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine, unsigned int& paramBegin) 144 { 145 ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin); 146 } 147 148 /** 149 * @brief takes out an InputLine, searching for a Command. 150 * @param strings: the Input to analyse. 151 * @param paramBegin: The begin of the Splitted SubStrings entry of the Parameters section. 152 * @returns: The ShellCommand if found. 153 */ 154 const ShellCommand* const ShellCommand::getCommandFromInput(const SubString& strings, unsigned int& paramBegin) 155 { 144 156 // no input, no Command. 145 157 if (strings.size() == 0) 146 return NULL; 158 { 159 paramBegin = 0; 160 return NULL; 161 } 147 162 148 163 // CHECK FOR ALIAS … … 162 177 const ShellCommand* retCmd; 163 178 if (strings.size() >= 1) 179 { 164 180 retCmd = ShellCommand::getCommand(strings[1], cmdClass); 181 paramBegin = 2; 182 } 165 183 if (retCmd == NULL && strings.size() >= 2) 184 { 166 185 retCmd = ShellCommand::getCommand(strings[2], cmdClass); 167 return retCmd; 168 169 } 186 paramBegin = 3; 187 } 188 if (retCmd != NULL) // check for the paramBegin. 189 return retCmd; 190 } 191 paramBegin = 0; 192 return NULL; 170 193 } 171 194
Note: See TracChangeset
for help on using the changeset viewer.