#include <EnumDictionary.h>
Enum | Enumerated type |
size | Value of the last valid entry of the enumerated type |
// the enum type enum MyEnum { SomeValue = 1, SomeOtherValue = 2, TheLastValue = 4 }; // the strings matching the enum values static const SI_Char* g_szMyEnumStrings[] = { "SomeValue", "SomeOtherValue", "TheLastValue" }; // The Enum dictionary to convert from enum to string // or string to enum CEnumDictionary<MyEnum, TheLastValue> l_dict( g_szMyEnumStrings );
|
Constructor.
// example of typical in_ppStringArray static const SI_Char* g_szMyEnumStrings[] = { "SomeValue", "SomeOtherValue", "TheLastValue" }; |
|
Convert from string to enum.
CEnumDictionary<EnumType, LastEnumValue> l_EnumDict(g_szMyEnumStrings); EnumType l_EnumValue; if (!l_EnumDict.ToEnum(l_EnumValue, "LastEnumValue")) { // conversion failed } |
|
Convert from enum to string.
CEnumDictionary<EnumType, LastEnumValue> l_EnumDict(g_szMyEnumStrings); const SI_Char *l_szStringValue = l_EnumDict.ToString(LastEnumValue); |
© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.