From 8b8ea0b6b9f0776eec3fab813c3082027b1638cd Mon Sep 17 00:00:00 2001 From: prozacx Date: Mon, 2 May 2005 06:13:33 +0000 Subject: [PATCH] Added GetAvailableMods() (stubbed for now) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@229 726aef4b-f618-498e-8847-2d620e286838 --- Modules.cpp | 6 ++++++ Modules.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Modules.cpp b/Modules.cpp index 47053667..e3e130c7 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -624,3 +624,9 @@ bool CModules::ReloadModule(const string& sModule, const string& sArgs, CUser* p sRetMsg = "Reloaded module [" + sModule + "]"; return true; } + +void CModules::GetAvailableMods(set& ssMods) { + ssMods.clear(); + //ssMods.insert(CModInfo("foo", "/usr/share/znc/foo", true)); + //ssMods.insert(CModInfo("bar", "/home/user/.znc/modules/bar", false)); +} diff --git a/Modules.h b/Modules.h index ad30c7a8..368f8306 100644 --- a/Modules.h +++ b/Modules.h @@ -42,6 +42,32 @@ protected: string m_sDescription; }; +class CModInfo { +public: + + CModInfo(const string& sName, const string& sPath, bool bSystem) { + m_bSystem = bSystem; + m_sName = sName; + m_sPath = sPath; + } + virtual ~CModInfo() {} + + bool operator < (const CModInfo& Info) const { + return (GetName() < Info.GetName()); + } + + // Getters + const string& GetName() const { return m_sName; } + const string& GetPath() const { return m_sPath; } + bool IsSystem() const { return m_bSystem; } + // !Getters +private: +protected: + bool m_bSystem; + string m_sName; + string m_sPath; +}; + class CModule { public: CModule(void* pDLL, CUser* pUser, const string& sModName); @@ -170,6 +196,8 @@ public: bool LoadModule(const string& sModule, const string& sArgs, CUser* pUser, string& sRetMsg); bool UnloadModule(const string& sModule, string& sRetMsg); bool ReloadModule(const string& sModule, const string& sArgs, CUser* pUser, string& sRetMsg); + + static void GetAvailableMods(set& ssMods); }; #endif // !_MODULES_H