MySQL 8.0.33
Source Code Documentation
Mysql::Tools::Base::Options::Abstract_string_option< T_type > Class Template Reference

Abstract option to handle options accepting string value argument. More...

#include <abstract_string_option.h>

Inheritance diagram for Mysql::Tools::Base::Options::Abstract_string_option< T_type >:
[legend]

Public Member Functions

T_type * set_value (std::string value)
 Sets value for this option. More...
 
- Public Member Functions inherited from Mysql::Tools::Base::Options::Abstract_value_option< T_type >
T_type * value_optional ()
 Sets arg_type to OPT_ARG - doesn't require argument to be specified when using this option. More...
 
- Public Member Functions inherited from Mysql::Tools::Base::Options::Abstract_option< T_type >
 ~Abstract_option () override
 
void add_callback (std::function< void(char *)> *callback)
 Adds new callback for this option for option_parsed() event to callback chain. More...
 
T_type * set_short_character (char code)
 Sets optid to given character to make possible usage of short option alternative. More...
 
- Public Member Functions inherited from Mysql::Tools::Base::Options::I_option
virtual ~I_option ()
 

Protected Member Functions

 Abstract_string_option (std::optional< std::string > *value, ulong var_type, std::string name, std::string description)
 Constructs new string option. More...
 
- Protected Member Functions inherited from Mysql::Tools::Base::Options::Abstract_value_option< T_type >
 Abstract_value_option (void *value, ulong var_type, std::string name, std::string description, uint64 default_value)
 Constructs new option with value argument. More...
 
- Protected Member Functions inherited from Mysql::Tools::Base::Options::Abstract_option< T_type >
 Abstract_option (void *value, ulong var_type, std::string name, std::string description, longlong default_value)
 Constructs new option. More...
 
my_option get_my_option () override
 Returns my_getopt internal option data structure representing this option. More...
 
void set_option_changed_listener (I_option_changed_listener *listener) override
 Method to set listener on option changed events. More...
 

Protected Attributes

std::optional< std::string > * m_destination_value
 
- Protected Attributes inherited from Mysql::Tools::Base::Options::Abstract_option< T_type >
my_option m_option_structure
 

Private Member Functions

void string_callback (char *argument)
 

Private Attributes

const char * m_original_value
 

Additional Inherited Members

- Static Protected Attributes inherited from Mysql::Tools::Base::Options::I_option
static uint32 last_optid = 256
 

Detailed Description

template<typename T_type>
class Mysql::Tools::Base::Options::Abstract_string_option< T_type >

Abstract option to handle options accepting string value argument.

Constructor & Destructor Documentation

◆ Abstract_string_option()

template<typename T_type >
Mysql::Tools::Base::Options::Abstract_string_option< T_type >::Abstract_string_option ( std::optional< std::string > *  value,
ulong  var_type,
std::string  name,
std::string  description 
)
protected

Constructs new string option.

Parameters
valuePointer to string object to receive option value.
var_typemy_getopt internal option type.
nameName of option. It is used in command line option name as –name.
descriptionDescription of option to be printed in –help.

Member Function Documentation

◆ set_value()

template<typename T_type >
T_type * Mysql::Tools::Base::Options::Abstract_string_option< T_type >::set_value ( std::string  value)

Sets value for this option.

If it is specified before handling commandline options then supplied value is used as default value of this option.

◆ string_callback()

template<typename T_type >
void Mysql::Tools::Base::Options::Abstract_string_option< T_type >::string_callback ( char *  argument)
private

Member Data Documentation

◆ m_destination_value

template<typename T_type >
std::optional<std::string>* Mysql::Tools::Base::Options::Abstract_string_option< T_type >::m_destination_value
protected

◆ m_original_value

template<typename T_type >
const char* Mysql::Tools::Base::Options::Abstract_string_option< T_type >::m_original_value
private

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