Provides mapping between a C++ enum type values and C strings.
More...
#include <cpptools/enum_string_map.h>
|
typedef std::pair< ENUM, const
char * > | Mapping |
|
template<typename ENUM>
class cpp::EnumStringMap< ENUM >
Provides mapping between a C++ enum type values and C strings.
enum class Status {
Started,
Running,
Finished
};
statusStrMap.
map(Status::Started,
"status_started");
statusStrMap.
map(Status::Running,
"status_running");
statusStrMap.
map(Status::Finished,
"status_finished");
assert(statusStrMap.
value(
"status_running") == Status::Running);
assert(std::strcmp(statusStrMap.
string(Status::Running),
"status_running") == 0);
The documentation for this class was generated from the following file: