On Fri, Jan 23, 2015 at 4:45 AM, PaweÅ‚ Zatorski <[email protected]>
wrote:

> Hi,
>
> In my project i am using protocol buffers in two modes: text and binary.
> Sometimes it happend that same data once serialized in text format is
> deserialized correctly and when using binary format parsing method returns
> false. I tried to created some parsing error handling code and i came to
> such solution, for text format:
>         std::fstream input( path, std::ios::in | std::ios::binary );
>         google::protobuf::io::IstreamInputStream inputt( & input );
> google::protobuf::TextFormat::Parser parser;
>         parser.RecordErrorsTo(&err); //err - custom class
> implementing google::protobuf::io::ErrorCollector
>         result = parser.Parse(&inputt, &data);
>
> My question is, is it possible to create similar code for binary format (
> i mean error recording ). For now my parsing code in binary format looks
> like:
>         std::fstream input( path, std::ios::in | std::ios::binary );
>         result = data.ParseFromIstream( & input );
>
> No. Detailed error reporting is not available for parsing binary data,
partially because additional error handling will hinder the parsing
performance.


>  --
> 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 http://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 http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to