Given following code:

enum ErrorCode {
  BAD_REQUEST,
  UNKNOWN
}

ErrorCode code;

is there any way to get string representation of code with regard to values 
defined in enum? I mean - if code == 0, I'd like to get a string 
"BAD_REQUEST", if it's == 1, I'd like to get string a "UNKNOWN". Of course 
I'd like to use something more consise and elegant than a switch :)

-- 
Marek Janukowicz

Reply via email to