Console: Make commandExists() a const qualified member function

This doesn't modify internal console state, so it can be turned into a
const qualified member function.
This commit is contained in:
Lioncash 2019-10-21 01:30:16 -04:00
parent deb09550d3
commit c8eab43489
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ public:
void help(Console* con, const std::vector<std::string>& args);
void listCommands(Console* con, const std::vector<std::string>& args);
bool commandExists(std::string_view cmd);
bool commandExists(std::string_view cmd) const;
void vreport(Level level, fmt::string_view format, fmt::format_args args);
template <typename S, typename... Args, typename Char = fmt::char_t<S>>

View File

@ -167,7 +167,7 @@ void Console::listCommands(Console* /*con*/, const std::vector<std::string>& /*a
report(Level::Info, fmt("'{}': {}"), comPair.second.m_displayName, comPair.second.m_helpString);
}
bool Console::commandExists(std::string_view cmd) {
bool Console::commandExists(std::string_view cmd) const {
std::string cmdName{cmd};
athena::utility::tolower(cmdName);