CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
EnumIO

Detailed Description

Helpers for enum class IO.

Functions

template<typename ENUM >
std::string CASM::help ()
 Print help message describing recognized strings for allowed enum values. More...
 
template<typename ENUM >
void CASM::invalid_enum_string (std::string val, std::ostream &serr)
 Throw invalid_argument error for unrecognized strings. More...
 
template<typename ENUM >
std::string CASM::to_string (ENUM val)
 Return string representation of enum class. More...
 
template<typename ENUM >
ENUM CASM::from_string (const std::string &val)
 Return enum class object from string representation. More...
 

Function Documentation

template<typename ENUM >
ENUM CASM::from_string ( const std::string &  val)

Return enum class object from string representation.

Definition at line 92 of file EnumIO.hh.

template<typename ENUM >
std::string CASM::help ( )

Print help message describing recognized strings for allowed enum values.

Of form:

Options are:
CART or cart
FRAC or frac or DIRECT or direct
INTEGRAL or integral

Definition at line 38 of file EnumIO.hh.

template<typename ENUM >
void CASM::invalid_enum_string ( std::string  val,
std::ostream &  serr 
)

Throw invalid_argument error for unrecognized strings.

Prints to serr:

Invalid CoordType: mistakevalue
Options are:
CART or cart
FRAC or frac or DIRECT or direct
INTEGRAL or integral

Definition at line 70 of file EnumIO.hh.

template<typename ENUM >
std::string CASM::to_string ( ENUM  val)

Return string representation of enum class.

Definition at line 83 of file EnumIO.hh.