void CModules::GetAvailableMods(set<CModInfo>& ssMods, bool bGlobal) { ssMods.clear(); unsigned int a = 0; CDir Dir; ModDirList dirs = GetModDirs(); while (!dirs.empty()) { Dir.FillByWildcard(dirs.front().first, "*.so"); 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); CString sIgnoreRetMsg; if (GetModPathInfo(ModInfo, sName, sPath, sIgnoreRetMsg)) { if (ModInfo.IsGlobal() == bGlobal) { ssMods.insert(ModInfo); } } } } GLOBALMODULECALL(OnGetAvailableMods(ssMods, bGlobal), NULL, NULL, ); }
bool CModules::GetModInfo(CModInfo& ModInfo, const CString& sModule, CString& sRetMsg) { CString sModPath, sTmp; if (!FindModPath(sModule, sModPath, sTmp)) { sRetMsg = "Unable to find module [" + sModule + "]"; return false; } return GetModPathInfo(ModInfo, sModule, sModPath, sRetMsg); }
bool CModules::GetModInfo(CModInfo& ModInfo, const CString& sModule, CString& sRetMsg) { CString sModPath, sTmp; bool bSuccess; GLOBALMODULECALL(OnGetModInfo(ModInfo, sModule, bSuccess, sRetMsg), NULL, NULL, return bSuccess); if (!FindModPath(sModule, sModPath, sTmp)) { sRetMsg = "Unable to find module [" + sModule + "]"; return false; } return GetModPathInfo(ModInfo, sModule, sModPath, sRetMsg); }