aboutsummaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2018-12-11 07:42:05 +0100
committerFelix Morgner <felix.morgner@gmail.com>2018-12-11 07:42:05 +0100
commited419140280553b070943b7ba539120a26ff5686 (patch)
tree3d134977a6dfae71a45c318305166d044b50320d /src/command.cpp
parentd3e691c9200b7b782c8acf17468068a699588a73 (diff)
downloadwanda-ed419140280553b070943b7ba539120a26ff5686.tar.xz
wanda-ed419140280553b070943b7ba539120a26ff5686.zip
wanda: restructure directory hierarchy
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/command.cpp b/src/command.cpp
deleted file mode 100644
index 76cdee7..0000000
--- a/src/command.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "command.hpp"
-
-namespace wanda
-{
- std::optional<message> command::message() const
- {
- using namespace std::string_literals;
- auto const command = [this] {
- switch (id)
- {
- case command_id::change:
- return "CHANGE"s;
- default:
- return ""s;
- }
- }();
-
- auto argument_string = std::string{};
- for (int index = 0ul; index < arguments.size(); ++index)
- {
- argument_string += (index) ? "," + arguments[index] : arguments[index];
- }
-
- if (command.empty())
- {
- return std::nullopt;
- }
-
- return wanda::message{"C", command, argument_string};
- }
-
- std::optional<command> make_command(message message)
- {
- if (message.command == "CHANGE")
- {
- return {{command_id::change}};
- }
-
- return std::nullopt;
- }
-
- command make_change_command()
- {
- return {command_id::change};
- }
-
-} // namespace wanda \ No newline at end of file