diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-02-03 19:14:35 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-02-03 19:14:35 +0000 |
| commit | 0483e951ade67989f762cfcd3796b261ffae41dd (patch) | |
| tree | 012f813b4efc8dadcd7b8b17dd600ea66f2f7d21 /src/command_manager.cc | |
| parent | ac02ccb53d2a299e43807f81f589cdb677787677 (diff) | |
use memoryview instead of std::vector where applicable
Diffstat (limited to 'src/command_manager.cc')
| -rw-r--r-- | src/command_manager.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/command_manager.cc b/src/command_manager.cc index 33815be4..b8d032ac 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -15,9 +15,9 @@ void CommandManager::register_command(const std::string& command_name, Command c m_commands[command_name] = CommandDescriptor { command, flags, completer }; } -void CommandManager::register_command(const std::vector<std::string>& command_names, Command command, - unsigned flags, - const CommandCompleter& completer) +void CommandManager::register_commands(const memoryview<std::string>& command_names, Command command, + unsigned flags, + const CommandCompleter& completer) { for (auto command_name : command_names) register_command(command_name, command, flags, completer); @@ -70,7 +70,7 @@ void CommandManager::execute(const std::string& command_line, if (tokens.empty()) return; - CommandParameters params; + std::vector<std::string> params; for (auto it = tokens.begin(); it != tokens.end(); ++it) { params.push_back(command_line.substr(it->first, @@ -152,7 +152,7 @@ Completions CommandManager::complete(const std::string& command_line, size_t cur if (command_it == m_commands.end() or not command_it->second.completer) return Completions(); - CommandParameters params; + std::vector<std::string> params; for (auto it = tokens.begin() + 1; it != tokens.end(); ++it) { params.push_back(command_line.substr(it->first, |
