Re: Get friendly name of struct
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Tue, 19 Jul 2005 15:20:44 -0500
On Tue, 19 Jul 2005 14:18:45 -0400, Bob wrote:
> Is there any way to get the value name of an enumeration as a string?
In native C++, you have to create a map between enum values and string
representations. For a dense range of values, particularly one that starts
with the value zero, you can use an array. More generally, you can use an
associative array like std::map.
--
Doug Harrison
Microsoft MVP - Visual C++
.
Relevant Pages
- Re: Regarding use of ArrayList as value in Hashtable
... say, for example,the value is a String array, with String array then we ... Lists, Integers, and Strings. ... An object splits the stream of characters into tokens of type: MAP, ... enum BContainers{ ... (comp.lang.java.programmer) - Enum mit Map verallgemeinern
... Ich hätte gerne eine Enum mit einer integrierten Map, die es mir erlaubt über den Wert die entsprechende Enum zu ermitteln. ... private static Map<String, FontWeight> map; ... private final String fontWeight; ... (de.comp.lang.java) - Re: enums: What the H? again
... > find no sign of it in the Enum class until I did a decompile and saw ... > private String shortName; ... > private static InDir currentState = UNKNOWN; ... (comp.lang.java.programmer) - Re: enums: What the H? again
... Everything comes clear when you decompile an enum, ... private String shortName; ... private static InDir currentState = UNKNOWN; ... (comp.lang.java.programmer) - A Class to get the name of Enum constant at runtime
... Dim rs As ADODB.Recordset ... You can get the description of an Enum form it's value. ... EnumName As String, ... Dim Idx As Long ... (microsoft.public.vb.general.discussion) |
|