CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
Helpers for enum class IO.
Functions | |
template<typename ENUM > | |
std::string | CASM::multiline_enum_help () |
Print help message describing recognized strings for allowed enum values. More... | |
template<typename StringContainer > | |
std::string | CASM::standard_singleline_help (StringContainer options, std::string _default="") |
Print short help message describing recognized strings for allowed enum values. More... | |
template<typename ENUM > | |
std::string | CASM::standard_singleline_enum_help (std::string _default="", std::string other="") |
Print short help message describing recognized strings for allowed enum values. More... | |
template<typename ENUM > | |
std::string | CASM::singleline_enum_help () |
Print short help message describing recognized strings for allowed enum values. More... | |
template<typename ENUM > | |
void | CASM::invalid_enum_string (std::string val) |
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 > | |
std::set< ENUM > | CASM::matches (const std::string &val) |
Return all matching enum class members from string representation. More... | |
template<typename ENUM > | |
ENUM | CASM::from_string (const std::string &val) |
Return enum class object from string representation. More... | |
ENUM CASM::from_string | ( | const std::string & | val | ) |
Return enum class object from string representation.
Definition at line 202 of file io_traits.hh.
void CASM::invalid_enum_string | ( | std::string | val | ) |
Throw invalid_argument error for unrecognized strings.
Prints to serr:
Definition at line 158 of file io_traits.hh.
std::set<ENUM> CASM::matches | ( | const std::string & | val | ) |
Return all matching enum class members from string representation.
Matches using substr of length val.size(), so "FRAC" matches for "F", "FR", "FRA", "FRAC", "FRAC.*".
Definition at line 184 of file io_traits.hh.
std::string CASM::multiline_enum_help | ( | ) |
Print help message describing recognized strings for allowed enum values.
Of form:
Definition at line 47 of file io_traits.hh.
std::string CASM::singleline_enum_help | ( | ) |
Print short help message describing recognized strings for allowed enum values.
Of form:
Definition at line 139 of file io_traits.hh.
std::string CASM::standard_singleline_enum_help | ( | std::string | _default = "" , |
std::string | other = "" |
||
) |
Print short help message describing recognized strings for allowed enum values.
Of form:
or (if other.empty()):
Definition at line 115 of file io_traits.hh.
std::string CASM::standard_singleline_help | ( | StringContainer | options, |
std::string | _default = "" |
||
) |
Print short help message describing recognized strings for allowed enum values.
options | List of options |
_default | If not empty, the option to indicate as default |
Of form:
or (if other.empty()):
Definition at line 83 of file io_traits.hh.
std::string CASM::to_string | ( | ENUM | val | ) |
Return string representation of enum class.
Definition at line 172 of file io_traits.hh.