The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Private Attributes | List of all members
config_attribute_value::string_visitor Class Reference

Visitor for converting a variant to a string. More...

Public Member Functions

 string_visitor (const std::string &fallback)
 
std::string operator() (const utils::monostate &) const
 
std::string operator() (const yes_no &b) const
 
std::string operator() (const true_false &b) const
 
std::string operator() (int i) const
 
std::string operator() (unsigned long long u) const
 
std::string operator() (double d) const
 
std::string operator() (const std::string &s) const
 
std::string operator() (const t_string &s) const
 

Private Attributes

const std::string default_
 

Detailed Description

Visitor for converting a variant to a string.

Definition at line 312 of file config_attribute_value.cpp.

Constructor & Destructor Documentation

◆ string_visitor()

config_attribute_value::string_visitor::string_visitor ( const std::string &  fallback)
inline

Definition at line 320 of file config_attribute_value.cpp.

Member Function Documentation

◆ operator()() [1/8]

std::string config_attribute_value::string_visitor::operator() ( const std::string &  s) const
inline

Definition at line 329 of file config_attribute_value.cpp.

References s.

◆ operator()() [2/8]

std::string config_attribute_value::string_visitor::operator() ( const t_string s) const
inline

Definition at line 330 of file config_attribute_value.cpp.

References s.

◆ operator()() [3/8]

std::string config_attribute_value::string_visitor::operator() ( const true_false b) const
inline

Definition at line 324 of file config_attribute_value.cpp.

References b.

◆ operator()() [4/8]

std::string config_attribute_value::string_visitor::operator() ( const utils::monostate &  ) const
inline

Definition at line 322 of file config_attribute_value.cpp.

References default_.

◆ operator()() [5/8]

std::string config_attribute_value::string_visitor::operator() ( const yes_no b) const
inline

Definition at line 323 of file config_attribute_value.cpp.

References b.

◆ operator()() [6/8]

std::string config_attribute_value::string_visitor::operator() ( double  d) const
inline

Definition at line 328 of file config_attribute_value.cpp.

References d, and utils::charconv_buffer< TNum >::to_string().

◆ operator()() [7/8]

std::string config_attribute_value::string_visitor::operator() ( int  i) const
inline

Definition at line 326 of file config_attribute_value.cpp.

References i, and utils::charconv_buffer< TNum >::to_string().

◆ operator()() [8/8]

std::string config_attribute_value::string_visitor::operator() ( unsigned long long  u) const
inline

Member Data Documentation

◆ default_

const std::string config_attribute_value::string_visitor::default_
private

Definition at line 317 of file config_attribute_value.cpp.

Referenced by operator()().


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