summaryrefslogtreecommitdiff
path: root/commands.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-01-02 04:10:40 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-01-02 04:10:40 +0100
commit1a5f29542ff55be2bf31e164448c0c6e8179ee38 (patch)
tree8bb4613d4b18d2d6cf6c76eab4d826fa88634b47 /commands.h
parente19efcb8e7ba2cf4d4ce59c5f76e78a41a19ba24 (diff)
Killed the 'commands' namespace.
Diffstat (limited to 'commands.h')
-rw-r--r--commands.h42
1 files changed, 20 insertions, 22 deletions
diff --git a/commands.h b/commands.h
index ae5dc84..084dd02 100644
--- a/commands.h
+++ b/commands.h
@@ -11,35 +11,33 @@
#include <map>
#include <stdexcept>
-namespace commands {
- class Commands;
+class Commands;
- class CommandException : public std::runtime_error {
- public:
- CommandException(const char *s) : std::runtime_error(s) {};
- CommandException(std::string s) : std::runtime_error(s.c_str()) {};
- };
+class CommandException : public std::runtime_error {
+ public:
+ CommandException(const char *s) : std::runtime_error(s) {};
+ CommandException(std::string s) : std::runtime_error(s.c_str()) {};
+};
- class Commands {
- private:
- typedef boost::function<std::vector<std::string> (Commands*)> Handler;
- std::map<std::string, Handler> handlers;
+class Commands {
+ private:
+ typedef boost::function<std::vector<std::string> (Commands*)> Handler;
+ std::map<std::string, Handler> handlers;
- typedef boost::function<std::vector<MusicListing::p> (const std::string artist)> FindFunction;
- std::map<std::string, FindFunction> find_handlers;
+ typedef boost::function<std::vector<MusicListing::p> (const std::string artist)> FindFunction;
+ std::map<std::string, FindFunction> find_handlers;
- boost::asio::io_service& io_service;
- std::vector<std::string>& args;
+ boost::asio::io_service& io_service;
+ std::vector<std::string>& args;
- std::vector<std::string> ls();
- std::vector<std::string> find();
- std::vector<std::string> update();
+ std::vector<std::string> ls();
+ std::vector<std::string> find();
+ std::vector<std::string> update();
- public:
- Commands(boost::asio::io_service& io_service, std::vector<std::string>& args);
- std::vector<std::string> operator()();
+ public:
+ Commands(boost::asio::io_service& io_service, std::vector<std::string>& args);
+ std::vector<std::string> operator()();
- };
};
#endif