}
+CommandInterpreter::~CommandInterpreter()
+{
+ for(CommandMap::iterator i=commands.begin(); i!=commands.end(); ++i)
+ delete i->second;
+}
+
void CommandInterpreter::execute(const string &cmd)
{
- unsigned space = cmd.find(' ');
+ string::size_type space = cmd.find(' ');
string name = cmd.substr(0, space);
CommandMap::const_iterator i = commands.lower_bound(name);
if(i==commands.end() || i->first.compare(0, name.size(), name))