diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-11-11 19:36:07 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-11-11 19:36:07 +0000 |
commit | 845a4d1e604d41977558938e5f62d0190d9ff39f (patch) | |
tree | b75449c9cb144656cb0292cf49849e93ae7debac /src/modules | |
parent | 60a6385be43050bd09d502fdac1352c03e36b4a8 (diff) |
Really should add this.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8577 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_remoteinclude.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/modules/m_remoteinclude.cpp b/src/modules/m_remoteinclude.cpp new file mode 100644 index 000000000..dd5b0f48b --- /dev/null +++ b/src/modules/m_remoteinclude.cpp @@ -0,0 +1,64 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + +#include "inspircd.h" + +/* $ModDesc: A dummy module for testing */ + +// Class ModuleRemoteInclude inherits from Module +// It just outputs simple debug strings to show its methods are working. + +class ModuleRemoteInclude : public Module +{ + private: + + public: + ModuleRemoteInclude(InspIRCd* Me) + : Module(Me) + { + ServerInstance->Modules->Attach(I_OnDownloadFile, this); + } + + virtual ~ModuleRemoteInclude() + { + } + + virtual Version GetVersion() + { + // this method instantiates a class of type Version, and returns + // the modules version information using it. + + return Version(1,1,0,1,VF_VENDOR,API_VERSION); + } + + int OnDownloadFile(const std::string &name, std::istream* &filedata) + { + /* Dummy code */ + std::stringstream* ss = new std::stringstream(); + (*ss) << "<test tag="">"; + + delete filedata; + filedata = ss; + + /* for this test module, we claim all schemes, and we return dummy data. + * Because the loading is instant we mark the file completed immediately. + */ + ServerInstance->Config->Complete(name, false); + + return true; + } +}; + + +MODULE_INIT(ModuleRemoteInclude) + |