~singpolyma/biboumi

ref: 6de22e83208f5c6a7aab1458cc7b666eb82703c1 biboumi/src/irc/irc_message.hpp -rw-r--r-- 755 bytes
6de22e83Stephen Paul Weber fix build 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once


#include <vector>
#include <string>
#include <ostream>
#include <sstream>

class IrcMessage
{
public:
  IrcMessage(std::stringstream ss);
  IrcMessage(std::string str): IrcMessage{std::stringstream{str}} {}
  IrcMessage(std::string&& prefix, std::string&& command, std::vector<std::string>&& args);
  IrcMessage(std::string&& command, std::vector<std::string>&& args);
  ~IrcMessage() = default;

  IrcMessage(const IrcMessage&) = delete;
  IrcMessage(IrcMessage&&) = default;
  IrcMessage& operator=(const IrcMessage&) = delete;
  IrcMessage& operator=(IrcMessage&&) = default;

  std::string prefix;
  std::string command;
  std::vector<std::string> arguments;
};

std::ostream& operator<<(std::ostream& os, const IrcMessage& message);