00001
00002
00007 #ifndef __SHEPP_COMMAND_H__
00008 #define __SHEPP_COMMAND_H__
00009
00010 #include <string>
00011 using std::string;
00012
00013 typedef int isfunc_t (vector<string> &);
00014
00016 class SheppCommand {
00017 public:
00019 bool operator<(const SheppCommand &cmd) const {
00020 return name < cmd.name;
00021 }
00022
00024 SheppCommand()
00025 {
00026 init();
00027 }
00028
00030 SheppCommand(string name, isfunc_t *function, string brief)
00031 {
00032 this->name = name;
00033 this->function = function;
00034 this->brief = brief;
00035 }
00036
00038 void reset(string name, isfunc_t *function, string brief)
00039 {
00040 this->name = name;
00041 this->function = function;
00042 this->brief = brief;
00043 }
00044
00046 string name;
00047
00049 isfunc_t *function;
00050
00052 string brief;
00053 protected:
00055 void init()
00056 {
00057 name = "";
00058 function = NULL;
00059 brief = "";
00060 }
00061 };
00062
00063 #endif //__SHEPP_COMMAND_H__