[protobuf] Re: A bit more protobuf help please

2011-10-11 Thread Dale Durham
I get that (kind of), but in the sample you posted, when the call to "FileDescriptor fddd = fdl.get(dependencyList.get(i));" is made the is nothing in fdl because nothing was ever "put" onto it at that point. So like said either I am missing something or there is a step missing here... final FileD

[protobuf] Re: A bit more protobuf help please

2011-10-11 Thread Dale Durham
Never mind, I figured it out. My descriptor files are named differently. So when the dependency list is passed, I get xxx.proto and the file that I really want is xxx.desc. I guess I'll have to parse the extension out, change it then put the correct ones into fdl. Dale On Oct 11, 9:36 am, Dale Du

Re: [protobuf] creating a message from another but changing only one field

2011-10-11 Thread marco gaddoni
thank you You suggest that this is the best way? ..Foo oldfoo = get_from_elsewhere(); ..Baz newbaz = oldfoo.c1.toBuilder().set_f1(42).Build(); ..Foo newfoo = oldfoo.toBuilder().set_c1(newbaz).Build(); ..send_somewhere(newfoo); i see this problematic if i have messages nested in messages Il

Re: [protobuf] creating a message from another but changing only one field

2011-10-11 Thread Ron Reynolds
yes, it can be.  also i seem to remember when modifying a list of elements it's easier to clear the target list, iterate the source list and selectively copy over to the target list rather than try to modify the target list after it has been copied. From: marco

[protobuf] Simple client/server asynchronous protobuf packet channel with GnuTLS encryption for C++

2011-10-11 Thread Tero
Hello, I have been working on a library that combines protobuf, simple and hopefully portable TCP socket wrapper, and GnuTLS for data encryption. It's at https://github.com/tlaitinen/prototls The most important features are in place and the implementation is ready for testing. The Linux version w

[protobuf] TypeModel.DeserializeType(value) Exception Message request.

2011-10-11 Thread Lex
Hi, We have recently started using protobuf-net for some serialization tasks that we have. Our particular problem is that our serialized objects can live for possibly weeks at a time before we need to de- serialize them. In the mean time we may need to re-factor some of the namespaces of the nes

[protobuf] Re: Contribution: C++Builder Compiling

2011-10-11 Thread Scott Saad
A quick status update on this effort: - I forked the source at GitHub under the protobuf-cppbuilderproject. - The biggest overarching changes revolved around namespaces. These changes were minimal but touched many files. - Main caus

[protobuf] How to dynamically parse protobuf with extension messages

2011-10-11 Thread prem
On one machine, serialized a Message2, which has been extended from Message1. The parameters in Mesage2 were set using setExtension API. Did writeDelimitedTo to write to a byte outpurstream. Then ran protoc --include_imports --descriptor_set_out=message2.desc -- java_out=message2.proto On the ot

[protobuf] Re: How to dynamically parse protobuf with extension messages

2011-10-11 Thread Benjamin Wright
It sounds like you're working in Java. In Java you need to create, setup, and then provide an ExtensionRegistry 1) The way you do this is you create a new one... final ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance(); 2) then register any extensions you have

Re: [protobuf] TypeModel.DeserializeType(value) Exception Message request.

2011-10-11 Thread Marc Gravell
In standard use, protouf-net is fully contract based and doesn't care what *types* are involved; this only matters if you are using the DynamicType option (which is outside the core protobuf stuff). If the types aren't stable, there is an event on the TypeModel that can be used to map in both di

[protobuf] Re: A bit more protobuf help please

2011-10-11 Thread Benjamin Wright
Dale - sounds like you figured it out, but the quick answer anyway (for anyone else listening...) The code I provided expects that the Descriptor files you have are created with the "--include_imports" directive provided to protoc... which means that all the imported files will be included in the

[protobuf] XML or XSD to .proto files

2011-10-11 Thread Jerry
Is there an existing tool for generating .proto files, or protobuf Messages themselves, from XML or an XSD ? If no such tools exist in wide use, what would be a good starting point for rolling my own .proto file generator? Meaning, what API's or Utils in the protobuf lib might facilitate the creat

[protobuf] ParseFromArray or ArrayInputStream+ParseFromZeroCopyStream?

2011-10-11 Thread Jim Hunziker
Is there a difference between using ParseFromArray and using ParseFromZeroCopyStream on an ArrayInputStream? For a plain buffer of data, is the behavior different when using these two methods? Also, is it necessary to call Next() in a loop when using ArrayInputStream+ParseFromZeroCopyStream? --

[protobuf] Re: A bit more protobuf help please

2011-10-11 Thread Dale Durham
Thanks again for all your help Benjamin!!! I just got it all working and would still probably be tinkering without your help. Dale On Oct 11, 9:52 am, Dale Durham wrote: > Never mind, I figured it out. My descriptor files are named > differently. So when the dependency list is passed, I get xxx.

Re: [protobuf] Trying to create a new message from command line input

2011-10-11 Thread Christopher Head
What seems to be the problem? I just created a simple test case that seems to work perfectly. My proto file looks like this: message Outer { message Inner { required int32 foo = 1; } optional Inner inner = 1; } My C++ source file looks like this: #inc

[protobuf] Re: How to dynamically parse protobuf with extension messages

2011-10-11 Thread prem
Thanks for the info. this solution requires the Class MyMesage be present on the receiving side. I was trying to just use the description-out file created by the protoc tool. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this gr

[protobuf] Re: How to dynamically parse protobuf with extension messages

2011-10-11 Thread Benjamin Wright
In that case I recommend you browse through my recent discussion with Dale Durham as I walked him through the process of using the FileDescriptorSet's that are created when you compile using the -- descriptor_set_out flag to protoc or can obtain from another runtime that has access to compiled prot

[protobuf] Re: How to dynamically parse protobuf with extension messages

2011-10-11 Thread prem
Thanks, that was the missing part, got it working with the desc file, without the need for the MyMessage class. on the way with the above code I got error: java.lang.IllegalArgumentException: ExtensionRegistry.add() must be provided a default instance when adding an embedded message extension.