Пример #1
0
	virtual void OnGetAvailableMods(set<CModInfo>& ssMods, CModInfo::EModuleType eType) {

		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);
				PUSH_PTR(CModInfo*, &ModInfo);
				PCALL("ZNC::Core::ModInfoByPath");
				if (!SvTRUE(ERRSV) && ret == 2) {
					ssMods.insert(ModInfo);
				}
				PEND;
			}
		}
	}
Пример #2
0
	void OnGetAvailableMods(set<CModInfo>& ssMods, CModInfo::EModuleType eType) override {
		CDir Dir;
		CModules::ModDirList dirs = CModules::GetModDirs();

		while (!dirs.empty()) {
			set<CString> already;

			Dir.Fill(dirs.front().first);
			for (unsigned int a = 0; a < Dir.size(); a++) {
				CFile& File = *Dir[a];
				CString sName = File.GetShortName();
				CString sPath = File.GetLongName();
				sPath.TrimSuffix(sName);

				if (!File.IsDir()) {
					if (sName.WildCmp("*.pyc")) {
						sName.RightChomp(4);
					} else if (sName.WildCmp("*.py") || sName.WildCmp("*.so")) {
						sName.RightChomp(3);
					} else {
						continue;
					}
				}

				TryAddModInfo(sPath, sName, ssMods, already, eType);
			}

			dirs.pop();
		}
	}
Пример #3
0
	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;
			}
		}
	}
Пример #4
0
	virtual void OnGetAvailableMods(set<CModInfo>& ssMods, bool bGlobal) {
		if (bGlobal) {
			return;
		}

		CDir Dir;
		CModules::ModDirList dirs = CModules::GetModDirs();

		while (!dirs.empty()) {
			set<CString> already;

			Dir.FillByWildcard(dirs.front().first, "*.py");
			for (unsigned int a = 0; a < Dir.size(); a++) {
				CFile& File = *Dir[a];
				CString sName = File.GetShortName();
				CString sPath = File.GetLongName();
				sPath.TrimSuffix(sName);
				sName.RightChomp(3);
				TryAddModInfo(sPath, sName, ssMods, already);
			}

			Dir.FillByWildcard(dirs.front().first, "*.pyc");
			for (unsigned int a = 0; a < Dir.size(); a++) {
				CFile& File = *Dir[a];
				CString sName = File.GetShortName();
				CString sPath = File.GetLongName();
				sPath.TrimSuffix(sName);
				sName.RightChomp(4);
				TryAddModInfo(sPath, sName, ssMods, already);
			}

			Dir.FillByWildcard(dirs.front().first, "*.so");
			for (unsigned int a = 0; a < Dir.size(); a++) {
				CFile& File = *Dir[a];
				CString sName = File.GetShortName();
				CString sPath = File.GetLongName();
				sPath.TrimSuffix(sName);
				sName.RightChomp(3);
				TryAddModInfo(sPath, sName, ssMods, already);
			}

			dirs.pop();
		}
	}