diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2018-12-08 10:43:50 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2018-12-08 10:43:50 +0100 |
| commit | 0c1d1a0f24655c22a373c19aac90a6a225a353e6 (patch) | |
| tree | e65fe3c5f8b80bb59910c81c700eb3ed545848bb /src/command.cpp | |
| parent | f22d1b76c9a957a679b57ddcb67b33cc73a15de1 (diff) | |
| download | wanda-0c1d1a0f24655c22a373c19aac90a6a225a353e6.tar.xz wanda-0c1d1a0f24655c22a373c19aac90a6a225a353e6.zip | |
wanda: reformat source code
Diffstat (limited to 'src/command.cpp')
| -rw-r--r-- | src/command.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/command.cpp b/src/command.cpp index 6831d5e..76cdee7 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -2,47 +2,46 @@ namespace wanda { - -std::optional<message> command::message() const -{ + std::optional<message> command::message() const + { using namespace std::string_literals; auto const command = [this] { - switch (id) - { + switch (id) + { case command_id::change: - return "CHANGE"s; + return "CHANGE"s; default: - return ""s; - } + return ""s; + } }(); auto argument_string = std::string{}; for (int index = 0ul; index < arguments.size(); ++index) { - argument_string += (index) ? "," + arguments[index] : arguments[index]; + argument_string += (index) ? "," + arguments[index] : arguments[index]; } if (command.empty()) { - return std::nullopt; + return std::nullopt; } return wanda::message{"C", command, argument_string}; -} + } -std::optional<command> make_command(message message) -{ - if(message.command == "CHANGE") + std::optional<command> make_command(message message) + { + if (message.command == "CHANGE") { - return {{command_id::change}}; + return {{command_id::change}}; } return std::nullopt; -} + } -command make_change_command() -{ + command make_change_command() + { return {command_id::change}; -} + } -} // namespace wanda
\ No newline at end of file +} // namespace wanda
\ No newline at end of file |
