1 #ifndef CMDOPTIONLIST_H
2 #define CMDOPTIONLIST_H
25 class cmd_option_list;
58 virtual std::shared_ptr<cmd_option_bind_base>
set_help_msg(
const char *help_msg) {
60 return shared_from_this();
64 virtual std::shared_ptr<cmd_option_bind_base>
add_help_msg(
const char *help_msg) {
66 return shared_from_this();
74 typedef std::vector<std::pair<std::string, std::shared_ptr<binder::cmd_option_bind_base> > >
77 typedef std::vector<value_type>::size_type
size_type;
80 std::shared_ptr<std::map<std::string, std::shared_ptr<cmd_option_value> > >
key_value_;
81 std::vector<std::shared_ptr<cmd_option_value> >
keys_;
95 void add(
const char *param);
104 void append_cmd(
const char *cmd_content, std::shared_ptr<binder::cmd_option_bind_base> base_node);
virtual std::shared_ptr< cmd_option_bind_base > add_help_msg(const char *help_msg)
static const char * ROOT_NODE_CMD
std::vector< help_msg_t > help_list_t
virtual void operator()(callback_param arg)=0
virtual std::string get_help_msg(const char *prefix_data="") const
static bool sort_by_all_cmds(const help_msg_t &l, const help_msg_t &r)
virtual ~cmd_option_bind_base()
callback_param param_type
virtual std::shared_ptr< cmd_option_bind_base > set_help_msg(const char *help_msg)
value_type get(std::string key, const char *default_val)
void * get_ext_param() const
cmd_array_type cmd_array_
value_type operator[](size_type index) const
void init_key_value_map()
std::shared_ptr< cmd_option_value > value_type
void append_cmd(const char *cmd_content, std::shared_ptr< binder::cmd_option_bind_base > base_node)
size_type get_params_number() const
void load_cmd_array(const cmd_array_type &cmds)
std::shared_ptr< std::map< std::string, std::shared_ptr< cmd_option_value > > > key_value_
const cmd_array_type & get_cmd_array() const
void reset_key_value_map()
std::vector< std::shared_ptr< cmd_option_value > > keys_
std::vector< value_type >::size_type size_type
std::vector< std::pair< std::string, std::shared_ptr< binder::cmd_option_bind_base > > > cmd_array_type
void set_ext_param(void *param)
void add(const char *param)
cmd_option_list & callback_param
std::shared_ptr< cmd_option_bind_base > binded_obj
std::vector< std::string > cmd_paths