Changeset 7344 in orxonox.OLD
- Timestamp:
- Apr 19, 2006, 4:33:55 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_completion.cc
r7343 r7344 48 48 /** 49 49 * @brief autocompletes the Shell's inputLine 50 * @param input the input to complete. 50 51 * @returns true, if a result was found, false otherwise 51 52 */ … … 58 59 bool emptyComplete = false; //< if the completion input is empty string. e.g "" 59 60 long completeType = SHELLC_NONE; //< the Type we'd like to complete. 60 const char*completeString; //< the string to complete.61 std::string completeString; //< the string to complete. 61 62 62 63 … … 66 67 // Check if we are in a input. eg. the supplied string "class " and now we complete either function or object 67 68 if (input[input.size()-1] == ' ') 68 {69 69 emptyComplete = true; 70 }71 70 72 71 // CREATE INPUTS 73 SubString inputSplits(input, " \t\n,");72 SubString inputSplits(input, SubString::WhiteSpacesWithComma); 74 73 75 74 // What String will be completed … … 77 76 completeString = ""; 78 77 else 79 completeString = inputSplits.getString(inputSplits.size()-1) .c_str();78 completeString = inputSplits.getString(inputSplits.size()-1); 80 79 81 80 // CLASS COMPLETION … … 95 94 (inputSplits.size() == 2 && emptyComplete == false)) 96 95 { 97 classID = ClassList::StringToID(inputSplits.getString(0) .c_str()); //FIXME96 classID = ClassList::StringToID(inputSplits.getString(0)); 98 97 objectList = ClassList::getList((ClassID)classID); 99 98 if (classID != CL_NULL) … … 105 104 (inputSplits.size() == 3 && emptyComplete == false)) 106 105 { 107 classID = ClassList::StringToID(inputSplits.getString(0) .c_str()); // FIXME106 classID = ClassList::StringToID(inputSplits.getString(0)); 108 107 if (classID == CL_NULL) 109 108 return false; … … 117 116 this->objectComplete(completeString, classID); 118 117 if (completeType & SHELLC_FUNCTION) 119 this->functionComplete(completeString, inputSplits.getString(0) .c_str()); // FIXME118 this->functionComplete(completeString, inputSplits.getString(0)); 120 119 if (completeType & SHELLC_ALIAS) 121 120 this->aliasComplete(completeString); … … 199 198 /** 200 199 * @brief completes the inputline on grounds of an inputList 200 * @param input the Input to complete. 201 201 * @param begin the String to search in the inputList, and to extend with it. 202 202 * @param displayAs how to display the found value to the user, printf-style, !!with only one %s!! ex.: "::%s::"
Note: See TracChangeset
for help on using the changeset viewer.