#ifndef COMMAND_PARSE_H
#define COMMAND_PARSE_H
-/** A list of dll/so files containing the command handlers for the core
- */
-typedef std::map<std::string, void*> SharedObjectList;
-
/** This class handles command management and parsing.
* It allows you to add and remove commands from the map,
* call command handlers by name, and chop up comma seperated
class CoreExport CommandParser
{
private:
- /** Parameter buffer
- */
- std::vector<std::string> para;
-
/** Process a parameter string into a list of items
* @param command_p The output list of items
* @param parameters The input string
*/
bool ProcessCommand(LocalUser *user, std::string &cmd);
-
-
public:
/** Command list, a hash_map of command names to Command*
*/
* and numerical comparisons in preprocessor macros if they wish to support
* multiple versions of InspIRCd in one file.
*/
-#define INSPIRCD_VERSION_API 5
+#define INSPIRCD_VERSION_API 6
/**
* This #define allows us to call a method in all
char tb[MAXBUF];
snprintf(tb,MAXBUF,":%s %s", serversource ? ServerInstance->Config->ServerName.c_str() : user->GetFullHost().c_str(), text.c_str());
- std::string out = tb;
this->RawWriteAllExcept(user, serversource, status, except_list, std::string(tb));
}
CommandParser::CommandParser()
{
- para.resize(128);
}
int CommandParser::TranslateUIDs(const std::vector<TranslateType> to, const std::vector<std::string> &source, std::string &dest, bool prefix_final, Command* custom_translator)
int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, std::string &dest)
{
User* user = NULL;
- std::string item;
int translations = 0;
dest.clear();
}
- int DoAlias(User *user, Channel *c, Alias *a, const std::string compare, const std::string safe)
+ int DoAlias(User *user, Channel *c, Alias *a, const std::string& compare, const std::string& safe)
{
User *u = NULL;
bool flag_notice;
bool flag_strip_color;
- FilterResult(const std::string free, const std::string &rea, FilterAction act, long gt, const std::string &fla) :
+ FilterResult(const std::string& free, const std::string& rea, FilterAction act, long gt, const std::string& fla) :
freeform(free), reason(rea), action(act), gline_time(gt)
{
this->FillFlags(fla);
}
}
- if (!dl->size())
+ if (dl->empty())
kr.ext.unset(chan);
}
}
return MODEACTION_ALLOW;
else
{
- if (source && channel)
+ if (channel)
source->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Only servers are permitted to change channel mode '%c'", source->nick.c_str(), channel->name.c_str(), 'y');
return MODEACTION_DENY;
}
void TreeSocket::SendUsers()
{
char data[MAXBUF];
- std::string dataline;
for (user_hash::iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++)
{
if (u->second->registered == REG_ALL)
hostname.append("@").append(user->host);
- if (OneOfMatches(hostname.c_str(), user->GetIPString(), pattern.c_str()))
+ if (OneOfMatches(hostname.c_str(), user->GetIPString(), pattern))
{
/* Opertype and host match, looks like this is it. */
if (limit.mask.size() && limit.limit > 0)
chanlimits.push_back(limit);
}
- if (chanlimits.size() == 0)
+ if (chanlimits.empty())
{
ListLimit limit;
limit.mask = "*";
if (parameter == it->mask)
{
el->erase(it);
- if (el->size() == 0)
+ if (el->empty())
{
extItem.unset(channel);
}