* +------------------------------------+
*
* InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
}
}
-#ifndef WIN32
+#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
+ size_t nspace::hash_compare<std::string, std::less<std::string> >::operator()(const std::string &s) const
+#else
#ifdef HASHMAP_DEPRECATED
- size_t nspace::insensitive::operator()(const std::string &s) const
+ size_t CoreExport nspace::insensitive::operator()(const std::string &s) const
#else
size_t nspace::hash<std::string>::operator()(const std::string &s) const
#endif
-#else
- size_t nspace::hash_compare<std::string, std::less<std::string> >::operator()(const std::string &s) const
#endif
{
/* XXX: NO DATA COPIES! :)
}
-#ifndef WIN32
-size_t nspace::hash<irc::string>::operator()(const irc::string &s) const
+#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
+ size_t nspace::hash_compare<irc::string, std::less<irc::string> >::operator()(const irc::string &s) const
#else
-size_t nspace::hash_compare<irc::string, std::less<irc::string> >::operator()(const irc::string &s) const
+ size_t CoreExport nspace::hash<irc::string>::operator()(const irc::string &s) const
#endif
{
register size_t t = 0;
{
while(n-- > 0 && national_case_insensitive_map[(unsigned char)*s1] != national_case_insensitive_map[(unsigned char)c])
s1++;
- return s1;
+ return (n >= 0) ? s1 : NULL;
}
irc::tokenstream::tokenstream(const std::string &source) : tokens(source), last_pushed(false)
return "";
/* EWW! This used to be using sprintf, which is WAY inefficient. -Special */
-
+
const char *hex = "0123456789abcdef";
static char hexbuf[MAXBUF];
this->Push('-',"");
}
-int irc::modestacker::GetStackedLine(std::deque<std::string> &result, int max_line_size)
+int irc::modestacker::GetStackedLine(std::vector<std::string> &result, int max_line_size)
{
if (sequence.empty())
{
- result.clear();
return 0;
}
- int n = 0;
+ unsigned int n = 0;
int size = 1; /* Account for initial +/- char */
int nextsize = 0;
- result.clear();
- result.push_back(adding ? "+" : "-");
+ 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) && (result.size() < ServerInstance->Config->Limits.MaxModes) && ((size + nextsize) < max_line_size))
+ while (!sequence[0].empty() && (sequence.size() > 1) && (n < ServerInstance->Config->Limits.MaxModes) && ((size + nextsize) < max_line_size))
{
- result[0] += *(sequence[0].begin());
+ modeline += *(sequence[0].begin());
if (!sequence[1].empty())
{
result.push_back(sequence[1]);
n++;
}
+ result[start] = modeline;
return n;
}
{
while (((Overlaps(in_range)) && (in_range <= range_end)))
in_range++;
-
+
if (in_range <= range_end)
return in_range;
}
}
}
-const std::string& SearchAndReplace(std::string& text, const std::string& pattern, const std::string& replace)
+/*const std::basic_string& SearchAndReplace(std::string& text, const std::string& pattern, const std::string& replace)
{
std::string replacement;
if ((!pattern.empty()) && (!text.empty()))
{
if (text.length() >= pattern.length() && text.substr(n, pattern.length()) == pattern)
{
- /* Found the pattern in the text, replace it, and advance */
replacement.append(replace);
n = n + pattern.length() - 1;
}
}
text = replacement;
return text;
-}
-
+}*/