cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::utils::command_t Class Reference

#include <click.hpp>

Inheritance diagram for toolbox::utils::command_t:

Public Member Functions

 command_t (const std::string &name, const std::string &description)
 
 command_t (const command_t &)=delete
 
command_toperator= (const command_t &)=delete
 
 command_t (command_t &&)=default
 
command_toperator= (command_t &&)=default
 
std::string get_name () const
 
std::string get_description () const
 
template<typename T >
option_t< T > & add_option (const std::string &name, const std::string &short_name, const std::string &description, bool required=false)
 
flag_tadd_flag (const std::string &name, const std::string &short_name, const std::string &description)
 
template<typename T >
argument_t< T > & add_argument (const std::string &name, const std::string &description, bool required=true)
 
command_tadd_command (const std::string &name, const std::string &description)
 
command_tset_callback (std::function< int()> callback)
 
int parse_and_execute (const std::vector< std::string > &args)
 
std::string format_help () const
 
void apply_ini_config (const class ini_config_t &config, const std::string &section="")
 
void apply_ini_file (const std::string &file_path, const std::string &section="")
 

Constructor & Destructor Documentation

◆ command_t() [1/3]

toolbox::utils::command_t::command_t ( const std::string &  name,
const std::string &  description 
)

◆ command_t() [2/3]

toolbox::utils::command_t::command_t ( const command_t )
delete

◆ command_t() [3/3]

toolbox::utils::command_t::command_t ( command_t &&  )
default

Member Function Documentation

◆ add_argument()

template<typename T >
argument_t< T > & toolbox::utils::command_t::add_argument ( const std::string &  name,
const std::string &  description,
bool  required = true 
)

◆ add_command()

command_t & toolbox::utils::command_t::add_command ( const std::string &  name,
const std::string &  description 
)

◆ add_flag()

flag_t & toolbox::utils::command_t::add_flag ( const std::string &  name,
const std::string &  short_name,
const std::string &  description 
)

◆ add_option()

template<typename T >
option_t< T > & toolbox::utils::command_t::add_option ( const std::string &  name,
const std::string &  short_name,
const std::string &  description,
bool  required = false 
)

◆ apply_ini_config()

void toolbox::utils::command_t::apply_ini_config ( const class ini_config_t config,
const std::string &  section = "" 
)
inline

◆ apply_ini_file()

void toolbox::utils::command_t::apply_ini_file ( const std::string &  file_path,
const std::string &  section = "" 
)
inline

◆ format_help()

std::string toolbox::utils::command_t::format_help ( ) const

◆ get_description()

std::string toolbox::utils::command_t::get_description ( ) const

◆ get_name()

std::string toolbox::utils::command_t::get_name ( ) const

◆ operator=() [1/2]

command_t & toolbox::utils::command_t::operator= ( command_t &&  )
default

◆ operator=() [2/2]

command_t & toolbox::utils::command_t::operator= ( const command_t )
delete

◆ parse_and_execute()

int toolbox::utils::command_t::parse_and_execute ( const std::vector< std::string > &  args)

◆ set_callback()

command_t & toolbox::utils::command_t::set_callback ( std::function< int()>  callback)

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