[Vala] Working with enums in Vala
- From: Martin Olsson <mnemo minimum se>
- To: Mailing List Vala <vala-list gnome org>
- Subject: [Vala] Working with enums in Vala
- Date: Wed, 12 Nov 2008 22:12:29 +0100
Hi,
What do people do in Vala today in order to:
A) print an enum value to the screen? (in C# Enum.GetName() can be used)
B) Convert an int or string to some enum? (for instance if you have the int 3 but the enum only contains 1
and 2 then I want some runtime error. In C# this would be the Enum.Parse() method).
Ideally I don't want to implement these functions myself because then I must update the functions whenever I
change the enum (that will be unnecessarily error prone).
Martin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]