get_value_by_name


Description:

public T get_value_by_name<T> (string name) throws EnumParseError

Retrieves the enum value for the given string name. The string name is the value obtained when calling to_string () on an enum value.

// Result: ``true``
MyEnum.FOO == Catalyst.EnumUtils.get_value_by_name<MyEnum> (MyEnum.FOO.to_string ());

It is an assertion error to provide a non-enum class as the type argument.

Parameters:

name

the string name value

Returns:

the enum value

Exceptions:

Catalyst.EnumParseError

if no enum value exists with the given name


Namespace: Catalyst.EnumUtils
Package: catalyst-1