/* OperServ core functions
 *
 * (C) 2003-2011 Anope Team
 * Contact us at team@anope.org
 *
 * Please read COPYING and README for further details.
 *
 * Based on the original code of Epona by Lara.
 * Based on the original code of Services by Andy Church.
 */

/*************************************************************************/

#include "module.h"

class CommandOSReload : public Command
{
 public:
	CommandOSReload(Module *creator) : Command(creator, "operserv/test", 0, 0)
	{
		this->SetDesc(_("o"));
		this->SetSyntax("");
	}

	void Execute(CommandSource &source, const std::vector<Anope::string> &params)
	{
		source.Reply("size %d\n", serialized_types->size());
		for (std::vector<SerializableBase *>::iterator moo = serialized_types->begin(); moo != serialized_types->end(); ++moo)
		{
			source.Reply("Moo was of type %s\n", (*moo)->serialize_name().c_str());
		}
		for (std::list<SerializableBase *>::iterator it = serialized_items.begin(), it_end = serialized_items.end();  it != it_end; ++it)
		{
			SerializableBase *b = *it;
	
			SerializableBase::serialized_data data = b->serialize();
			for (SerializableBase::serialized_data::iterator it2 = data.begin(), it2_end = data.end(); it2 != it2_end; ++it2)
				source.Reply("%s: %s", it2->first.c_str(), it2->second.str().c_str());
		}
	}
};

class OSReload : public Module
{
	CommandOSReload commandosreload;

 public:
	OSReload(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
		commandosreload(this)
	{
		this->SetAuthor("Anope");

	}
};

MODULE_INIT(OSReload)
