cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::utils::option_t< T > Class Template Reference

#include <click.hpp>

Inheritance diagram for toolbox::utils::option_t< T >:

Public Member Functions

 option_t (const std::string &name, const std::string &short_name, const std::string &description, bool required=false)
 
option_tset_default (const T &default_value)
 
option_tset_parser (std::function< bool(const std::string &, T &)> parser)
 
std::string get_short_name () const override
 
get () const
 
bool parse (const std::string &value) override
 
bool accepts_missing_value () const override
 
bool is_option () const override
 
- Public Member Functions inherited from toolbox::utils::parameter_t
 parameter_t (const std::string &name, const std::string &description, bool required=false)
 
virtual ~parameter_t ()=default
 
std::string get_name () const
 
std::string get_description () const
 
bool is_required () const
 
bool is_set () const
 
virtual bool is_argument () const
 
virtual bool is_flag () const
 

Additional Inherited Members

- Protected Attributes inherited from toolbox::utils::parameter_t
std::string name_
 
std::string description_
 
bool required_
 
bool is_set_
 

Constructor & Destructor Documentation

◆ option_t()

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

Member Function Documentation

◆ accepts_missing_value()

template<typename T >
bool toolbox::utils::option_t< T >::accepts_missing_value ( ) const
overridevirtual

Reimplemented from toolbox::utils::parameter_t.

◆ get()

template<typename T >
T toolbox::utils::option_t< T >::get ( ) const

◆ get_short_name()

template<typename T >
std::string toolbox::utils::option_t< T >::get_short_name ( ) const
overridevirtual

Reimplemented from toolbox::utils::parameter_t.

◆ is_option()

template<typename T >
bool toolbox::utils::option_t< T >::is_option ( ) const
overridevirtual

Reimplemented from toolbox::utils::parameter_t.

◆ parse()

template<typename T >
bool toolbox::utils::option_t< T >::parse ( const std::string &  value)
overridevirtual

◆ set_default()

template<typename T >
option_t< T > & toolbox::utils::option_t< T >::set_default ( const T &  default_value)

◆ set_parser()

template<typename T >
option_t< T > & toolbox::utils::option_t< T >::set_parser ( std::function< bool(const std::string &, T &)>  parser)

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