本文整理汇总了C++中CChan::SetBufferCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::SetBufferCount方法的具体用法?C++ CChan::SetBufferCount怎么用?C++ CChan::SetBufferCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::SetBufferCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetChan
void SetChan(const CString& sLine) {
const CString var = sLine.Token(1).AsLower();
CString username = sLine.Token(2);
CString chan = sLine.Token(3);
CString value = sLine.Token(4, true);
if (value.empty()) {
PutModule("Usage: setchan <variable> <username> <chan> <value>");
return;
}
CUser* user = GetUser(username);
if (!user)
return;
CChan* pChan = user->FindChan(chan);
if (!pChan) {
PutModule("Error: Channel not found: " + chan);
return;
}
if (var == "defmodes") {
pChan->SetDefaultModes(value);
PutModule("DefModes = " + value);
} else if (var == "buffer") {
unsigned int i = value.ToUInt();
pChan->SetBufferCount(i);
PutModule("Buffer = " + CString(i));
} else if (var == "inconfig") {
bool b = value.ToBool();
pChan->SetInConfig(b);
PutModule("InConfig = " + CString(b));
} else if (var == "keepbuffer") {
bool b = value.ToBool();
pChan->SetKeepBuffer(b);
PutModule("KeepBuffer = " + CString(b));
} else if (var == "detached") {
bool b = value.ToBool();
if (pChan->IsDetached() != b) {
if (b)
pChan->DetachUser();
else
pChan->AttachUser();
}
PutModule("Detached = " + CString(b));
} else
PutModule("Error: Unknown variable");
}