libcopp  1.1.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
util::cli::cmd_option_list Class Reference

#include <cmd_option_list.h>

Collaboration diagram for util::cli::cmd_option_list:
Collaboration graph

Public Types

typedef std::vector< std::pair< std::string, std::shared_ptr< binder::cmd_option_bind_base > > > cmd_array_type
 
typedef std::shared_ptr< cmd_option_valuevalue_type
 
typedef std::vector< value_type >::size_type size_type
 

Public Member Functions

 cmd_option_list ()
 
 cmd_option_list (int argv, const char *argc[])
 
 cmd_option_list (const std::vector< std::string > &cmds)
 
void add (const char *param)
 
void clear ()
 
void load_cmd_array (const cmd_array_type &cmds)
 
void append_cmd (const char *cmd_content, std::shared_ptr< binder::cmd_option_bind_base > base_node)
 
void pop_cmd ()
 
const cmd_array_typeget_cmd_array () const
 
value_type get (std::string key, const char *default_val)
 
value_type get (std::string key)
 
value_type get (size_type index) const
 
value_type operator[] (size_type index) const
 
size_type get_params_number () const
 
void reset_key_value_map ()
 
void set_ext_param (void *param)
 
void * get_ext_param () const
 

Protected Member Functions

void init_key_value_map ()
 

Protected Attributes

std::shared_ptr< std::map< std::string, std::shared_ptr< cmd_option_value > > > key_value_
 
std::vector< std::shared_ptr< cmd_option_value > > keys_
 
cmd_array_type cmd_array_
 
void * ext_param_
 

Detailed Description

Definition at line 72 of file cmd_option_list.h.

Member Typedef Documentation

typedef std::vector<std::pair<std::string, std::shared_ptr<binder::cmd_option_bind_base> > > util::cli::cmd_option_list::cmd_array_type

Definition at line 75 of file cmd_option_list.h.

Definition at line 77 of file cmd_option_list.h.

Definition at line 76 of file cmd_option_list.h.

Constructor & Destructor Documentation

util::cli::cmd_option_list::cmd_option_list ( )

Definition at line 18 of file cmd_option_list.cpp.

util::cli::cmd_option_list::cmd_option_list ( int  argv,
const char *  argc[] 
)

Definition at line 20 of file cmd_option_list.cpp.

References keys_.

util::cli::cmd_option_list::cmd_option_list ( const std::vector< std::string > &  cmds)

Definition at line 25 of file cmd_option_list.cpp.

References keys_.

Member Function Documentation

void util::cli::cmd_option_list::add ( const char *  param)
void util::cli::cmd_option_list::append_cmd ( const char *  cmd_content,
std::shared_ptr< binder::cmd_option_bind_base base_node 
)

Definition at line 73 of file cmd_option_list.cpp.

References cmd_array_.

Referenced by util::cli::cmd_option_bind< TCmdStr >::run_cmd().

void util::cli::cmd_option_list::clear ( )

Definition at line 64 of file cmd_option_list.cpp.

References cmd_array_, ext_param_, key_value_, and keys_.

Referenced by util::cli::cmd_option_bind< TCmdStr >::start().

cmd_option_list::value_type util::cli::cmd_option_list::get ( std::string  key,
const char *  default_val 
)

Definition at line 81 of file cmd_option_list.cpp.

cmd_option_list::value_type util::cli::cmd_option_list::get ( std::string  key)

Definition at line 87 of file cmd_option_list.cpp.

References init_key_value_map(), and key_value_.

cmd_option_list::value_type util::cli::cmd_option_list::get ( size_type  index) const

Definition at line 96 of file cmd_option_list.cpp.

References keys_.

const cmd_option_list::cmd_array_type & util::cli::cmd_option_list::get_cmd_array ( ) const
void * util::cli::cmd_option_list::get_ext_param ( ) const

Definition at line 109 of file cmd_option_list.cpp.

References ext_param_.

Referenced by util::cli::cmd_option_bind< TCmdStr >::start().

cmd_option_list::size_type util::cli::cmd_option_list::get_params_number ( ) const
void util::cli::cmd_option_list::init_key_value_map ( )
protected

Definition at line 33 of file cmd_option_list.cpp.

References util::cli::cmd_option_bind< TCmdStr >::get_segment(), key_value_, and keys_.

Referenced by get().

void util::cli::cmd_option_list::load_cmd_array ( const cmd_array_type cmds)

Definition at line 71 of file cmd_option_list.cpp.

References cmd_array_.

Referenced by util::cli::cmd_option_bind< TCmdStr >::start().

cmd_option_list::value_type util::cli::cmd_option_list::operator[] ( size_type  index) const

Definition at line 99 of file cmd_option_list.cpp.

References keys_.

void util::cli::cmd_option_list::pop_cmd ( )

Definition at line 77 of file cmd_option_list.cpp.

References cmd_array_.

void util::cli::cmd_option_list::reset_key_value_map ( )

Definition at line 105 of file cmd_option_list.cpp.

References key_value_.

void util::cli::cmd_option_list::set_ext_param ( void *  param)

Definition at line 107 of file cmd_option_list.cpp.

References ext_param_.

Referenced by util::cli::cmd_option_bind< TCmdStr >::start().

Field Documentation

cmd_array_type util::cli::cmd_option_list::cmd_array_
protected

Definition at line 82 of file cmd_option_list.h.

Referenced by append_cmd(), clear(), get_cmd_array(), load_cmd_array(), and pop_cmd().

void* util::cli::cmd_option_list::ext_param_
protected

Definition at line 83 of file cmd_option_list.h.

Referenced by clear(), get_ext_param(), and set_ext_param().

std::shared_ptr<std::map<std::string, std::shared_ptr<cmd_option_value> > > util::cli::cmd_option_list::key_value_
protected

Definition at line 80 of file cmd_option_list.h.

Referenced by clear(), get(), init_key_value_map(), and reset_key_value_map().

std::vector<std::shared_ptr<cmd_option_value> > util::cli::cmd_option_list::keys_
protected

The documentation for this class was generated from the following files: