GNOME Bugzilla – Bug 749360
Add to_string() functions for enums and flags
Last modified: 2015-05-14 10:31:09 UTC
This is useful for debugging. It would be nice, for usability, to also have a function which took a GType and not just GEnumsClass/GFlagsClass. In fact for GEnumsClass it is so easy to get the to_string() value that it might make sense to not have a function for it and only have one taking a enum GType. Builder currently has a flags_to_string() function used for debugging: https://git.gnome.org/browse/gnome-builder/tree/contrib/egg/egg-binding-set.c#n80
Thanks for taking the time to report this. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 447907 ***
Created attachment 303357 [details] [review] Add to_string() functions for Enum and Flags types
Bug 447907 is about adding from_string() functions, this is about adding to_string() functions.
Should still consolidate the enumeration/string type conversion into a single bug instead of having two of them, especially if we want to roundtrip between enum and string.
(In reply to Emmanuele Bassi (:ebassi) from comment #4) > Should still consolidate the enumeration/string type conversion into a > single bug instead of having two of them, especially if we want to roundtrip > between enum and string. Makes sense, closing again. Sorry for the noise! *** This bug has been marked as a duplicate of bug 447907 ***