- Timestamp:
- Apr 27, 2006, 4:23:55 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r7397 r7398 41 41 PRINTF(5)("create shellcommand %s %s\n", commandName, className); 42 42 this->setName(commandName); 43 44 // copy the executor: 43 45 this->executor = executor.clone(); 44 46 this->executor->setName(commandName); 47 45 48 this->alias = NULL; 46 49 47 50 // this->classID = classID; 48 51 this->shellClass = ShellCommandClass::getCommandClass(className); 49 if (this->shellClass != NULL)50 52 assert (this->shellClass != NULL); 53 this->shellClass->commandList.push_back(this); 51 54 } 52 55 … … 62 65 63 66 /** 64 * registers a new ShellCommand67 * @brief registers a new ShellCommand 65 68 */ 66 69 ShellCommand* ShellCommand::registerCommand(const std::string& commandName, const std::string& className, const Executor& executor) … … 74 77 75 78 /** 76 * unregister an existing commandName79 * @brief unregister an existing commandName 77 80 * @param className the name of the Class the command belongs to. 78 81 * @param commandName the name of the command itself -
trunk/src/lib/shell/shell_command.h
r7397 r7398 23 23 24 24 /** 25 * an easy to use Macro to create a Command25 * @brief an easy to use Macro to create a Command 26 26 * @param command the name of the command (without "" around the string) 27 27 * @param class the name of the class to apply this command to (without the "" around the string) … … 41 41 42 42 /** 43 * an easy to use Macro to create a Command43 * @brief an easy to use Macro to create a Command 44 44 * @param command the name of the command (without "" around the string) 45 45 * @param class the name of the class to apply this command to (without the "" around the string) -
trunk/src/lib/util/substring.cc
r7325 r7398 36 36 */ 37 37 SubString::SubString() 38 { 39 } 38 {} 40 39 41 40 … … 122 121 * @returns true if the Stored Strings match 123 122 */ 124 bool SubString::operator==(const SubString& subString) 123 bool SubString::operator==(const SubString& subString) const 125 124 { 126 125 return (this->strings == subString.strings); 126 } 127 128 /** 129 * @brief comparator. 130 * @param subString the SubString to compare against this one. 131 * @returns true if the Stored Strings match 132 */ 133 bool SubString::compare(const SubString& subString) const 134 { 135 return (*this == subString); 136 } 137 138 /** 139 * @brief comparator. 140 * @param subString the SubString to compare against this one. 141 * @returns true if the Stored Strings match 142 */ 143 bool SubString::compare(const SubString& subString, unsigned int length) const 144 { 145 if (length > this->size() || length > subString.size()) 146 return false; 147 148 for (unsigned int i = 0; i < length; i++) 149 if (this->strings[i] != subString.strings[i]) 150 return false; 151 return true; 127 152 } 128 153 … … 272 297 switch(state) 273 298 { 274 case SL_NORMAL:299 case SL_NORMAL: 275 300 if(line[i] == escape_char) 276 301 { … … 307 332 } 308 333 break; 309 case SL_ESCAPE:334 case SL_ESCAPE: 310 335 if(line[i] == 'n') token += '\n'; 311 336 else if(line[i] == 't') token += '\t'; … … 319 344 state = SL_NORMAL; 320 345 break; 321 case SL_SAFEMODE:346 case SL_SAFEMODE: 322 347 if(line[i] == safemode_char) 323 348 { … … 333 358 } 334 359 break; 335 case SL_SAFEESCAPE:360 case SL_SAFEESCAPE: 336 361 if(line[i] == 'n') token += '\n'; 337 362 else if(line[i] == 't') token += '\t'; … … 345 370 state = SL_SAFEMODE; 346 371 break; 347 case SL_COMMENT:372 case SL_COMMENT: 348 373 if(line[i] == '\n') 349 374 { … … 361 386 } 362 387 break; 363 default:388 default: 364 389 // nothing 365 390 break; -
trunk/src/lib/util/substring.h
r7340 r7398 37 37 // operate on the SubString 38 38 SubString& operator=(const SubString& subString); 39 bool operator==(const SubString& subString); 39 bool operator==(const SubString& subString) const; 40 bool compare(const SubString& subString) const; 41 bool compare(const SubString& subString, unsigned int length) const; 40 42 SubString operator+(const SubString& subString) const; 41 43 SubString& operator+=(const SubString& subString);
Note: See TracChangeset
for help on using the changeset viewer.