rainwoodman / libyaml-glib

Building GObjects with YAML
10 stars 5 forks source link

Flags support #5

Closed rainwoodman closed 14 years ago

rainwoodman commented 14 years ago

Is the annotation [Flags] still available in Vala?

The flag operations: () | & ~

For now probably only implementing "|" will be sufficient. The program can always convert the flags to "|", and that is what glib does with g_flags_xxx anyways.

sanpii commented 14 years ago

Yes: http://git.gnome.org/browse/vala/tree/vala/valaenum.vala#n241

For my information, have an example of this feature?

rainwoodman commented 14 years ago

I haven't implemented this yet but the idea is to write flags as follows: (saying we have a used car object and features field describes the features on the car)

FEATURES: ABS | AIRBAG | AUTOMATIC_WINDOW | REMOTE_ENTRY

rainwoodman commented 14 years ago

pushed as a59ab7b..5e3dd92. tests/invoice-example also added.