Changeset 1435 for code/branches/console/src/core
- Timestamp:
- May 27, 2008, 1:17:33 AM (16 years ago)
- Location:
- code/branches/console/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/core/CommandEvaluation.cc
r1434 r1435 100 100 if (!this->bNewCommand_) 101 101 { 102 std::cout << "not new" << std::endl;103 102 switch (this->state_) 104 103 { … … 163 162 { 164 163 case CS_Uninitialized: 165 std::cout << "hint: CS_Uninitialized" << std::endl;166 164 break; 167 165 case CS_Empty: 168 std::cout << "hint: CS_Empty" << std::endl;169 166 case CS_ShortcutOrIdentifier: 170 std::cout << "hint: CS_ShortcutOrIdentifier" << std::endl;171 167 if (this->listOfPossibleFunctions_.size() == 0) 172 168 return CommandEvaluation::dump(this->listOfPossibleIdentifiers_); … … 177 173 break; 178 174 case CS_Function: 179 std::cout << "hint: CS_Function" << std::endl;180 175 return CommandEvaluation::dump(this->listOfPossibleFunctions_); 181 176 break; 182 177 case CS_ParamPreparation: 183 std::cout << "hint: CS_ParamPreparation" << std::endl;184 178 case CS_Params: 185 std::cout << "hint: CS_Params" << std::endl;186 179 if (this->listOfPossibleArguments_.size() > 0) 187 180 return CommandEvaluation::dump(this->listOfPossibleArguments_); … … 189 182 return CommandEvaluation::dump(this->function_); 190 183 case CS_Finished: 191 std::cout << "hint: CS_Finished" << std::endl;192 184 if (this->function_) 193 185 return CommandEvaluation::dump(this->function_); 194 186 break; 195 187 case CS_Error: 196 std::cout << "hint: CS_Error" << std::endl;197 188 return this->errorMessage_; 198 189 break; -
code/branches/console/src/core/CommandExecutor.cc
r1434 r1435 126 126 void CommandExecutor::parseIfNeeded(const std::string& command) 127 127 { 128 std::cout << "parse if needed: command: >" << command << "<" << std::endl;129 std::cout << " old original: >" << CommandExecutor::getEvaluation().originalCommand_ << "<" << std::endl;130 std::cout << " old modified: >" << CommandExecutor::getEvaluation().command_ << "<" << std::endl;131 128 if (CommandExecutor::getEvaluation().state_ == CS_Uninitialized) 132 129 { 133 std::cout << "parse if needed: parse!" << std::endl;134 130 CommandExecutor::parse(command); 135 131 } 136 else if ( /*removeTrailingWhitespaces*/(CommandExecutor::getEvaluation().originalCommand_) != /*removeTrailingWhitespaces*/(command))132 else if (CommandExecutor::getEvaluation().originalCommand_ != command) 137 133 { 138 134 if (CommandExecutor::getEvaluation().command_ == command) 139 135 { 140 std::cout << "parse if needed: parse and set bNewCommand_ to false" << std::endl;141 136 CommandExecutor::parse(command); 142 137 CommandExecutor::getEvaluation().bNewCommand_ = false; … … 144 139 else 145 140 { 146 std::cout << "parse if needed: parse!" << std::endl;147 141 CommandExecutor::parse(command); 148 142 } 149 143 } 150 std::cout << "parse if needed: don't parse" << std::endl;151 144 } 152 145 … … 163 156 { 164 157 case CS_Uninitialized: 165 std::cout << "0: Uninitialized\n";166 158 { 167 159 // Impossible … … 169 161 } 170 162 case CS_Empty: 171 std::cout << "0: Empty\n";172 163 { 173 164 if (CommandExecutor::argumentsGiven() == 0) … … 184 175 } 185 176 case CS_ShortcutOrIdentifier: 186 std::cout << "0: ShortcutOrIdentifier\n";187 177 { 188 178 if (CommandExecutor::argumentsGiven() > 1) … … 201 191 else if (CommandExecutor::getEvaluation().functionclass_) 202 192 { 203 std::cout << "MEP" << std::endl;204 193 // It's a functionname 205 194 CommandExecutor::getEvaluation().state_ = CS_Function; … … 283 272 } 284 273 case CS_Function: 285 std::cout << "0: Function\n";286 274 { 287 275 if (CommandExecutor::getEvaluation().functionclass_) … … 295 283 if (CommandExecutor::getEvaluation().function_) 296 284 { 297 std::cout << "MEP2" << std::endl;298 285 // It's a function 299 286 CommandExecutor::getEvaluation().state_ = CS_ParamPreparation; … … 551 538 std::string CommandExecutor::getPossibleArgument(const std::string& name, ConsoleCommand* command, unsigned int param) 552 539 { 553 std::cout << "4_1\n";554 540 CommandExecutor::createArgumentCompletionList(command, param); 555 541 556 std::cout << "4_2\n";557 542 std::string lowercase = getLowercase(name); 558 std::cout << "4_3\n";559 543 for (std::list<std::pair<std::string, std::string> >::const_iterator it = command->getArgumentCompletionListBegin(); it != command->getArgumentCompletionListEnd(); ++it) 560 544 { 561 std::cout << "4_4\n";562 545 if ((*it).first == lowercase) 563 546 return (*it).second; 564 547 } 565 548 566 std::cout << "4_5\n";567 549 return ""; 568 550 } -
code/branches/console/src/core/ConfigFileManager.cc
r1434 r1435 39 39 { 40 40 SetConsoleCommandShortcutExtern(config).setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue()); 41 SetConsoleCommandShortcutExtern(tconfig) ;41 SetConsoleCommandShortcutExtern(tconfig).setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue()); 42 42 SetConsoleCommandShortcutExtern(reloadConfig); 43 43 SetConsoleCommandShortcutExtern(cleanConfig); … … 47 47 bool config(const std::string& classname, const std::string& varname, const std::string& value) 48 48 { 49 std::cout << "10a_1\n";50 49 std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname)); 51 50 if (identifier != Identifier::getLowercaseIdentifierMapEnd()) 52 51 { 53 std::cout << "10a_2\n";54 52 std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname)); 55 53 if (variable != (*identifier).second->getLowercaseConfigValueMapEnd()) 56 { 57 std::cout << "10a_3\n"; 58 return (*variable).second->tset(value); 59 } 54 return (*variable).second->set(value); 60 55 } 61 56 return false; … … 64 59 bool tconfig(const std::string& classname, const std::string& varname, const std::string& value) 65 60 { 66 std::cout << "10b_1\n";67 61 std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname)); 68 62 if (identifier != Identifier::getLowercaseIdentifierMapEnd()) 69 63 { 70 std::cout << "10b_2\n";71 64 std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname)); 72 65 if (variable != (*identifier).second->getLowercaseConfigValueMapEnd()) 73 {74 std::cout << "10b_3\n";75 66 return (*variable).second->tset(value); 76 }77 67 } 78 68 return false;
Note: See TracChangeset
for help on using the changeset viewer.