inline std::ostream& con_green(std::ostream &s)
{
- SetConsoleTextAttribute(g_hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
- return s;
+ SetConsoleTextAttribute(g_hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
+ return s;
}
inline std::ostream& con_red(std::ostream &s)
{
- SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY|g_wBackgroundColor);
- return s;
+ SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY|g_wBackgroundColor);
+ return s;
}
inline std::ostream& con_white(std::ostream &s)
{
- SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|g_wBackgroundColor);
- return s;
+ SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|g_wBackgroundColor);
+ return s;
}
inline std::ostream& con_white_bright(std::ostream &s)
{
- SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
- return s;
+ SetConsoleTextAttribute(g_hStdout, FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY|g_wBackgroundColor);
+ return s;
}
inline std::ostream& con_bright(std::ostream &s)
{
- SetConsoleTextAttribute(g_hStdout, FOREGROUND_INTENSITY|g_wBackgroundColor);
- return s;
+ SetConsoleTextAttribute(g_hStdout, FOREGROUND_INTENSITY|g_wBackgroundColor);
+ return s;
}
inline std::ostream& con_reset(std::ostream &s)
{
- SetConsoleTextAttribute(g_hStdout, g_wOriginalColors);
- return s;
+ SetConsoleTextAttribute(g_hStdout, g_wOriginalColors);
+ return s;
}
#else
inline std::ostream& con_green(std::ostream &s)
{
- return s << "\033[1;32m";
+ return s << "\033[1;32m";
}
inline std::ostream& con_red(std::ostream &s)
{
- return s << "\033[1;31m";
+ return s << "\033[1;31m";
}
inline std::ostream& con_white(std::ostream &s)
{
- return s << "\033[0m";
+ return s << "\033[0m";
}
inline std::ostream& con_white_bright(std::ostream &s)
{
- return s << "\033[1m";
+ return s << "\033[1m";
}
inline std::ostream& con_bright(std::ostream &s)
{
- return s << "\033[1m";
+ return s << "\033[1m";
}
inline std::ostream& con_reset(std::ostream &s)
{
- return s << "\033[0m";
+ return s << "\033[0m";
}
#endif
class CoreExport ExtensionItem : public ServiceProvider, public usecountbase
{
public:
- /** Extensible subclasses
- */
+ /** Extensible subclasses
+ */
enum ExtensibleType
{
EXT_USER,
template<typename T> const T& SearchAndReplace(T& text, const T& pattern, const T& replace)
{
- T replacement;
- if ((!pattern.empty()) && (!text.empty()))
- {
- for (std::string::size_type n = 0; n != text.length(); ++n)
- {
- 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;
- }
- else
- {
- replacement += text[n];
- }
- }
- }
- text = replacement;
- return text;
+ T replacement;
+ if ((!pattern.empty()) && (!text.empty()))
+ {
+ for (std::string::size_type n = 0; n != text.length(); ++n)
+ {
+ 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;
+ }
+ else
+ {
+ replacement += text[n];
+ }
+ }
+ }
+ text = replacement;
+ return text;
}
/** The irc namespace contains a number of helper classes.
const ModeHandlerMap& GetModes(ModeType mt) const { return modehandlersbyname[mt]; }
/** Show the list of a list mode to a user. Modules can deny the listing.
- * @param user User to show the list to.
- * @param chan Channel to show the list of.
- * @param mh List mode to show the list of.
- */
+ * @param user User to show the list to.
+ * @param chan Channel to show the list of.
+ * @param mh List mode to show the list of.
+ */
void ShowListModeList(User* user, Channel* chan, ModeHandler* mh);
};
ConfigTag *tag = (*it)->config;
// Make sure our connection class allows motd colors
if(!tag->getBool("allowmotdcolors"))
- continue;
+ continue;
ConfigFileCache::iterator file = this->Files.find(tag->getString("motd", "motd"));
if (file != this->Files.end())
- InspIRCd::ProcessColors(file->second);
+ InspIRCd::ProcessColors(file->second);
}
/* No old configuration -> initial boot, nothing more to do here */
if (user)
user->WriteNumeric(ERR_CANTUNLOADMODULE, "%s :Failed to unload module %s: %s", modname.c_str(), modname.c_str(), ServerInstance->Modules->LastError().c_str());
else
- ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
+ ServerInstance->SNO->WriteGlobalSno('a', "Failed to unload module %s: %s", modname.c_str(), ServerInstance->Modules->LastError().c_str());
}
}
*/
CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User *user)
{
- std::string target = parameters[0];
+ std::string target = parameters[0];
if (parameters.size() >= 3)
{
else
ih = ServerInstance->XLines->IdentSplit(target);
- if (ih.first.empty())
- {
- user->WriteNotice("*** Target not found");
- return CMD_FAILURE;
- }
+ if (ih.first.empty())
+ {
+ user->WriteNotice("*** Target not found");
+ return CMD_FAILURE;
+ }
InsaneBan::IPHostMatcher matcher;
if (InsaneBan::MatchesEveryone(ih.first+"@"+ih.second, matcher, user, "K", "hostmasks"))
/* We cant use a map, there may be multiple aliases with the same name.
* We can, however, use a fancy invention: the multimap. Maps a key to one or more values.
* -- w00t
- */
+ */
typedef insp::flat_multimap<std::string, Alias, irc::insensitive_swo> AliasMap;
AliasMap Aliases;
cap->set(user, false);
}
- ServerInstance->Modules.DelReferent(cap);
+ ServerInstance->Modules.DelReferent(cap);
cap->Unregister();
caps.erase(cap->GetName());
}
{
mx[1][0] = i + 1;
for (unsigned int j = 0; j < l2; j++)
- mx[1][j + 1] = std::min(std::min(mx[1][j] + 1, mx[0][j + 1] + 1), mx[0][j] + ((s1[i] == s2[j]) ? 0 : 1));
+ mx[1][j + 1] = std::min(std::min(mx[1][j] + 1, mx[0][j + 1] + 1), mx[0][j] + ((s1[i] == s2[j]) ? 0 : 1));
mx[0].swap(mx[1]);
}