It appears to me that there is no easy way to do so.

It's pretty clear that there's no "print this protocol buffer with this
format string".  My reasoning is as follows - the description for such a
format string would be quite long and I'd almost certainly have seen it
already, or have seen it in this fast lookthrough.

So you'd either need to override some methods, or pass in functions to do
part of the work, or have functional or method parts with a lot of options
to  call.

Reading around the code to do this seem to inevitably get you to
google/text_format.h - but none of the methods there are virtual, nor are
there helper functions being passed around.

Or, searching the header files for the string "virtual" doesn't show you
anything either.

I'd welcome correction from someone who's more in touch with the internal
code than I!


Protocol buffer reflection isn't hideously difficult - the best way is
probably to roll your own that way if you really need to.

On Sat, Dec 24, 2011 at 1:48 PM, brt56 <cuthbert....@gmail.com> wrote:

> All
>
> Is there a way to format the way the toString is printed out on a
> protobuf message?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>


-- 
     /t

http://radio.swirly.com - art music radio 24/7 366/1000

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to