diff options
| author | alpine <[email protected]> | 2020-06-18 22:19:30 +0200 |
|---|---|---|
| committer | alpine <[email protected]> | 2020-06-18 22:19:30 +0200 |
| commit | c880bb35ac9b0744be38a66b6e8860464fe304ed (patch) | |
| tree | e81ebc8fd5dc9614534bafaeb9e39a089738a94d /server/src/util/commands.h | |
| parent | Finished session id on client and server. (diff) | |
| download | loader-c880bb35ac9b0744be38a66b6e8860464fe304ed.tar.xz loader-c880bb35ac9b0744be38a66b6e8860464fe304ed.zip | |
Changed clang format style.
Diffstat (limited to 'server/src/util/commands.h')
| -rw-r--r-- | server/src/util/commands.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/server/src/util/commands.h b/server/src/util/commands.h index 1e5ae0f..547a78c 100644 --- a/server/src/util/commands.h +++ b/server/src/util/commands.h @@ -1,21 +1,19 @@ #pragma once class commands { - using func = std::function<void()>; - std::unordered_map<std::string_view, func> m_cmds; + using func = std::function<void()>; + std::unordered_map<std::string_view, func> m_cmds; - public: - bool parse_input(const std::string_view str) { - auto it = m_cmds.find(str); - if (it != m_cmds.end()) { - it->second(); - return true; +public: + bool parse_input(const std::string_view str) + { + auto it = m_cmds.find(str); + if(it != m_cmds.end()) { + it->second(); + return true; + } + return false; } - return false; - } - void add(const std::string_view cmd, const func &cb) { - - m_cmds[cmd] = cb; - } + void add(const std::string_view cmd, const func& cb) { m_cmds[cmd] = cb; } }; |