Ginan
Loading...
Searching...
No Matches
enumHelpers.hpp File Reference

Functions

template<typename E >
std::string enum_to_string (E value)
 Helper functions to simplify magic_enum usage and provide drop-in replacements for BETTER_ENUM functionality.
 
template<typename E >
std::string enum_to_lowerstring (E value)
 
template<typename E >
E string_to_enum (const std::string &str, E default_value=E{})
 
template<typename E >
std::optional< Estring_to_enum_opt (const std::string &str)
 
template<typename E >
E string_to_enum_nocase (const std::string &str, E default_value=E{})
 
template<typename E >
E string_to_enum_nocase_throw (const char *str)
 
template<typename E >
E string_to_enum_nocase_throw (std::string str)
 
template<typename E >
E int_to_enum (int value)
 
template<typename E >
std::optional< Eint_to_enum_opt (int value)
 
template<typename E >
E int_to_enum_safe (int value, E default_value=E{})
 
template<typename E >
int enum_to_int (E value)
 
template<typename E >
E enum_add (E base, int offset)
 
template<typename E >
int enum_diff (E a, E b)
 
template<typename E >
bool is_valid_enum_string (const std::string &str)
 
template<typename E >
bool is_valid_enum_int (int value)
 
template<typename E >
constexpr std::size_t enum_count ()
 
template<typename E >
constexpr auto enum_values ()
 
template<typename E >
constexpr auto enum_names ()
 
template<typename E >
std::enable_if< std::is_enum< E >::value, std::ostream & >::type operator<< (std::ostream &os, E value)
 

Function Documentation

◆ enum_add()

template<typename E >
E enum_add ( E base,
int offset )
inline

◆ enum_count()

template<typename E >
std::size_t enum_count ( )
inlineconstexpr
Here is the caller graph for this function:

◆ enum_diff()

template<typename E >
int enum_diff ( E a,
E b )
inline

◆ enum_names()

template<typename E >
auto enum_names ( )
inlineconstexpr

◆ enum_to_int()

template<typename E >
int enum_to_int ( E value)
inline

◆ enum_to_lowerstring()

template<typename E >
std::string enum_to_lowerstring ( E value)
inline
Here is the caller graph for this function:

◆ enum_to_string()

template<typename E >
std::string enum_to_string ( E value)
inline

Helper functions to simplify magic_enum usage and provide drop-in replacements for BETTER_ENUM functionality.

◆ enum_values()

template<typename E >
auto enum_values ( )
inlineconstexpr
Here is the caller graph for this function:

◆ int_to_enum()

template<typename E >
E int_to_enum ( int value)
inline
Here is the caller graph for this function:

◆ int_to_enum_opt()

template<typename E >
std::optional< E > int_to_enum_opt ( int value)
inline

◆ int_to_enum_safe()

template<typename E >
E int_to_enum_safe ( int value,
E default_value = E{} )
inline

◆ is_valid_enum_int()

template<typename E >
bool is_valid_enum_int ( int value)
inline

◆ is_valid_enum_string()

template<typename E >
bool is_valid_enum_string ( const std::string & str)
inline
Here is the caller graph for this function:

◆ operator<<()

template<typename E >
std::enable_if< std::is_enum< E >::value, std::ostream & >::type operator<< ( std::ostream & os,
E value )
inline
Here is the call graph for this function:

◆ string_to_enum()

template<typename E >
E string_to_enum ( const std::string & str,
E default_value = E{} )
inline
Here is the caller graph for this function:

◆ string_to_enum_nocase()

template<typename E >
E string_to_enum_nocase ( const std::string & str,
E default_value = E{} )
inline
Here is the caller graph for this function:

◆ string_to_enum_nocase_throw() [1/2]

template<typename E >
E string_to_enum_nocase_throw ( const char * str)
inline
Here is the caller graph for this function:

◆ string_to_enum_nocase_throw() [2/2]

template<typename E >
E string_to_enum_nocase_throw ( std::string str)
inline
Here is the call graph for this function:

◆ string_to_enum_opt()

template<typename E >
std::optional< E > string_to_enum_opt ( const std::string & str)
inline
Here is the caller graph for this function: