Re: [protobuf] Parse from a iterator range possible?
I think your best bet is to construct an std::string from the iterator range, and then parse from that. STL-style iterators are awkward because they achieve polymorphism via templates. In order for the protobuf parser to be able to use arbitrary iterators directly, the whole parser would have to be an enormous template. This would be impractical for a lot of reasons. On Mon, Nov 15, 2010 at 1:30 PM, idleman wrote: > Hello everyone, > > I am just wondering if it should be possible to parse from a iterator > range? Say something like this: > > template > bool ParseFromRange(ForwardIterator, ForwordIterator); > > Is it possible? Could it easily be implemented? > > > Thanks in advance! > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to proto...@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. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@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.
Re: [protobuf] Parse from a iterator range possible?
It should be pretty straightforward to implement an io::ZeroCopyInputStream that provides the byte stream using these iterators. On Mon, Nov 15, 2010 at 1:30 PM, idleman wrote: > Hello everyone, > > I am just wondering if it should be possible to parse from a iterator > range? Say something like this: > > template > bool ParseFromRange(ForwardIterator, ForwordIterator); > > Is it possible? Could it easily be implemented? > > > Thanks in advance! > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to proto...@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. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@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.
[protobuf] Parse from a iterator range possible?
Hello everyone, I am just wondering if it should be possible to parse from a iterator range? Say something like this: template bool ParseFromRange(ForwardIterator, ForwordIterator); Is it possible? Could it easily be implemented? Thanks in advance! -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@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.