21 for (
int i = 0; i < argv; ++i)
keys_.push_back(std::make_shared<cmd_option_value>(argc[i]));
25 std::vector<std::string>::size_type uSize = cmds.size();
26 for (std::vector<std::string>::size_type i = 0; i < uSize; ++i) {
27 keys_.push_back(std::make_shared<cmd_option_value>(cmds[i].c_str()));
32 typedef std::map<std::string, value_type> key_map_type;
33 typedef std::vector<value_type> keys_type;
37 key_value_ = std::shared_ptr<key_map_type>(
new key_map_type());
39 for (keys_type::size_type i = 0; i <
keys_.size(); ++i) {
40 const char *str_key =
keys_[i]->to_string();
41 if (
nullptr == str_key) {
45 const char *str_val = str_key;
46 for (; *str_val &&
':' != *str_val &&
'=' != *str_val; ++str_val)
56 (*key_value_)[std::string(str_key, str_val - 1)] = std::make_shared<cmd_option_value>(val);
72 cmd_array_.push_back(std::make_pair(cmd_content, base_node));
81 if (ret_ptr.get() ==
nullptr)
return std::make_shared<cmd_option_value>(default_val);
88 std::map<std::string, value_type>::const_iterator itr;
static const char * ROOT_NODE_CMD
static const char * get_segment(const char *begin_str, std::string &val)
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)