In this case, it looks like there isn’t a root.  Rather, this format is a 
series of top-level parameters.  So, I have to give it the Parameter I’m 
looking for.  The problem I have with this is the order of parameters _might_ 
matter, and I lose that by only looking for one.

On Dec 10, 2017, at 8:35 AM, Marc Gravell 
<[email protected]<mailto:[email protected]>> wrote:

as I ubderstand it, --decode *will do that*. it doesn't decode *just* the root 
: but, it needs to know the root message type in order to correctly interpret 
the data

On 10 Dec 2017 4:32 p.m., "Jim Baldwin" 
<[email protected]<mailto:[email protected]>> wrote:
OK, this helps.  I need to figure out what the "root" message is.  It seems 
like an omission in the whole PB thing that you can't specify the .proto and do 
a --decode_everything.

On Sunday, December 10, 2017 at 8:23:12 AM UTC-8, Marc Gravell wrote:
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]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[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