diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2018-11-30 15:53:53 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2018-11-30 15:53:53 +0100 |
| commit | 9c2231c8fb45f32c7b1d23e14125bc58ea405e60 (patch) | |
| tree | 907b72521a0c8bf03c99432817be11ddc12eef3a /src/message.hpp | |
| parent | 106eb9578179b04dbe9278e3197391db168e6ebb (diff) | |
| download | wanda-9c2231c8fb45f32c7b1d23e14125bc58ea405e60.tar.xz wanda-9c2231c8fb45f32c7b1d23e14125bc58ea405e60.zip | |
core: implement basic message type
Diffstat (limited to 'src/message.hpp')
| -rw-r--r-- | src/message.hpp | 28 |
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 |
