aboutsummaryrefslogtreecommitdiff
path: root/src/message.hpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2018-11-30 15:53:53 +0100
committerFelix Morgner <felix.morgner@gmail.com>2018-11-30 15:53:53 +0100
commit9c2231c8fb45f32c7b1d23e14125bc58ea405e60 (patch)
tree907b72521a0c8bf03c99432817be11ddc12eef3a /src/message.hpp
parent106eb9578179b04dbe9278e3197391db168e6ebb (diff)
downloadwanda-9c2231c8fb45f32c7b1d23e14125bc58ea405e60.tar.xz
wanda-9c2231c8fb45f32c7b1d23e14125bc58ea405e60.zip
core: implement basic message type
Diffstat (limited to 'src/message.hpp')
-rw-r--r--src/message.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/message.hpp b/src/message.hpp
new file mode 100644
index 0000000..f34d19c
--- /dev/null
+++ b/src/message.hpp
@@ -0,0 +1,28 @@
+#ifndef WANDA_MESSAGE_HPP
+#define WANDA_MESSAGE_HPP
+
+#include <cstddef>
+#include <istream>
+#include <string>
+#include <optional>
+
+namespace wanda
+{
+
+struct message
+{
+ explicit operator std::string() const;
+
+ std::size_t size() const;
+
+ std::string source;
+ std::string command;
+ std::optional<std::string> argument;
+};
+
+std::istream & operator>>(std::istream & in, message & message);
+std::ostream & operator<<(std::ostream & out, message const & message);
+
+} // namespace wanda
+
+#endif \ No newline at end of file