You can and it does. The problem is that the wire format by itself doesn't
tell it **what message type** the root object is. So you need to tell it in
the additional parameter to --decode

On 10 Dec 2017 3:14 p.m., "Jim Baldwin" <[email protected]> wrote:

It's not really just a sequence; it's a hierarchy, isn't it?  Why can't I
use --decode <root> or something like that?


On Saturday, December 9, 2017 at 4:20:15 PM UTC-8, Ilia Mirkin wrote:

> On Sat, Dec 9, 2017 at 5:52 PM, Jim Baldwin <[email protected]> wrote:
> > I have a protobuf file, and a .proto file that describes the schema.
> >
> > The .proto describes dozens of different messages that may be in the
> > protobuf file.
> >
> > I would like to know what messages can be found in the file.  I do a
> protoc
> > --decode_raw and get something out, but I don't see how to use that to
> > figure out how to extract messages from the file.
> >
> > I assume there's something I don't get about protobufs, but it seems to
> me I
> > should be able to take a protobuf data file and corresponding .proto and
> > turn it into a file that lets me see what the message hierarchy is in
> the
> > file.  JSON would be a great way to do that.
> >
> > What am I missing?
>
> An encoded protobuf is just a sequence of (tag, value) pairs. If you
> don't know which proto it is, decode_raw is the best you can do. If
> you do know which proto it is, you can use --decode instead and pass
> it a proto name to use for the decoding.
>
> Cheers,
>
>   -ilia
>
-- 
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to