Re: [protobuf] Deserializing of protobf Message from JSON string in C++

2017-10-25 Thread Giri Guntipalli


I am also facing similar issue but problem seems to happen only when 
library is complied with -O2 or –Os(optimize for size)  with gcc tool chain.

 

looks like extensions are being treated as dead code and removed by gcc 
optimization, any thoughts on overcoming this problem.

 

Thank you

Giri
On Thursday, 6 June 2013 00:15:14 UTC+5:30, Feng Xiao wrote:
>
>
>
>
> On Wed, Jun 5, 2013 at 2:44 AM, Channakeshava S C  > wrote:
>
>> I am facing problem in getting protobuf Message with extension from JSON 
>> string  {"xyz": [1234,2345,3456],"extensions":{"bar": [1,11,111]}} which is 
>> generated from Foo.
>>  
>> message Foo {
>>  repeated int32 xyz = 11;
>>  extensions 100 to 199; 
>> }
>>  
>> extend Foo {
>>  repeated int32 bar = 123;
>> }
>>  
>> The word "extensions" in the JSON stirng is just added to differentiate 
>> with other normal fileds.
>>  
>> Now, when I try to deserialize protobuf, i.e protobuf Message from JSON 
>> string. Facing difficulty here.
>>  
>> fd is NULL, when FindExtensionByName or FindKnownExtensionByName is 
>> called .
>>  
>> Foo foo;
>> Message *x =  
>> const FiledDescriptor *fd;
>>  
>> fd = x->GetDescriptor()->FindExtensionByName("bar")or 
>> fd = x->GetReflection()->FindKnownExtensionByName("bar");
>>
> Is the extension defined in the same .proto file with the message?  The 
> second one should work.
>  
>
>>
>> Could you point out any error in steps which I am following or Is there 
>> any other better approach?
>>  
>>  
>> Thanks,
>> Channakeshava
>>
>> -- 
>> 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 protobuf+u...@googlegroups.com .
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/protobuf?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Will protobuf support JSON?

2015-05-15 Thread Giri Guntipalli
JSON conversion utility function is expected to be compatible with 
proto-lite library?

On Wednesday, May 13, 2015 at 12:26:16 AM UTC+5:30, Feng Xiao wrote:

 On Tue, May 12, 2015 at 9:56 AM, Mikhail Melnik mikhail...@teamdev.com 
 javascript: wrote:

 There is mention in official documentation 
 https://developers.google.com/protocol-buffers/docs/proto3#json
 that says JSON encoding/decoding is supported by prtotobuf.

 But in release notes https://github.com/google/protobuf/releases it is 
 said
 that json encoding should be implemented in 3 version of protocol.
 Also there is no json encoder/formatter in source code.

 So it's not clear for me is it implemented or not?

 It's not implemented yet.
  

 In case it's not, will it be implemented in the future?

 Yes.
  


 If this functionality already exists does any one can provide example how 
 to make such conversion?
 I'm especially interesting in Java implementation of protobuf - json 
 conversion and vice verse.

 We will provide an utility class that converts between protobuf binary 
 format and JSON. The API will look like this:
 class JsonFormat {
   void convertBinaryToJson(TypeResolver typeResolver, InputStream 
 binaryInput, Writer jsonOutput);
 }
 interface TypeResolver {
   com.google.protobuf.Type resolveMessageType(String typeUrl);
   com.google.protobuf.Enum resolveEnumType(String typeUrl);
 }

 The JSON output will follow the spec described in the proto3 developer 
 guide.

  


 If any one has information on topic I would be very grateful.


 On Friday, April 1, 2011 at 11:32:42 PM UTC+3, Austin Ziegler wrote:

 On Fri, Apr 1, 2011 at 11:19 AM, Konrad Malawski
 konrad@project13.pl wrote:
  Sure, just google protobuf json - 
 http://code.google.com/p/protobuf-json/

  2011/4/1 ZHOU Xiaobo xb@qq.com
 
  script languages can easily dealing with JSON, but
  in C/C++ is actually difficult.
  can protobuf support json encode/decode?

 A few weeks ago, someone on my team wrote something in Ruby to
 generate the .proto file that would be associated with the JSON that
 we're expecting, plus the necessary YAJL code to parse the JSON in
 C++.

 It's not that hard to do, but we can't open source our work (it's too
 raw in any case).

 -a
 -- 
 Austin Ziegler • halos...@gmail.com • aus...@halostatue.ca
 http://www.halostatue.ca/ • http://twitter.com/halostatue

  -- 
 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 protobuf+u...@googlegroups.com javascript:.
 To post to this group, send email to prot...@googlegroups.com 
 javascript:.
 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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Re: protobuf 2.5.0 doesnt seem to support debain m68k-linux , is there a way to cross compile for m68k-linux EOM

2014-07-16 Thread Giri Guntipalli
you are unable to build protobuff library? or compile generated source from 
proto files? 

send steps you followed and error that you are getting.

Giri.

On Monday, 14 July 2014 10:42:28 UTC+5:30, pradeep moka wrote:




-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] lite and full version

2013-06-14 Thread Giri Guntipalli
what is the best way to write .proto files which can be used with prtobuf 
lite(small foot print devices) and protobuf (PC)

i know one option by using file options, that requires proto file modification 
for different version (lite and full) libraries, i am looking for possible 
solution wich avoid proto file modification

GiriG

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.




[protobuf] pb2 / json conversion and back

2013-06-13 Thread Giri Guntipalli
Hi michael, does it handle extensions as well. i mean extensions of pb to json 
and vice versa.

just curious to understand the fiesibilty.

GiriG

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[protobuf] proto to JSON/XML convertion library for C/C++

2013-04-10 Thread Giri Guntipalli
hi all, are there any libraries exists which can be used for generating 
JSON/XML serialization/deserialization to/from proto generated message 
classes.

Giri.

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2013-03-13 Thread Giri Guntipalli
we need similar thing to hold binary data in proto message, where i can not 
use string because binary data may have the null character in middle


On Tuesday, 29 January 2013 14:30:31 UTC+5:30, prot...@googlecode.com wrote:


 Comment #3 on issue 269 by xiaof...@google.com: Would like to have byte 
 or   
 int8 type for the message definition 
 http://code.google.com/p/protobuf/issues/detail?id=269 

 Re kumar.sumit: 
 How are you going to use the byte field to implement a fixed length 
 string?   
 If byte can, why can't int32? 



-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.