No need for a case statement. Since you have an enum table and if they use the default sequencing equate 0, 1, 2, etc. then use an ASCII table lookup that matches 0 based enum to table index. You may want to put an assertion on runtime to make sure the highest enum has an ASCII equivalent in the table!
If you add a bunch of restrictions to make table lookup work. ;) Both ways are valid, and it depends on the situation. It is not uncommon for the values in an enumeration to span a large range and be very sparse within that range. Table lookups are not as attractive in that case.
Anyway, thank you for giving another example of explicitly mapping strings to enumerations. I assumed that one simple example would be enough to get the creative juices flowing, but I have been wrong before.
Not a problem. As I mentioned the table lookup only works out if a sequential set of enums is used. Then the case statement is the better selection.
Having posted here, means trying to teach about multi-table lookups in conjunction with case statements is too complicated a concept so I didn't mention it!
And of course case is a tad safer by merely inserting the default! With a table lookup and extra conditional check has to be made to make sure the source value being referenced is valid and not out of range thus invalid!