Some feature requests for the Mojo C++ bindings.
I'm happy to contribute these, but I'd like to get thoughts from the owners first to see if these sound like a good idea or not.
(1)
I'm working on migrating the accessibility enums to mojo now, and there are a few places where we iterate over all possible values of an enum. Now that mojo generates enum classes, this is a bit uglier now (requires typecasting), but could be made even cleaner and more foolproof with autogenerated code.
Example places where we could use this:
https://cs.chromium.org/search/?q=<%3D.ax%5Cw%2Blast
We could either add an iterator (https://stackoverflow.com/questions/8498300/allow-for-range-based-for-with-enum-classes), or a function like ForAllMyEnum(void(*callback)(MyEnumValue));
(2)
Mojo generates a stream insertion operator now. It'd be nice to also provide ToString, and ParseString, which is useful for cases where we're sending an extension message from JavaScript back into C++ and the string value comes from a mojo enum.
Comment 1 by oksamyt@chromium.org
, Today (16 hours ago)