aboutsummaryrefslogtreecommitdiff
path: root/server/src/util/commands.h
diff options
context:
space:
mode:
authoralpine <[email protected]>2020-06-18 22:19:30 +0200
committeralpine <[email protected]>2020-06-18 22:19:30 +0200
commitc880bb35ac9b0744be38a66b6e8860464fe304ed (patch)
treee81ebc8fd5dc9614534bafaeb9e39a089738a94d /server/src/util/commands.h
parentFinished session id on client and server. (diff)
downloadloader-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.h26
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; }
};