diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-09-27 21:20:56 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-09-27 21:20:56 +0000 |
commit | f572827157397e493e5499f115b15d0de992480a (patch) | |
tree | 8fb49c5ed90d01458a138d0ce582493c94e56219 /include/modules.h | |
parent | 9d87b0f9235458169b513904ce4e220da4e29d73 (diff) |
Removed old mod_version system for detecting module versions and replaced with the Module::GetVersion() function
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2521 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include/modules.h')
-rw-r--r-- | include/modules.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/modules.h b/include/modules.h index fc00fafee..45f5bf091 100644 --- a/include/modules.h +++ b/include/modules.h @@ -19,6 +19,7 @@ #include <stdio.h> #include "timers.h" #include "hashcomp.h" +#include "version.h" /* Cross OS compatibility macros */ #ifdef _WIN32 @@ -295,6 +296,42 @@ class CoreExport Command char *service; /* Service we provide this command for */ Command *next; }; + +class CoreExport Version +{ + private: + unsigned Major; + unsigned Minor; + unsigned Build; + + public: + /** Constructor + * @param vMajor The major version numbber + * @param vMinor The minor version numbber + * @param vBuild The build version numbber + */ + Version(unsigned vMajor, unsigned vMinor, unsigned vBuild); + + /** Destructor + */ + virtual ~Version(); + + /** Get the major version of Anope this was built against + * @return The major version + */ + const unsigned GetMajor(); + + /** Get the minor version of Anope this was built against + * @return The minor version + */ + const unsigned GetMinor(); + + /** Get the build version this was built against + * @return The build version + */ + const unsigned GetBuild(); +}; + /** Every module in Anope is actually a class. */ class CoreExport Module @@ -362,6 +399,12 @@ class CoreExport Module */ void SetAuthor(const std::string &author); + /** Get the version of Anope this module was + * compiled against + * @return The version + */ + virtual Version GetVersion() { return Version(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); } + /** Add output to NickServ Help. * When doing /msg NickServ HELP, this function will be calloed to allow it to send out * a notice witht he code you wish to display |