Public Types | |
enum | fruit { badEnum, apples, oranges, pears, peaches, lastEnum } |
Public Methods | |
virtual const fruit | enumVal (const char *name) |
Given a C string, return the associated enumeration value. More... | |
virtual const char * | enumName (fruit val) |
Given an enumeration value, return the association string. More... | |
Private Attributes | |
EnumTranslate< fruit > | t |
The template is instantiated with the local enumeration set fruit.
Definition at line 146 of file enumTranslate.cpp.
|
Definition at line 148 of file enumTranslate.cpp. 00148 { 00149 badEnum, 00150 apples, 00151 oranges, 00152 pears, 00153 peaches, 00154 lastEnum } fruit; |
|
Given an enumeration value, return the association string. If the enumeraton value is out of range, the function will assert() Definition at line 168 of file enumTranslate.cpp. Referenced by main().
00169 { 00170 assert( val > badEnum && val < lastEnum ); 00171 return t.enumName( val ); 00172 } |
|
Given a C string, return the associated enumeration value.
Definition at line 161 of file enumTranslate.cpp. 00162 { 00163 return t.enumVal( name ); 00164 } |
|
Definition at line 157 of file enumTranslate.cpp. |