diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-09-03 15:40:19 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-09-03 15:40:19 +0200 |
commit | 87025fd5ac24bb758eec053e2f92382835e8ecd1 (patch) | |
tree | f27ff46757d5410f65d0c3efede55c138f0ec524 /src/hashcomp.cpp | |
parent | 7166c4905a08b590bcf61e9e3d13953f7965f93a (diff) |
Remove irc::modestacker
Diffstat (limited to 'src/hashcomp.cpp')
-rw-r--r-- | src/hashcomp.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 895b500ae..46981e703 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -348,71 +348,6 @@ bool irc::sepstream::StreamEnd() return this->pos > this->tokens.length(); } -irc::modestacker::modestacker(bool add) : adding(add) -{ - sequence.clear(); - sequence.push_back(""); -} - -void irc::modestacker::Push(char modeletter, const std::string ¶meter) -{ - *(sequence.begin()) += modeletter; - sequence.push_back(parameter); -} - -void irc::modestacker::Push(char modeletter) -{ - this->Push(modeletter,""); -} - -void irc::modestacker::PushPlus() -{ - this->Push('+',""); -} - -void irc::modestacker::PushMinus() -{ - this->Push('-',""); -} - -int irc::modestacker::GetStackedLine(std::vector<std::string> &result, int max_line_size) -{ - if (sequence.empty()) - { - return 0; - } - - unsigned int n = 0; - int size = 1; /* Account for initial +/- char */ - int nextsize = 0; - int start = result.size(); - std::string modeline = adding ? "+" : "-"; - result.push_back(modeline); - - if (sequence.size() > 1) - nextsize = sequence[1].length() + 2; - - while (!sequence[0].empty() && (sequence.size() > 1) && (n < ServerInstance->Config->Limits.MaxModes) && ((size + nextsize) < max_line_size)) - { - modeline += *(sequence[0].begin()); - if (!sequence[1].empty()) - { - result.push_back(sequence[1]); - size += nextsize; /* Account for mode character and whitespace */ - } - sequence[0].erase(sequence[0].begin()); - sequence.erase(sequence.begin() + 1); - - if (sequence.size() > 1) - nextsize = sequence[1].length() + 2; - - n++; - } - result[start] = modeline; - - return n; -} - std::string irc::stringjoiner(const std::vector<std::string>& sequence, char separator) { std::string joined; |