From 14500d43760661ffc3ffb67d929088c27fe46c64 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 1 Jan 2011 21:04:17 +0100 Subject: Implemented a simple 'ls' command for the telnet server. --- commands.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 commands.h (limited to 'commands.h') diff --git a/commands.h b/commands.h new file mode 100644 index 0000000..bc4092f --- /dev/null +++ b/commands.h @@ -0,0 +1,24 @@ +#ifndef COMMANDS_H +#define COMMANDS_H + +#include + +#include +#include +#include +#include + +namespace commands { + typedef boost::function (const std::vector&)> Handler; + extern std::map handlers; + + class CommandException : public std::runtime_error { + public: + CommandException(const char *s) : std::runtime_error(s) {}; + }; + + void init(); + std::vector execute(const std::vector& args); +}; + +#endif -- cgit v1.2.3