summaryrefslogtreecommitdiff
path: root/src/libirc/irc_message.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-11-03 00:22:32 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-11-03 00:22:32 +0100
commit87aaacdb420341bf3619922332d58b95249971bc (patch)
tree8f819241c8e78b23f5e2036c22ac637092e4293c /src/libirc/irc_message.cpp
parente332d7a2c0900aec488ab508c3e9e389d2a71e32 (diff)
downloadbiboumi-87aaacdb420341bf3619922332d58b95249971bc.tar.gz
biboumi-87aaacdb420341bf3619922332d58b95249971bc.tar.bz2
biboumi-87aaacdb420341bf3619922332d58b95249971bc.tar.xz
biboumi-87aaacdb420341bf3619922332d58b95249971bc.zip
Rename libirc and libxmpp to irc and xmpp
Diffstat (limited to 'src/libirc/irc_message.cpp')
-rw-r--r--src/libirc/irc_message.cpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/libirc/irc_message.cpp b/src/libirc/irc_message.cpp
deleted file mode 100644
index fc691b4..0000000
--- a/src/libirc/irc_message.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <libirc/irc_message.hpp>
-#include <iostream>
-
-IrcMessage::IrcMessage(std::string&& line)
-{
- std::string::size_type pos;
-
- // optional prefix
- if (line[0] == ':')
- {
- pos = line.find(" ");
- this->prefix = line.substr(1, pos);
- line = line.substr(pos + 1, std::string::npos);
- }
- // command
- pos = line.find(" ");
- this->command = line.substr(0, pos);
- line = line.substr(pos + 1, std::string::npos);
- // arguments
- do
- {
- if (line[0] == ':')
- {
- this->arguments.emplace_back(line.substr(1, std::string::npos));
- break ;
- }
- pos = line.find(" ");
- this->arguments.emplace_back(line.substr(0, pos));
- line = line.substr(pos + 1, std::string::npos);
- } while (pos != std::string::npos);
-}
-
-IrcMessage::IrcMessage(std::string&& prefix,
- std::string&& command,
- std::vector<std::string>&& args):
- prefix(std::move(prefix)),
- command(std::move(command)),
- arguments(std::move(args))
-{
-}
-
-IrcMessage::IrcMessage(std::string&& command,
- std::vector<std::string>&& args):
- prefix(),
- command(std::move(command)),
- arguments(std::move(args))
-{
-}
-
-IrcMessage::~IrcMessage()
-{
-}
-
-std::ostream& operator<<(std::ostream& os, const IrcMessage& message)
-{
- os << "IrcMessage";
- os << "[" << message.command << "]";
- for (const std::string& arg: message.arguments)
- {
- os << "{" << arg << "}";
- }
- if (!message.prefix.empty())
- os << "(from: " << message.prefix << ")";
- return os;
-}