return t;
}
-irc::tokenstream::tokenstream(const std::string& msg, size_t start)
- : message(msg, start)
+irc::tokenstream::tokenstream(const std::string& msg, size_t start, size_t end)
+ : message(msg, start, end)
, position(0)
{
}
size_t separator = message.find(' ', position);
if (separator == std::string::npos)
{
- token.assign(message, position);
+ token.assign(message, position, std::string::npos);
position = message.length();
return true;
}
// If this is true then we have a <trailing> token!
if (message[position] == ':')
{
- token.assign(message, position + 1);
+ token.assign(message, position + 1, std::string::npos);
position = message.length();
- ServerInstance->Logs->Log("HASHCOMP", LOG_DEBUG, "TRAILING %s next (none)", token.c_str());
return true;
}
return this->pos > this->tokens.length();
}
+bool irc::sepstream::Contains(const std::string& value)
+{
+ std::string token;
+ while (GetToken(token))
+ if (value == token)
+ return true;
+
+ return false;
+}
+
irc::portparser::portparser(const std::string &source, bool allow_overlapped)
: sep(source), in_range(0), range_begin(0), range_end(0), overlapped(allow_overlapped)
{