Really should add this.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8577 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2007-11-11 19:36:07 +00:00
parent 60a6385be4
commit 845a4d1e60

View File

@ -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)