本文整理汇总了C++中CChan::WriteConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::WriteConfig方法的具体用法?C++ CChan::WriteConfig怎么用?C++ CChan::WriteConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::WriteConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteConfig
bool CUser::WriteConfig(CFile& File) {
File.Write("<User " + GetUserName().FirstLine() + ">\n");
if (m_eHashType != HASH_NONE) {
CString sHash = "md5";
if (m_eHashType == HASH_SHA256)
sHash = "sha256";
if (m_sPassSalt.empty()) {
PrintLine(File, "Pass", sHash + "#" + GetPass());
} else {
PrintLine(File, "Pass", sHash + "#" + GetPass() + "#" + m_sPassSalt + "#");
}
} else {
PrintLine(File, "Pass", "plain#" + GetPass());
}
PrintLine(File, "Nick", GetNick());
PrintLine(File, "AltNick", GetAltNick());
PrintLine(File, "Ident", GetIdent());
PrintLine(File, "RealName", GetRealName());
PrintLine(File, "BindHost", GetBindHost());
PrintLine(File, "DCCBindHost", GetDCCBindHost());
PrintLine(File, "QuitMsg", GetQuitMsg());
if (CZNC::Get().GetStatusPrefix() != GetStatusPrefix())
PrintLine(File, "StatusPrefix", GetStatusPrefix());
PrintLine(File, "Skin", GetSkinName());
PrintLine(File, "ChanModes", GetDefaultChanModes());
PrintLine(File, "Buffer", CString(GetBufferCount()));
PrintLine(File, "KeepBuffer", CString(KeepBuffer()));
PrintLine(File, "MultiClients", CString(MultiClients()));
PrintLine(File, "BounceDCCs", CString(BounceDCCs()));
PrintLine(File, "DenyLoadMod", CString(DenyLoadMod()));
PrintLine(File, "Admin", CString(IsAdmin()));
PrintLine(File, "DenySetBindHost", CString(DenySetBindHost()));
PrintLine(File, "DCCLookupMethod", CString((UseClientIP()) ? "client" : "default"));
PrintLine(File, "TimestampFormat", GetTimestampFormat());
PrintLine(File, "AppendTimestamp", CString(GetTimestampAppend()));
PrintLine(File, "PrependTimestamp", CString(GetTimestampPrepend()));
PrintLine(File, "TimezoneOffset", CString(m_fTimezoneOffset));
PrintLine(File, "JoinTries", CString(m_uMaxJoinTries));
PrintLine(File, "MaxJoins", CString(m_uMaxJoins));
PrintLine(File, "IRCConnectEnabled", CString(GetIRCConnectEnabled()));
File.Write("\n");
// Allow Hosts
if (!m_ssAllowedHosts.empty()) {
for (set<CString>::iterator it = m_ssAllowedHosts.begin(); it != m_ssAllowedHosts.end(); ++it) {
PrintLine(File, "Allow", *it);
}
File.Write("\n");
}
// CTCP Replies
if (!m_mssCTCPReplies.empty()) {
for (MCString::const_iterator itb = m_mssCTCPReplies.begin(); itb != m_mssCTCPReplies.end(); ++itb) {
PrintLine(File, "CTCPReply", itb->first.AsUpper() + " " + itb->second);
}
File.Write("\n");
}
// Modules
CModules& Mods = GetModules();
if (!Mods.empty()) {
for (unsigned int a = 0; a < Mods.size(); a++) {
CString sArgs = Mods[a]->GetArgs();
if (!sArgs.empty()) {
sArgs = " " + sArgs;
}
PrintLine(File, "LoadModule", Mods[a]->GetModName() + sArgs);
}
File.Write("\n");
}
// Servers
for (unsigned int b = 0; b < m_vServers.size(); b++) {
PrintLine(File, "Server", m_vServers[b]->GetString());
}
// Chans
for (unsigned int c = 0; c < m_vChans.size(); c++) {
CChan* pChan = m_vChans[c];
if (pChan->InConfig()) {
File.Write("\n");
if (!pChan->WriteConfig(File)) {
return false;
}
}
}
File.Write("</User>\n");
return true;
}