本文整理汇总了C++中CString::AsUpper方法的典型用法代码示例。如果您正苦于以下问题:C++ CString::AsUpper方法的具体用法?C++ CString::AsUpper怎么用?C++ CString::AsUpper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CString
的用法示例。
在下文中一共展示了CString::AsUpper方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleMessage
void HandleMessage(CNick& Nick, const CString& sMessage) {
CString sNickServName = (!GetNV("NickServName").empty())
? GetNV("NickServName")
: "NickServ";
if (!GetNV("Password").empty() && Nick.NickEquals(sNickServName) &&
(sMessage.find("msg") != CString::npos ||
sMessage.find("authenticate") != CString::npos ||
sMessage.find("choose a different nickname") != CString::npos ||
sMessage.find("please choose a different nick") != CString::npos ||
sMessage.find("If this is your nick, identify yourself with") !=
CString::npos ||
sMessage.find("If this is your nick, type") != CString::npos ||
sMessage.find("This is a registered nickname, please identify") !=
CString::npos ||
sMessage.StripControls_n().find(
"type /NickServ IDENTIFY password") != CString::npos ||
sMessage.StripControls_n().find(
"type /msg NickServ IDENTIFY password") != CString::npos) &&
sMessage.AsUpper().find("IDENTIFY") != CString::npos &&
sMessage.find("help") == CString::npos) {
MCString msValues;
msValues["password"] = GetNV("Password");
PutIRC(CString::NamedFormat(GetNV("IdentifyCmd"), msValues));
}
}
示例2: IsCtcpNotifier
bool IsCtcpNotifier(const CString& sCtcp) {
// Return true if we want all ctcps notified to us, or if "ctcp_"+sCtcp exists.
// CTCP ACTIONs are the only CTCP query we choose to ignore all the time.
if (sCtcp.Equals("ACTION"))
return false;
return !GetNV("ctcp_showall").empty() || !GetNV("ctcp_" + sCtcp.AsUpper()).empty();
}
示例3: AddCTCPReply
bool CUser::AddCTCPReply(const CString& sCTCP, const CString& sReply) {
if (sCTCP.empty()) {
return false;
}
m_mssCTCPReplies[sCTCP.AsUpper()] = sReply;
return true;
}
示例4: GetISupport
CString CIRCSock::GetISupport(const CString& sKey, const CString& sDefault) const {
MCString::const_iterator i = m_mISupport.find(sKey.AsUpper());
if (i == m_mISupport.end()) {
return sDefault;
} else {
return i->second;
}
}
示例5: HandleMessage
void HandleMessage(CNick& Nick, const CString& sMessage)
{
if (!m_sPass.empty()
&& Nick.GetNick().Equals("NickServ")
&& (sMessage.find("msg") != CString::npos
|| sMessage.find("authenticate") != CString::npos)
&& sMessage.AsUpper().find("IDENTIFY") != CString::npos
&& sMessage.find("help") == CString::npos) {
PutIRC("PRIVMSG NickServ :IDENTIFY " + m_sPass);
}
}
示例6: AddCTCPReply
bool CUser::AddCTCPReply(const CString& sCTCP, const CString& sReply) {
// Reject CTCP requests containing spaces
if (sCTCP.find_first_of(' ') != CString::npos) {
return false;
}
// Reject empty CTCP requests
if (sCTCP.empty()) {
return false;
}
m_mssCTCPReplies[sCTCP.AsUpper()] = sReply;
return true;
}
示例7: HandleMessage
void HandleMessage(CNick& Nick, const CString& sMessage) {
CString sNickServName = (!GetNV("NickServName").empty()) ? GetNV("NickServName") : "NickServ";
if (!GetNV("Password").empty()
&& Nick.GetNick().Equals(sNickServName)
&& (sMessage.find("msg") != CString::npos
|| sMessage.find("authenticate") != CString::npos
|| sMessage.find("choose a different nickname") != CString::npos
|| sMessage.find("If this is your nick, type") != CString::npos
|| sMessage.find("type /NickServ IDENTIFY password") != CString::npos)
&& sMessage.AsUpper().find("IDENTIFY") != CString::npos
&& sMessage.find("help") == CString::npos) {
MCString msValues;
msValues["password"] = GetNV("Password");
PutIRC(CString::NamedFormat(GetNV("IdentifyCmd"), msValues));
}
}
示例8: OnModCommand
void OnModCommand(const CString& sCommand) {
CString sCmd = sCommand.AsUpper();
if (sCmd == "ENABLE") {
Enable();
PutModule("Trying to get your primary nick");
} else if (sCmd == "DISABLE") {
Disable();
PutModule("No longer trying to get your primary nick");
} else if (sCmd == "STATE") {
if (m_pTimer)
PutModule("Currently trying to get your primary nick");
else
PutModule("Currently disabled, try 'enable'");
} else {
PutModule("Commands: Enable, Disable, State");
}
}
示例9: CS
TEST(StringTest, Case) {
CString x = CS("xx");
CString X = CS("XX");
EXPECT_EQ(X, x.AsUpper());
EXPECT_EQ(x, X.AsLower());
}
示例10: DelCTCPReply
bool CUser::DelCTCPReply(const CString& sCTCP) {
return m_mssCTCPReplies.erase(sCTCP.AsUpper()) > 0;
}
示例11: UserCommand
//.........这里部分代码省略.........
CZNC::Get().SetMotd(sMessage);
PutStatus("MOTD set to [" + sMessage + "]");
}
} else if (m_pUser->IsAdmin() && sCommand.Equals("AddMOTD")) {
CString sMessage = sLine.Token(1, true);
if (sMessage.empty()) {
PutStatus("Usage: AddMOTD <Message>");
} else {
CZNC::Get().AddMotd(sMessage);
PutStatus("Added [" + sMessage + "] to MOTD");
}
} else if (m_pUser->IsAdmin() && sCommand.Equals("ClearMOTD")) {
CZNC::Get().ClearMotd();
PutStatus("Cleared MOTD");
} else if (m_pUser->IsAdmin() && sCommand.Equals("BROADCAST")) {
CZNC::Get().Broadcast(sLine.Token(1, true));
} else if (m_pUser->IsAdmin() && (sCommand.Equals("SHUTDOWN") || sCommand.Equals("RESTART"))) {
bool bRestart = sCommand.Equals("RESTART");
CString sMessage = sLine.Token(1, true);
bool bForce = false;
if (sMessage.Token(0).Equals("FORCE")) {
bForce = true;
sMessage = sMessage.Token(1, true);
}
if (sMessage.empty()) {
sMessage = (bRestart ? "ZNC is being restarted NOW!" : "ZNC is being shut down NOW!");
}
if(!CZNC::Get().WriteConfig() && !bForce) {
PutStatus("ERROR: Writing config file to disk failed! Aborting. Use " +
sCommand.AsUpper() + " FORCE to ignore.");
} else {
CZNC::Get().Broadcast(sMessage);
throw CException(bRestart ? CException::EX_Restart : CException::EX_Shutdown);
}
} else if (sCommand.Equals("JUMP") || sCommand.Equals("CONNECT")) {
if (!m_pNetwork) {
PutStatus("You must be connected with a network to use this command");
return;
}
if (!m_pNetwork->HasServers()) {
PutStatus("You don't have any servers added.");
return;
}
CString sArgs = sLine.Token(1, true);
CServer *pServer = NULL;
if (!sArgs.empty()) {
pServer = m_pNetwork->FindServer(sArgs);
if (!pServer) {
PutStatus("Server [" + sArgs + "] not found");
return;
}
m_pNetwork->SetNextServer(pServer);
// If we are already connecting to some server,
// we have to abort that attempt
Csock *pIRCSock = GetIRCSock();
if (pIRCSock && !pIRCSock->IsConnected()) {
pIRCSock->Close();
}