本文整理汇总了C++中CIRCSock::GetPerms方法的典型用法代码示例。如果您正苦于以下问题:C++ CIRCSock::GetPerms方法的具体用法?C++ CIRCSock::GetPerms怎么用?C++ CIRCSock::GetPerms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIRCSock
的用法示例。
在下文中一共展示了CIRCSock::GetPerms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPermChar
unsigned char CNick::GetPermChar() const {
CIRCSock* pIRCSock = (!m_pNetwork) ? NULL : m_pNetwork->GetIRCSock();
const CString& sChanPerms = (!pIRCSock) ? "@+" : pIRCSock->GetPerms();
for (unsigned int a = 0; a < sChanPerms.size(); a++) {
const unsigned char& c = sChanPerms[a];
if (HasPerm(c)) {
return c;
}
}
return '\0';
}
示例2: GetPermStr
CString CNick::GetPermStr() const {
CIRCSock* pIRCSock = (!m_pUser) ? NULL : m_pUser->GetIRCSock();
const CString& sChanPerms = (!pIRCSock) ? "@+" : pIRCSock->GetPerms();
CString sRet;
for (unsigned int a = 0; a < sChanPerms.size(); a++) {
const unsigned char& c = sChanPerms[a];
if (HasPerm(c)) {
sRet += c;
}
}
return sRet;
}
示例3: UserCommand
void CClient::UserCommand(CString& sLine) {
if (!m_pUser) {
return;
}
if (sLine.empty()) {
return;
}
NETWORKMODULECALL(OnStatusCommand(sLine), m_pUser, m_pNetwork, this, return);
const CString sCommand = sLine.Token(0);
if (sCommand.Equals("HELP")) {
HelpUser();
} else if (sCommand.Equals("LISTNICKS")) {
if (!m_pNetwork) {
PutStatus("You must be connected with a network to use this command");
return;
}
CString sChan = sLine.Token(1);
if (sChan.empty()) {
PutStatus("Usage: ListNicks <#chan>");
return;
}
CChan* pChan = m_pNetwork->FindChan(sChan);
if (!pChan) {
PutStatus("You are not on [" + sChan + "]");
return;
}
if (!pChan->IsOn()) {
PutStatus("You are not on [" + sChan + "] [trying]");
return;
}
const map<CString,CNick>& msNicks = pChan->GetNicks();
CIRCSock* pIRCSock = m_pNetwork->GetIRCSock();
const CString& sPerms = (pIRCSock) ? pIRCSock->GetPerms() : "";
if (!msNicks.size()) {
PutStatus("No nicks on [" + sChan + "]");
return;
}
CTable Table;
for (unsigned int p = 0; p < sPerms.size(); p++) {
CString sPerm;
sPerm += sPerms[p];
Table.AddColumn(sPerm);
}
Table.AddColumn("Nick");
Table.AddColumn("Ident");
Table.AddColumn("Host");
for (map<CString,CNick>::const_iterator a = msNicks.begin(); a != msNicks.end(); ++a) {
Table.AddRow();
for (unsigned int b = 0; b < sPerms.size(); b++) {
if (a->second.HasPerm(sPerms[b])) {
CString sPerm;
sPerm += sPerms[b];
Table.SetCell(sPerm, sPerm);
}
}
Table.SetCell("Nick", a->second.GetNick());
Table.SetCell("Ident", a->second.GetIdent());
Table.SetCell("Host", a->second.GetHost());
}
PutStatus(Table);
} else if (sCommand.Equals("DETACH")) {
if (!m_pNetwork) {
PutStatus("You must be connected with a network to use this command");
return;
}
CString sChan = sLine.Token(1);
if (sChan.empty()) {
PutStatus("Usage: Detach <#chan>");
return;
}
const vector<CChan*>& vChans = m_pNetwork->GetChans();
vector<CChan*>::const_iterator it;
unsigned int uMatches = 0, uDetached = 0;
for (it = vChans.begin(); it != vChans.end(); ++it) {
if (!(*it)->GetName().WildCmp(sChan))
continue;
uMatches++;
if ((*it)->IsDetached())
//.........这里部分代码省略.........