Re: [protobuf] Re: "This type does not have extensions"

2010-10-07 Thread Jesper Eskilson
2010/10/6 Kenton Varda : > This exception shouldn't be possible. > If you can produce a small, self-contained program that demonstrates the > problem, I could debug it.  Please make sure that the program is small (no > more than one .proto file and one source file) and runs quickly.  Probably > the

Re: byte array compare

2009-10-17 Thread Jesper Eskilson
On Sat, Oct 17, 2009 at 6:25 PM, Michael wrote: > > int compare(byte[] b1, int s1, >                            byte[] b2, int s2, >                            Descriptors.Descriptor type) > > I would love a method like this one. It would allow messages to be > used as keys in without the need fo

Re: Java compiler warning

2009-10-11 Thread Jesper Eskilson
Fair enough. On Fri, Oct 9, 2009 at 9:10 PM, Kenton Varda wrote: > Unfortunately, we (read: I) don't really have time to chase warnings.  If > you want it fixed, submit a patch.  Otherwise, ignore it -- the code does > the right thing. > > On Fri, Oct 9, 2009 at 1:16 AM, Jesper wrote: >> >> The

Re: Java compiler warning

2009-10-09 Thread Jesper Eskilson
On Fri, Oct 9, 2009 at 4:20 PM, Henner Zeller wrote: > On Fri, Oct 9, 2009 at 01:16, Jesper wrote: >> >> The Eclipse Java compiler issues a warning about a raw type: >> >> Description     Resource        Path    Location        Type >> GeneratedMessage.ExtendableMessage.ExtensionWriter is a raw

Re: Parsing messages in C++ with extensions

2009-09-06 Thread Jesper Eskilson
On Thu, Sep 3, 2009 at 6:56 PM, Kenton Varda 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 documentatio

Re: Parsing messages in C++ with extensions

2009-09-03 Thread Jesper Eskilson
On Fri, Aug 28, 2009 at 6:42 PM, Kenton Varda wrote: > To answer your specific question, BTW, yes, you can inspect the contents of > UnknownFieldSet.  Every message object has methods unknown_fields() and > mutable_unkown_fields() which return the UnknownFieldSet.  The API is > described here: >

Re: Parsing messages in C++ with extensions

2009-08-28 Thread Jesper Eskilson
On Fri, Aug 28, 2009 at 6:42 PM, Kenton Varda wrote: > Ouch, this hole is probably a lot deeper than it looks. > First let me review some things which you may already know... > I assume these "plugins" are DLLs.  Do you load and unload these plugins at > runtime, or just at startup?  If you unload

Re: Parsing messages in C++ with extensions

2009-08-27 Thread Jesper Eskilson
On Fri, Aug 28, 2009 at 1:28 AM, Kenton Varda wrote: > Yep, it's a very annoying problem.  The solution I prefer is to add a dummy > usage of one of the classes in your .proto somewhere high-up in your > program, in a place that should logically "know" that the file is needed. This is really not

Re: Parsing messages in C++ with extensions

2009-08-27 Thread Jesper Eskilson
On Thu, Aug 27, 2009 at 12:18 AM, Kenton Varda wrote: > Some linkers will drop object files that aren't referenced from anywhere, so > if your code doesn't actually use anything from the .proto file defining the > extension, it might not be linked in, and thus won't be in the registry. >  This is

Fwd: Parsing messages in C++ with extensions

2009-08-27 Thread Jesper Eskilson
I keep clicking on "reply" instead of "reply all"... -- Forwarded message ------ From: Jesper Eskilson Date: Thu, Aug 27, 2009 at 9:23 AM Subject: Re: Parsing messages in C++ with extensions To: Kenton Varda On Thu, Aug 27, 2009 at 12:18 AM, Kenton Varda w

Re: Parsing messages in C++ with extensions

2009-08-26 Thread Jesper Eskilson
On Wed, Aug 26, 2009 at 10:38 PM, Kenton Varda wrote: > In C++ all compiled-in extensions are automatically registered in a global > registry which is used automatically by all compiled-in classes.  I now > regret this design decision due to a number of subtle problems it creates, > but for you it

Parsing messages in C++ with extensions

2009-08-26 Thread Jesper Eskilson
How do you parse a message from a byte-steam which contains extensions? In Java, I can do ExtensionRegistry registry = ... registry.add(...); Foo.parseFrom(buf, registry) but I can't find any reference on how to do this in C++. -- /Jesper --~--~-~--~~~-

Re: C++ compilation errors when using extensions

2009-08-25 Thread Jesper Eskilson
On Tue, Aug 25, 2009 at 10:51 AM, Jesper Eskilson wrote: > I'm getting a C++ template error message I'm having trouble > understanding. I have two .proto files, one called "cdp.proto" which > defines ServiceCommand: Problem solved. I realized that I need to use the G

C++ compilation errors when using extensions

2009-08-25 Thread Jesper Eskilson
I'm getting a C++ template error message I'm having trouble understanding. I have two .proto files, one called "cdp.proto" which defines ServiceCommand: message ServiceCommand { ... extensions 200 to max; } This is then extended in "libsupport.proto", like this: message LibSupportMessage {

Re: assertion crash with debug build on windows

2009-07-17 Thread Jesper Eskilson
On Thu, Jul 16, 2009 at 11:14 AM, Mr Moose wrote: > > It is found! > > After 4 interesting days of debugging the bastard I realized that I > rercently had to add 3 preprocessor defines to my build system: > > _CRT_SECURE_NO_WARNINGS > _SECURE_SCL=0 > _HAS_ITERATOR_DEBUGGING=0 > > If they are missi

Re: Windows HANDLE and sockets / named pipes

2009-06-19 Thread Jesper Eskilson
(Sorry Kenton, I missed adding the list as recipient...) We're using a very simple approach where we send only one type of message containing a type-enum and one or more optional fields (I think this technique is described in the manual). In order to be able to read the message in full before par

Re: Thoughts on a cleaner Java protocol buffer compiler.

2009-05-02 Thread Jesper Eskilson
On Wed, Apr 29, 2009 at 11:27 PM, Kenton Varda wrote: >> My thinking on the current format is that Java developers are going to >> look at this and be all WTF and then walk away...  maybe it's just >> me ;) > > That's not the reaction I've seen from most Java devs. +1 from me. The protobufs

Re: Crash while initializing StaticDescriptorInitializer

2009-03-27 Thread Jesper Eskilson
On Fri, Mar 27, 2009 at 8:08 PM, Kenton Varda wrote: > On Fri, Mar 27, 2009 at 3:33 AM, Jesper Eskilson wrote: >> >> (BTW: I created a set of CMake (http://cmake.org) build files for >> Protobufs, in case you're interested in not maintaining parallell >> M

Re: Crash while initializing StaticDescriptorInitializer

2009-03-27 Thread Jesper Eskilson
On Thu, Mar 26, 2009 at 6:57 PM, Kenton Varda wrote: > On Thu, Mar 26, 2009 at 9:28 AM, Jesper wrote: >> >> I think so, but I'll double-check. (Wouldn't that have showed up when >> libprotobuf.lib was linked into the exe?) > > Unfortunately, probably not.  Strange crashes at runtime are the usua

Crash while initializing StaticDescriptorInitializer

2009-03-26 Thread jesper . eskilson
I have libprotobuf.lib linked into a DLL, and when loading the DLL, I get the following crash. (Noteworthy is that I previously hade the same code linked into a single exe, and then it worked without any problem.) Any clues about how I can solve this? CSpyServerLib.dll! std::_Tree,std::allocator