Changeset 7236 for code/branches/consolecommands3/src/libraries/core/command/ArgumentCompletionFunctions.cc
- Timestamp:
- Aug 28, 2010, 1:51:04 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/ArgumentCompletionFunctions.cc
r7235 r7236 60 60 namespace detail 61 61 { 62 bool groupIsVisible(const std::map<std::string, _ConsoleCommand*>& group, bool bOnlyShowHidden)63 { 64 for (std::map<std::string, _ConsoleCommand*>::const_iterator it_command = group.begin(); it_command != group.end(); ++it_command)62 bool groupIsVisible(const std::map<std::string, ConsoleCommand*>& group, bool bOnlyShowHidden) 63 { 64 for (std::map<std::string, ConsoleCommand*>::const_iterator it_command = group.begin(); it_command != group.end(); ++it_command) 65 65 if (it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden) 66 66 return true; … … 74 74 std::string fragmentLC = getLowercase(fragment); 75 75 76 const std::map<std::string, std::map<std::string, _ConsoleCommand*> >& commands = _ConsoleCommand::getCommands();77 for (std::map<std::string, std::map<std::string, _ConsoleCommand*> >::const_iterator it_group = commands.begin(); it_group != commands.end(); ++it_group)76 const std::map<std::string, std::map<std::string, ConsoleCommand*> >& commands = ConsoleCommand::getCommands(); 77 for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = commands.begin(); it_group != commands.end(); ++it_group) 78 78 if (groupIsVisible(it_group->second, bOnlyShowHidden) && it_group->first != "" && (fragmentLC == "" || getLowercase(it_group->first).find_first_of(fragmentLC) == 0)) 79 79 groupList.push_back(ArgumentCompletionListElement(it_group->first, getLowercase(it_group->first))); 80 80 81 std::map<std::string, std::map<std::string, _ConsoleCommand*> >::const_iterator it_group = commands.find("");81 std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = commands.find(""); 82 82 if (it_group != commands.end()) 83 83 { … … 85 85 groupList.push_back(ArgumentCompletionListElement("", "", "\n")); 86 86 87 for (std::map<std::string, _ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command)87 for (std::map<std::string, ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command) 88 88 if (it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(it_command->first).find_first_of(fragmentLC) == 0)) 89 89 groupList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first))); … … 102 102 std::string groupLC = getLowercase(group); 103 103 104 std::map<std::string, std::map<std::string, _ConsoleCommand*> >::const_iterator it_group = _ConsoleCommand::getCommands().begin();105 for ( ; it_group != _ConsoleCommand::getCommands().end(); ++it_group)104 std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommand::getCommands().begin(); 105 for ( ; it_group != ConsoleCommand::getCommands().end(); ++it_group) 106 106 if (getLowercase(it_group->first) == groupLC) 107 107 break; 108 108 109 if (it_group != _ConsoleCommand::getCommands().end())110 { 111 for (std::map<std::string, _ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command)109 if (it_group != ConsoleCommand::getCommands().end()) 110 { 111 for (std::map<std::string, ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command) 112 112 if (it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden) 113 113 commandList.push_back(ArgumentCompletionListElement(it_command->first, getLowercase(it_command->first))); … … 152 152 return detail::_groupsandcommands(fragment, true); 153 153 154 if ( _ConsoleCommand::getCommandLC(getLowercase(tokens[0])))154 if (ConsoleCommand::getCommandLC(getLowercase(tokens[0]))) 155 155 return ARGUMENT_COMPLETION_FUNCTION_CALL(command)(fragment); 156 156 157 157 if (tokens.size() == 1) 158 158 { 159 std::map<std::string, std::map<std::string, _ConsoleCommand*> >::const_iterator it_group = _ConsoleCommand::getCommands().find(tokens[0]);160 if (it_group != _ConsoleCommand::getCommands().end())159 std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommand::getCommands().find(tokens[0]); 160 if (it_group != ConsoleCommand::getCommands().end()) 161 161 return detail::_subcommands(fragment, tokens[0], true); 162 162 else … … 164 164 } 165 165 166 if ( _ConsoleCommand::getCommandLC(getLowercase(tokens[0]), getLowercase(tokens[1])))166 if (ConsoleCommand::getCommandLC(getLowercase(tokens[0]), getLowercase(tokens[1]))) 167 167 return ARGUMENT_COMPLETION_FUNCTION_CALL(command)(fragment); 168 168
Note: See TracChangeset
for help on using the changeset viewer.