40 template<
class Enum >
43 using ValuesType = std::initializer_list< std::pair< Enum, const char * > >;
45 Enum
Read(
const char * source,
Context const * context )
const
49 if( strcmp( source, value.second ) == 0 )
54 ss<<
"Can not read string '"<<source<<
"' as type "<<
typeid( Enum ).name()<<
".\n";
55 ss<<
" possible values: ";
57 ss << value.second <<
" ";
64 std::string
Write( Enum
const & value,
Context const * context )
const
68 if( value == val.first )
74 ss << (
typename std::underlying_type< Enum >::type)value;