Comment #4 on issue 336 by [email protected]: Support generic string
type
http://code.google.com/p/protobuf/issues/detail?id=336
Hi,
As I replied in the group, there's always the possibility of achieving this
with a plugin.
GPB probably won't support custom strings classes as the actual members,
but it's quite easy to add 'setters' that takes some other user defined
classes and assign/convert them into a string, or even templated setters
like the one suggested here (not that I thinks this is a good idea).
I'd suggest writing a plugin that adds setters to the custom string classes
your code base is using, this is safer than adding the templated setter,
and quite easy to do; relying on the plugin API provided by GPB and the
well known (and halfway documented) insertion points of the c++ code
generator, you can add specific methods for each string member in your
messages. This way you get what you wanted and the GPB code-base remains
clean and solid.
Eyal.
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.