aboutsummaryrefslogtreecommitdiffstats
path: root/src/hashcomp.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-13 22:49:48 +0000
committerGravatar Sadie Powell2026-03-14 02:16:20 +0000
commita04212eee0716a01f5f75589d12f7578f6695270 (patch)
treeb8f6820ad17d53eea8956b547f4c96954022c59b /src/hashcomp.cpp
parentClean up the casemapping checking and comparison code. (diff)
Rewrite tokenstream and move to stringutils.
Diffstat (limited to 'src/hashcomp.cpp')
-rw-r--r--src/hashcomp.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index f65194436..61ee25a14 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -26,55 +26,6 @@
#include "inspircd.h"
-irc::tokenstream::tokenstream(const std::string& msg, size_t start, size_t end)
- : message(msg, start, end)
-{
-}
-
-bool irc::tokenstream::GetMiddle(std::string& token)
-{
- // If we are past the end of the string we can't do anything.
- if (position >= message.length())
- {
- token.clear();
- return false;
- }
-
- // If we can't find another separator this is the last token in the message.
- size_t separator = message.find(' ', position);
- if (separator == std::string::npos)
- {
- token.assign(message, position, std::string::npos);
- position = message.length();
- return true;
- }
-
- token.assign(message, position, separator - position);
- position = message.find_first_not_of(' ', separator);
- return true;
-}
-
-bool irc::tokenstream::GetTrailing(std::string& token)
-{
- // If we are past the end of the string we can't do anything.
- if (position >= message.length())
- {
- token.clear();
- return false;
- }
-
- // If this is true then we have a <trailing> token!
- if (message[position] == ':')
- {
- token.assign(message, position + 1, std::string::npos);
- position = message.length();
- return true;
- }
-
- // There is no <trailing> token so it must be a <middle> token.
- return GetMiddle(token);
-}
-
irc::sepstream::sepstream(const std::string& source, char separator, bool allowempty)
: tokens(source)
, sep(separator)