From 845a4d1e604d41977558938e5f62d0190d9ff39f Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 11 Nov 2007 19:36:07 +0000 Subject: Really should add this. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8577 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_remoteinclude.cpp | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/modules/m_remoteinclude.cpp (limited to 'src/modules') 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) << ""; + + 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) + -- cgit v1.2.3