On Thu, Sep 3, 2009 at 6:56 PM, Kenton Varda<ken...@google.com> wrote:
> You want:
>   const UnknownFieldSet& set = cmd.GetReflection()->GetUnknownFields(cmd);

Ok, so if I have function which receives a message which as an unknown
field which I need to parse into a "real" message, how should I do?
(The documentation is a little fuzzy on this...)

I tried to call ParseFromString() on the string returned by
length_delimited(), but that just crashed.

  const UnknownFieldSet& set = cmd.unknown_fields();
  const UnknownField f = set.field(0);
  const std::string &buf = f.length_delimited();

  listwindow::ListWindowCommand lwc;
  lwc.ParseFromString(buf);

-- 
/Jesper

--~--~---------~--~----~------------~-------~--~----~
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