libcopp  2.2.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 71 of file cmd_option_list.h.

Member Typedef Documentation

◆ cmd_array_type

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.

◆ size_type

Definition at line 77 of file cmd_option_list.h.

◆ value_type

Definition at line 76 of file cmd_option_list.h.

Constructor & Destructor Documentation

◆ cmd_option_list() [1/3]

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

Definition at line 18 of file cmd_option_list.cpp.

◆ cmd_option_list() [2/3]

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_.

◆ cmd_option_list() [3/3]

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

Definition at line 24 of file cmd_option_list.cpp.

References keys_.

Member Function Documentation

◆ add()

void util::cli::cmd_option_list::add ( const char *  param)

◆ append_cmd()

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 71 of file cmd_option_list.cpp.

References cmd_array_.

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

◆ clear()

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

Definition at line 62 of file cmd_option_list.cpp.

References cmd_array_, ext_param_, key_value_, and keys_.

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

◆ get() [1/3]

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

Definition at line 94 of file cmd_option_list.cpp.

References keys_.

◆ get() [2/3]

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

Definition at line 85 of file cmd_option_list.cpp.

References init_key_value_map(), and key_value_.

◆ get() [3/3]

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

Definition at line 79 of file cmd_option_list.cpp.

◆ get_cmd_array()

const cmd_option_list::cmd_array_type & util::cli::cmd_option_list::get_cmd_array ( ) const

◆ get_ext_param()

void * util::cli::cmd_option_list::get_ext_param ( ) const

Definition at line 107 of file cmd_option_list.cpp.

References ext_param_.

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

◆ get_params_number()

cmd_option_list::size_type util::cli::cmd_option_list::get_params_number ( ) const

◆ init_key_value_map()

void util::cli::cmd_option_list::init_key_value_map ( )
protected

Definition at line 31 of file cmd_option_list.cpp.

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

Referenced by get().

◆ load_cmd_array()

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

Definition at line 69 of file cmd_option_list.cpp.

References cmd_array_.

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

◆ operator[]()

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

Definition at line 97 of file cmd_option_list.cpp.

References keys_.

◆ pop_cmd()

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

Definition at line 75 of file cmd_option_list.cpp.

References cmd_array_.

◆ reset_key_value_map()

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

Definition at line 103 of file cmd_option_list.cpp.

References key_value_.

◆ set_ext_param()

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

Definition at line 105 of file cmd_option_list.cpp.

References ext_param_.

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

Field Documentation

◆ cmd_array_

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().

◆ ext_param_

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().

◆ key_value_

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().

◆ keys_

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: