本文整理汇总了C++中CModInfo::SetGlobal方法的典型用法代码示例。如果您正苦于以下问题:C++ CModInfo::SetGlobal方法的具体用法?C++ CModInfo::SetGlobal怎么用?C++ CModInfo::SetGlobal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModInfo
的用法示例。
在下文中一共展示了CModInfo::SetGlobal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGetAvailableMods
virtual void OnGetAvailableMods(set<CModInfo>& ssMods, bool bGlobal) {
if (bGlobal) {
return;
}
unsigned int a = 0;
CDir Dir;
CModules::ModDirList dirs = CModules::GetModDirs();
while (!dirs.empty()) {
Dir.FillByWildcard(dirs.front().first, "*.pm");
dirs.pop();
for (a = 0; a < Dir.size(); a++) {
CFile& File = *Dir[a];
CString sName = File.GetShortName();
CString sPath = File.GetLongName();
CModInfo ModInfo;
sName.RightChomp(3);
PSTART;
PUSH_STR(sPath);
PUSH_STR(sName);
PCALL("ZNC::Core::ModInfoByPath");
if (!SvTRUE(ERRSV) && ret == 1) {
ModInfo.SetGlobal(false);
ModInfo.SetDescription(PString(ST(0)));
ModInfo.SetName(sName);
ModInfo.SetPath(sPath);
ssMods.insert(ModInfo);
}
PEND;
}
}
}
示例2: OnGetModInfo
virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg) {
PSTART;
PUSH_STR(sModule);
PCALL("ZNC::Core::GetModInfo");
EModRet result = CONTINUE;
if (SvTRUE(ERRSV)) {
bSuccess = false;
sRetMsg = PString(ERRSV);
} else if (0 < ret) {
switch(static_cast<ELoadPerlMod>(SvUV(ST(0)))) {
case Perl_NotFound:
result = CONTINUE;
break;
case Perl_Loaded:
result = HALT;
if (3 == ret) {
ModInfo.SetGlobal(false);
ModInfo.SetDescription(PString(ST(2)));
ModInfo.SetName(sModule);
ModInfo.SetPath(PString(ST(1)));
bSuccess = true;
} else {
bSuccess = false;
sRetMsg = "Something weird happened";
}
break;
case Perl_LoadError:
result = HALT;
bSuccess = false;
if (2 == ret) {
sRetMsg = PString(ST(1));
} else {
sRetMsg = "Something weird happened";
}
}
} else {
result = HALT;
bSuccess = false;
sRetMsg = "Something weird happened";
}
PEND;
DEBUG(__PRETTY_FUNCTION__ << " " << sRetMsg);
return result;
}
示例3: GetModPathInfo
bool CModules::GetModPathInfo(CModInfo& ModInfo, const CString& sModule, const CString& sModPath, CString& sRetMsg) {
CString sDesc;
bool bVersionMismatch;
bool bIsGlobal;
ModHandle p = OpenModule(sModule, sModPath, bVersionMismatch, bIsGlobal, sDesc, sRetMsg);
if (!p)
return false;
ModInfo.SetGlobal(bIsGlobal);
ModInfo.SetDescription(sDesc);
ModInfo.SetName(sModule);
ModInfo.SetPath(sModPath);
if (bVersionMismatch) {
ModInfo.SetDescription("--- Version mismatch, recompile this module. ---");
}
dlclose(p);
return true;
}