Re: [protobuf] Re: 2.4 release?

2010-11-02 Thread Pherl Liu
It's on the SVN head now, see http://code.google.com/p/protobuf/source/detail?r=349 Will make a release candidate soon. On Wed, Nov 3, 2010 at 1:02 AM, Zachary Turner divisorthe...@gmail.comwrote: Just wanted to follow up on this and see if this is still on target to be released within a month

Re: [protobuf] 2.4.0 not compiling lite version for Java

2011-01-27 Thread Pherl Liu
Thanks for reporting this. Working on a fix now. On Thu, Jan 27, 2011 at 4:12 AM, Michael michael.ol...@gmail.com wrote: Using the normal mvn package/install commands, the size of the jar files generated by Maven for 2.4.0 is identical for the normal and lite versions. This is not true under

Re: [protobuf] 2.4.0 not compiling lite version for Java

2011-01-27 Thread Pherl Liu
can update the pom.xml with this one: http://protobuf.googlecode.com/svn-history/r373/trunk/java/pom.xml Thanks. On Thu, Jan 27, 2011 at 10:12 PM, Pherl Liu liuj...@google.com wrote: Thanks for reporting this. Working on a fix now. On Thu, Jan 27, 2011 at 4:12 AM, Michael michael.ol

Re: [protobuf] 2.4.0 release?

2011-01-27 Thread Pherl Liu
It isn't officially announced yet, but the files are on the site, feel free to try it out. We are still working on the documentation. The final release would be very soon. On Thu, Jan 27, 2011 at 4:17 AM, CB cn...@verizon.net wrote: I'm considering updating from 2.3.0 to 2.4.0, but it seems

[protobuf] 2.4.0a released.

2011-02-02 Thread Pherl Liu
The final release of 2.4.0a Protobuf is uploaded: http://code.google.com/p/protobuf/downloads/list Note that 2.4.0a fixed a java protobuf-lite build problem in 2.4.0. If you are using the 2.4.0 version, please upgrade to 2.4.0a (the only diff is the java protobuf-lite problem). Documentation

Re: [protobuf] v2.4 question

2011-02-02 Thread Pherl Liu
2.4.0a is officially released now. Please check: http://code.google.com/p/protobuf/downloads/list On Wed, Feb 2, 2011 at 3:12 AM, David Dabbs dmda...@gmail.com wrote: Hello. From what I gather catching up on list messages, 2.4 is final, but not officially released, perhaps because some

Re: [protobuf] Protobuf 2.4 and Android

2011-02-04 Thread Pherl Liu
The protobuf in android source code is a branched protobuf for google voice, which is not intended for public use, and may change in the future. Generally, you should use the opensource version of protobuf in your app, set the option optimize_for = LITE_RUNTIME; in your proto file and use the

Re: [protobuf] Circular package import problem

2011-02-07 Thread Pherl Liu
You probably need to break up your proto files to eliminate the circular dependency.. (i.e. have multiple .proto files for a package, and only import necessary .proto files). On Mon, Feb 7, 2011 at 5:42 PM, Ken ke.lane@gmail.com wrote: Hi, I have two proto files: A.proto and B.proto. If I

Re: [protobuf] Re: Compilation error for ppc/440 target

2011-02-09 Thread Pherl Liu
A workaround is now in svn: http://code.google.com/p/protobuf/source/detail?r=380 Could you please try patch the diff to check if that fixes the problem? Thanks. On Fri, Feb 4, 2011 at 11:06 PM, dear chap dear.c...@gmail.com wrote: Unfortunately we have to use the particular compiler in

Re: [protobuf] About import

2011-03-03 Thread Pherl Liu
Right. Please see the document in http://code.google.com/apis/protocolbuffers/docs/proto.html The protocol compiler searches for imported files in a set of directories specified on the protocol compiler command line using the -I/--proto_pathflag. If no flag was given, it looks in the directory in

Re: [protobuf] python/setup.py

2011-03-24 Thread Pherl Liu
I'm a bit concerned about setting arbitrary proto compiler via environment variables. Protobuf runtime library requires exactly matching protoc generated classes to work. Separating the protoc and library potentially increased the risk of having incompatibility errors. Not sure if this would bring

Re: [protobuf] python/setup.py

2011-03-24 Thread Pherl Liu
OK, it turns out we will use whatever protoc in the PATH as a fail over. This change is probably fine then. Sent you a code review. Also add a warning message if the protoc is set via env variable. On Thu, Mar 24, 2011 at 5:48 PM, Pherl Liu liuj...@google.com wrote: I'm a bit concerned about

Re: [protobuf] Re: How to Programmatically determine the Builder method names (getter and setter) for a given field name

2011-03-24 Thread Pherl Liu
You can find the algorithm in source code. http://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/compiler/java/java_helpers.cc On Wed, Mar 16, 2011 at 2:42 PM, Ravi ravikumarkulan...@gmail.com wrote: Hi Thanks a lot for your time. Yes the approach looks very clean as the

Re: [protobuf] Android Cross Compile

2011-03-24 Thread Pherl Liu
Looks like pthread library is missing. This should have been covered by the acx_pthread.m4 script. Could you please try to manually run the linker(the g++ line you pasted in email), by adding extra -pthread and/or -lpthread parameters? On Thu, Mar 10, 2011 at 3:42 AM, Evol mverre...@gmail.com

Re: [protobuf] Android Cross Compile

2011-03-24 Thread Pherl Liu
message, it seems android NDK doesn't require any flags to link pthread... On Thu, Mar 24, 2011 at 8:31 PM, Pherl Liu liuj...@google.com wrote: Looks like pthread library is missing. This should have been covered by the acx_pthread.m4 script. Could you please try to manually run the linker(the g

Re: [protobuf] Java: Protobuf jars compatibility (2.4.0 with 2.0.3)

2011-04-07 Thread Pherl Liu
No, there's no version backward-compatibility like this. protobuf library only works with the matching protoc generated files. There's a feature requesthttp://code.google.com/p/protobuf/issues/detail?id=210q=status%3DAcceptedcolspec=ID%20Type%20Status%20Priority%20FixedIn%20Owner%20Summaryasking

Re: [protobuf] Search inside a protocolbuffers file

2011-04-07 Thread Pherl Liu
protobuf officially does not provide this function. There might be some 3rd party libraries though. On Thu, Apr 7, 2011 at 4:38 PM, Sankar sankar.curios...@gmail.com wrote: Hi, I am trying to use protocolbuffers as a storage database for my application, as it provides data-format-versioning

Re: [protobuf] Search inside a protocolbuffers file

2011-04-19 Thread Pherl Liu
sankar.curios...@gmail.comwrote: On Thu, Apr 7, 2011 at 8:07 PM, Sankar P sankar.curios...@gmail.com wrote: On Thu, Apr 7, 2011 at 3:06 PM, Pherl Liu liuj...@google.com wrote: protobuf officially does not provide this function. There might be some 3rd party libraries though. I did

Re: [protobuf] Re: Issue 270 in protobuf: Precompiled protoc binary for OS X

2011-04-21 Thread Pherl Liu
This is due to the gcc 3.x bug. A workaround is submitted in svn r380http://code.google.com/p/protobuf/source/detail?r=380. You can use svn head version, or patch the r380, or wait for the coming 2.4.1 release (soon). On Fri, Apr 22, 2011 at 2:19 AM, Inderjeet Singh inder...@gmail.com wrote: I

Re: [protobuf] Re: Issue 270 in protobuf: Precompiled protoc binary for OS X

2011-04-21 Thread Pherl Liu
Also, you can upgrade your gcc to 4.3+ if possible. On Fri, Apr 22, 2011 at 11:58 AM, Pherl Liu liuj...@google.com wrote: This is due to the gcc 3.x bug. A workaround is submitted in svn r380http://code.google.com/p/protobuf/source/detail?r=380. You can use svn head version, or patch

Re: [protobuf] Reusing builders. . .

2011-04-24 Thread Pherl Liu
You might want to have a benchmark for this. Allocation in Java is cheap, but would increase the GC costs; resetting builder will introduce some CPU overhead (recursively setting data members and bit masks). On Fri, Apr 22, 2011 at 6:15 AM, David Dabbs dmda...@gmail.com wrote: Hello. I have a

Re: [protobuf] Re: adding submessages to higher message

2011-04-24 Thread Pherl Liu
Yes, you should use AddAllocated() in this case. Noted that the ownership of the object will be passed to the wrapper proto. On Thu, Apr 21, 2011 at 7:12 AM, Aaron Rich aaron.r...@gmail.com wrote: I found the method: AddAllocated(Element*) which I think will add the Pong* that I have already

Re: [protobuf] mvn test failing

2011-04-27 Thread Pherl Liu
Looks like a classpath problem for the easy mock.. Could you please double check if net.sf.cglib.proxy.Enhancer is installed and set in the classpath of your environment? On Thu, Apr 28, 2011 at 3:40 AM, danbaatar danwalke...@gmail.com wrote: I am trying to compile version 2.3.0 (for

Re: [protobuf] mvn test failing in 2.4.0a java subproject

2011-04-27 Thread Pherl Liu
I see, so you are using JDK1.5. Will send out a fix for this. On Thu, Apr 28, 2011 at 12:07 AM, CRozeboom clrozeb...@gmail.com wrote: I installed maven and am trying to build the java jar files for a project. I've tried this on a Windows XP and Ubuntu 10.10 system with the same results. I've

Re: [protobuf] Error in java Main

2011-04-28 Thread Pherl Liu
This is because JDK 1.5 doesn't allow @Override to annotate a method that implements part of an interface. The compatibility issue is fixed in svn http://code.google.com/p/protobuf/source/detail?r=384 You can either patch the diff, or wait for the next release (2.4.1) soon. On Wed, Apr 20, 2011

[protobuf] 2.4.1 released.

2011-04-30 Thread Pherl Liu
The v2.4.1 Protobuf is uploaded: http://code.google.com/p/protobuf/downloads/list v2.4.1 is a bug fix release for v2.4.0 and v2.4.0a. CHANGES 2011-05-01 version 2.4.1: C++ * Fixed the frendship problem for old compilers to make the library now gcc 3 compatible again. * Fixed

Re: [protobuf] Re: MSVC 2010 x64 build fails tests

2011-05-13 Thread Pherl Liu
Strange, looks like the serialization parsing are completely broken in MSVC 2010. Have you ever installed early versions? Could you please try a clean build? On Tue, May 10, 2011 at 8:53 PM, Mark S m...@bakedbeans.com wrote: This also fails with the new 2.4.1 release using MSVC 2010 SP1. --

Re: [protobuf] Re: Generated hashcode() returns different values across JVM instances?

2011-05-16 Thread Pherl Liu
We discussed internally and decided not to make the hashCode() return deterministic result. If you need consistent hashcode in different runs, use toByteString().hashCode(). Quoted from Kenton: Hashing the content of the descriptor would actually be incorrect, because two descriptors with

Re: [protobuf] protobuf-2.4.1 (java) build problems

2011-05-24 Thread Pherl Liu
Does setting higher heap memories in jvm flags(i.e. -Xmx) help? On Mon, May 23, 2011 at 4:23 PM, bogl sviridov...@gmail.com wrote: Hello I'm trying to create generated-sources and generated-test-sources files for protobuf-2.4.1 (java), but getting an error message: [INFO]

Re: [protobuf] Python ParseFromString always returns None

2011-05-24 Thread Pherl Liu
+robinson The ParseFromString() in python now always returns None. Note the MergeFromString() returns the number of bytes read, but there's a TODO to make that always return None. Will may have some ideas about this. On Sat, May 21, 2011 at 4:22 PM, jsia jsi...@gmail.com wrote: Hi, I created

Re: [protobuf] Optional,Repated fields and Submessages

2011-06-02 Thread Pherl Liu
On Wed, Jun 1, 2011 at 3:45 PM, aara aara.cool...@gmail.com wrote: I actually have 3 questions. 1.When we specify default values for optional fields,the default value gets assigned automatically when we ourselves dont assign it a value. But why doesnt the has_member field get set to 1??? It

Re: [protobuf] How can I set multi proto_path

2011-06-02 Thread Pherl Liu
Yes, you can. See: http://code.google.com/apis/protocolbuffers/docs/proto.html#generating On Wed, Jun 1, 2011 at 2:39 PM, jonason jonason...@hotmail.com wrote: can I set multi proto_path? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group.

Re: [protobuf] Numeric range not supported?

2011-06-02 Thread Pherl Liu
We also have another internal thread talking about the restriction support for protobuf. Basically we think the restriction or value validation function of protobuf should be implemented in the upper layer due to various concerns.. On Mon, May 30, 2011 at 6:54 PM, Marco Tedone

Re: [protobuf] Problem with reading class

2011-06-02 Thread Pherl Liu
That one will parse from binary encoded data. Looks like your sample_message.txt is in ASCII format. In short: Binary format: serialize: msg.writeTo() / msg.toByteArray() parsing: MyMessage.parseFrom() / builder.mergeFrom() ASCII format: serialize: msg.toString() / TextFormat.printToString()

Re: [protobuf] Best Practices on updating generated Message object

2011-06-02 Thread Pherl Liu
You can probably use sub-builders in this case: e.g. myBuilder.getPriceBuilder().setValue(123); See http://code.google.com/apis/protocolbuffers/docs/reference/java-generated.html#messagein sub builders section. On Thu, May 26, 2011 at 2:58 PM, veaven vea...@gmail.com wrote: Hi, What's the

Re: [protobuf] How to convert Descriptors.Descriptor to Java class name?

2011-06-20 Thread Pherl Liu
Quoted from our internal discussion by Kenton: You should build a MapDescriptor, Message upfront, mapping every descriptor you care about to the corresponding default instance. Avoid using Class objects because that will make your code incompatible with DynamicMessage. Using default instances

Re: [protobuf] Copy nested repeated messages

2011-06-21 Thread Pherl Liu
This shouldn't happen.. That means your unfiltered C also contains uninitialized messages.. Did you add new required fields in your .proto file (or change optional to required)? On Wed, Jun 8, 2011 at 5:55 AM, ksamdev samvel.khalat...@gmail.com wrote: Hi, I've got nested messages like:

Re: [protobuf] Dynamic deserialization of enums

2011-06-21 Thread Pherl Liu
This is because EnumValueDescriptor doesn't override toString(). You can use getName() and getValue() in the EnumValueDescriptor to read the value. EnumValueDescriptor is defined in com.google.protobuf.Descriptors On Sun, Jun 19, 2011 at 10:34 AM, Nik Hodgkinson 11x...@gmail.com wrote: I'm

Re: [protobuf] Uploading the maven-protoc-plugin to Maven Central?

2011-06-21 Thread Pherl Liu
+Gregory On Sun, Jun 19, 2011 at 4:16 PM, Marco Tedone marco.ted...@gmail.comwrote: Hi all, Is there a reason why the plugin hasn't been uploaded to Maven Central? If you want I could take ownership of that but then I'd have to be the owner of the com.google.protobuf Maven groupId, which I

Re: [protobuf] Undefined references to `google::protobuf::internal::kEmptyString'

2011-06-21 Thread Pherl Liu
protobuf-c is a 3rd party plugin/branch, which is not in official protobuf release. You may need to contact the author directly. On Tue, Jun 21, 2011 at 12:43 PM, Greg Corradini gregcorrad...@gmail.comwrote: Hello, I'm trying to compile protobuf-c-0.15 on Ubuntu-10.10. I've been running into

Re: [protobuf] installation in windows

2011-07-05 Thread Pherl Liu
Please take a look at the vsprojects/readme.txt On Wed, Jun 29, 2011 at 9:50 PM, Enrico Viappiani viappi...@gmail.comwrote: Let me ask a stupid question.. I have to install protobuf 2.4.1 C++, in windows 7 64 bit. I've done that in ubuntu, but i don't have seen the installation instruction

Re: [protobuf] How to use protoc --decode option?

2011-07-05 Thread Pherl Liu
The protoc reads the input from STDIN. If you pass the payload file name as parameter, protoc will treat that file as a .proto file. You should pipe the payload to protoc instead. On Tue, Jul 5, 2011 at 7:30 PM, Ravi ravikumarkulan...@gmail.com wrote: Hi, I am trying to convert a protobuf

Re: [protobuf] Re: How to use protoc --decode option?

2011-07-05 Thread Pherl Liu
. Failed to parse input. Thanks, Ravikumar K On Jul 5, 7:06 pm, Pherl Liu liuj...@google.com wrote: The protoc reads the input from STDIN. If you pass the payload file name as parameter, protoc will treat that file as a .proto file. You should pipe the payload to protoc instead

Re: [protobuf] Inserting values by tag numbers

2011-07-08 Thread Pherl Liu
Which language are you using? In c++, you can call message::GetDescriptor()-FindFieldByNumber() to get a FieldDescriptor; then call GetReflection()-Set* functions. On Fri, Jul 8, 2011 at 3:58 AM, SM makkapati.suma...@gmail.com wrote: Hello, Is there a way to set the field value by the tag

Re: [protobuf] Allocator Support for strings

2011-07-12 Thread Pherl Liu
In the common.h, we have a using namespace std;, and we use string directly in runtime libraries. However, we use ::std::string in generated file; you need to modify the proto compiler to support different string allocators. We do have custom allocator support in our TODO list internally, but

Re: [protobuf] Re: Inserting values by tag numbers

2011-07-12 Thread Pherl Liu
makkapati.suma...@gmail.com wrote: Hi, I'm using java I found the corresponding methods in java. Thanks for the quick response. On Jul 8, 3:08 am, Pherl Liu liuj...@google.com wrote: Which language are you using? In c++, you can call message::GetDescriptor()-FindFieldByNumber() to get

Re: [protobuf] about add_field、copyfrom

2011-07-12 Thread Pherl Liu
In C++ protobuf, each message owns its fields. That said, two different messages cannot share a sub-message, which will complicate the system when releasing resources. In your case, if you always need to copy the records, there may be a better design. For instance, keep the records in a global

Re: [protobuf] Re: Java - DynamicMessage and FileDescriptorProto

2011-07-26 Thread Pherl Liu
Not sure if I understand your question correctly. You can set the label in FieldDescriptorProto: LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2;LABEL_REPEATED = 3; On Tue, Jul 26, 2011 at 12:21 AM, Giancarlo Frison gfri...@chelab.comwrote: There is this example that I'm approaching to

Re: [protobuf] Failed test from tests.exe and lite-test.exe

2011-07-26 Thread Pherl Liu
I didn't see any test failures from your log: [==] 764 tests from 102 test cases ran. (3249 ms total) [ PASSED ] 764 tests. The ERROR logs are expected, to test the protoc complains in some situations. On Mon, Jul 25, 2011 at 2:28 PM, Chris Morris chriswillmor...@gmail.comwrote: So

Re: [protobuf] Out-of-date Extensions Documentation?

2011-07-26 Thread Pherl Liu
The SetExtension() is mentioned in the example. The accessors mentioned in the following paragraph are similar to the SetExtension template function. On Mon, Jul 25, 2011 at 5:07 PM, Chris Morris chriswillmor...@gmail.comwrote: Should the Extensions section in the Language Guide (

Re: [protobuf] how to create descriptors dynamically with repeated and complex fields

2011-07-26 Thread Pherl Liu
See my response in the other thread. You can set label to the FieldDescriptorProto. On Tue, Jul 26, 2011 at 12:31 AM, Giancarlo Frison gfri...@chelab.comwrote: Hi all, I'm attempting to create descriptors dynamically for generating custom message on the fly. The trouble is when I have to

Re: [protobuf] Out-of-date Extensions Documentation?

2011-07-26 Thread Pherl Liu
Quote: Foo foo; foo.SetExtension(bar, 15); Similarly, the Foo class defines templated accessors HasExtension(), ClearExtension(), GetExtension(), MutableExtension(), and AddExtension(). end quote To re-write the sentence: Similarly to the SetExtension() mentioned in the above example, the Foo

Re: [protobuf] Re: Java - DynamicMessage and FileDescriptorProto

2011-07-27 Thread Pherl Liu
'DescriptorProtos.DescriptorProto.Builder', is it correct? How I can do to describe a complex type field? Thanks! On Jul 26, 8:21 pm, Pherl Liu liuj...@google.com wrote: Not sure if I understand your question correctly. You can set the label in FieldDescriptorProto

Re: [protobuf] Protobuf for Android

2011-09-21 Thread Pherl Liu
The size isn't correct. Please run mvn clean; then mvn package -P lite The correct size is around 80k On Thu, Sep 15, 2011 at 8:12 AM, sanjoy sanjoy.gh...@gmail.com wrote: Hello, Is there a version of protobuf for Android? I built the lite version of protobuf-2.4.1 and its 450KB. That's

Re: [protobuf] How can unknown fields appear in a message?

2011-09-21 Thread Pherl Liu
Can you try to print the DebugString() of the message containing unknown fields? One possibility is you used the wrong message type to parse the bytes. On Tue, Sep 20, 2011 at 3:04 PM, Michael Videlgauz mich...@videlgauz.comwrote: Hello! I am now investigating a bug in my program under

Re: [protobuf] Custom options namespace

2011-09-21 Thread Pherl Liu
The document generally said you can use the same extension number for different level of options, but the qualified extension name needs to be unique. e.g. a single extension name cannot extend more than one type. That said, you probably have to use different option name for the purpose. Note,

Re: [protobuf] protocol buffer for android and Iphone application

2011-09-21 Thread Pherl Liu
You can use protobuf-lite for Android (see the java/README.txt); for iphone, there are some 3rd-party add-ons for object-c. Take a look at http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns On Wed, Sep 14, 2011 at 4:33 PM, Visionweb olang...@gmail.com wrote:. Hello, Just a question. Is

Re: [protobuf] My Protocol Buffers implementation in C#

2011-09-21 Thread Pherl Liu
Done. Thanks for the work. On Sat, Sep 10, 2011 at 12:38 AM, Peter Hultqvist pe...@endnode.se wrote: Hello I have been working on this c# code generating Protocol Buffers implementation for a while and now I dare to announce it. https://silentorbit.com/**protobuf/

Re: [protobuf] C++ implementation for Python

2011-09-21 Thread Pherl Liu
There's no lite-runtime for python. It's generally reflection based. On Tue, Sep 6, 2011 at 2:45 PM, Slava slavaz...@gmail.com wrote: Hi, is there any way to use lite runtime for the subj? Thanks in advance. -- You received this message because you are subscribed to the Google Groups

Re: [protobuf] Initialisation of nested messages ?

2011-09-21 Thread Pherl Liu
You cannot set default values for messages (or fields in message). You would have to create default instances of ColorData in your code. On Mon, Sep 5, 2011 at 5:50 AM, Werner werner.van.be...@gmail.com wrote: Hello, message ColorData { required int32 red =263; required int32 green

Re: [protobuf] Extensions with Python

2011-09-21 Thread Pherl Liu
Take a look at Python API. http://code.google.com/apis/protocolbuffers/docs/reference/python-generated.html#extension There are few examples of how to use extensions in Python. On Mon, Sep 5, 2011 at 9:58 PM, Dave dave.johns...@me.com wrote: Hi, I have a C++ based service that uses messages

Re: [protobuf] A new third-party implementation

2011-09-21 Thread Pherl Liu
Added to http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns Thanks for the work! On Wed, Aug 31, 2011 at 11:28 PM, jpa petteri.aimo...@gmail.com wrote: Hi, Here is my ansi-C implementation of Protocol Buffers for memory- restricted embedded devices: http://koti.kapsi.fi/jpa/nanopb/

Re: [protobuf] release date for next version

2011-09-21 Thread Pherl Liu
Probably this quarter. There are still couple of memory issues for the experimental C++ implementation for python that we'd like to fix before next release. On Wed, Aug 31, 2011 at 6:34 AM, Chris Morris chriswillmor...@gmail.comwrote: When is the next version coming out? -- You received this

Re: [protobuf] release date for next version

2011-09-21 Thread Pherl Liu
Sorry, I mean Q4 2011. On Thu, Sep 22, 2011 at 12:45 PM, Pherl Liu liuj...@google.com wrote: Probably this quarter. There are still couple of memory issues for the experimental C++ implementation for python that we'd like to fix before next release. On Wed, Aug 31, 2011 at 6:34 AM, Chris

Re: [protobuf] build protobuf without iostreams

2011-09-21 Thread Pherl Liu
There are plenty of APIs for different IOs including string, array, please take a look at the message_lite.h. Also you can implement your own ZeroCopyStream for your IO layer. On Tue, Aug 30, 2011 at 5:23 AM, anand anand.aru...@gmail.com wrote: Hello All, Is it possible to use protobuf

Re: [protobuf] Java: Is there a way to create a new builder for a Message given one of its FieldDescriptors?

2011-11-07 Thread Pherl Liu
I assume you want to use generated class. In that case, you can keep a map from Descriptor to the default instance. Then when you get the FieldDescriptor, you can get the containing type Descriptor; then look up the map the get the default instance, and call newBuilderForType() to get the

Re: [protobuf] Java Nested Builders being built on insert?

2011-11-07 Thread Pherl Liu
Can you use addChildBuilder() API for the repeated field, and then call addGrandChildBuilder() in the returned builder? On Thu, Nov 3, 2011 at 12:24 AM, users moofis...@gmail.com wrote: I am working on a solution to basically allow me to persist any protocol buffer with hibernate.

Re: [protobuf] Why can't we clear UnknownFields from a Java instance?

2011-11-07 Thread Pherl Liu
You cannot clear the unknown fields in a message because messages are immutable. However, you can parse the bytes into a builder, and then clear the unknowns fields there. On Sat, Oct 22, 2011 at 3:52 PM, Ashwin Jayaprakash ashwin.jayaprak...@gmail.com wrote: Hi, I have 2 simple messages

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

2011-11-09 Thread Pherl Liu
On Thu, Nov 10, 2011 at 1:35 AM, Scott Saad saa...@gmail.com wrote: Hello, Thank you for adding a link! We'd like to accept patches. However, we don't have enough engineering resources to maintain another platform. Supporting a different platform requires much testing work in the release

Re: [protobuf] 2.4.1 on Win32 with VC 2008 cannot pass the tests.

2012-03-20 Thread Pherl Liu
Could you please post the error logs? On Tue, Mar 13, 2012 at 1:15 AM, Wei Cheng che...@garena.com wrote: The lite-test passes well. The tests either crash (release mode always, debug mode sometimes) or failed 12 tests of CommandLineInterfaceTests. Is there anyone else has the same problem?

Re: [protobuf] proto buff crash

2012-03-20 Thread Pherl Liu
It sounds like a memory ownership issue. Basically the message object owns the fields (including the unknown fields). From the stack trace, the string is probably freed before the destructor is called. Could you please write a simple function that could reproduce this issue? On Sun, Feb 26, 2012

Re: [protobuf] Package Mandatory ?

2012-03-20 Thread Pherl Liu
The function name is determined by the source proto file path. Looks like you always generate messages from a single .proto file. You would have to generate the message in different files. Otherwise, even if you worked around the function name issue, the runtime DescriptorPool would complained

Re: [protobuf] gcc 4.7.0 compile error with -std=c++11

2012-07-02 Thread Pherl Liu
The internal version is already c++11 compatible. It will be included in the next release. On Fri, Apr 20, 2012 at 4:23 PM, Brian Nesbitt brian.nesb...@gmail.comwrote: Hello folks, Protobuf 2.4.1 fails to build using gcc 4.7.0 (on CentOS 6.2) with the C++11 standard enabled (-std=c++11). The

Re: [protobuf] How to make a self-describing message

2012-07-12 Thread Pherl Liu
Unfortunately no.. You could, however, put the Emessages opCode in the MsgFirst message (instead of in the MsgHeader). Then you can specify the default value for the EMessages to MSG_FIRST. On Tue, Jul 10, 2012 at 10:06 PM, Barzo dba...@gmail.com wrote: Hi, I'm new to PB and I would ask a