[protobuf] Find Descriptor of all messages defined in a proto file

2016-07-08 Thread Sumit
I need to find all messages described in a proto file.Is there some way to 
get the descriptor of all messages defined in a proto file ??

-- 
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] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2013-03-14 Thread Sumit Kumar
No you cant, on C++ bytes translates to string, wont allow for null.

Regards,
Sumit Kumar

On 14 Mar, 2013, at 2:39 AM, Feng Xiao xiaof...@google.com wrote:

 You can just use bytes field.
 
 On Wed, Mar 13, 2013 at 5:38 AM, Giri Guntipalli giri.guntipa...@gmail.com 
 wrote:
 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.
 
 -- 
 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.
  
  

-- 
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.




Re: [protobuf] Re: Issue 329 in protobuf: Add support for [deprecated = true] on all types of definitions

2013-03-14 Thread Sumit Kumar
Can we insert compiler warning for C++ builds as well in cases where deprecated 
field is used ?

Regards,
Sumit Kumar

On 14 Mar, 2013, at 2:36 AM, proto...@googlecode.com wrote:

 
 Comment #3 on issue 329 by sergei.s...@gmail.com: Add support for [deprecated 
 = true] on all types of definitions
 http://code.google.com/p/protobuf/issues/detail?id=329
 
 Deprecation is an integral part of evolution. Say, we introduce a new field 
 in version 1.5, then a few months down the line, we no longer need it. We 
 deprecate it in the next version, say that will be 1.12. We ship version 1.12 
 to the consumers and ask them to remove references to the deprecated field. 
 In version 2.0 we remove the field from the message completely.
 
 The current version of protoc produces @Deprecated annotations in java 
 classes for fields marked with [deprecated = true], which in turn produces a 
 visible warning when some other java code is referencing the deprecated 
 members of the message or builder class.
 
 I am not sure what would be the implication of deprecating the entire proto 
 file. I can think of two possible (complementary, not mutually exclusive) 
 options:
 1) protoc outputs a warning whenever a deprecated file is being imported
 2) protoc automatically treats all messages defined in the file as deprecated 
 and generates annotations to that effect
 
 -- 
 You received this message because this project is configured to send all 
 issue notifications to this address.
 You may adjust your notification preferences at:
 https://code.google.com/hosting/settings
 
 -- 
 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.
 
 
 

-- 
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.




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

2013-03-14 Thread Sumit Kumar
Int32 and such will see endianness issues when exchanging messages in-between 
cross-endian platforms hence only byte type suffices.

On how we achieve fixed length string support once byte type is supported - 
Just create a message with specific number of byte elements and can name it 
like fixed8String instead. Accessors can be added via simple plugin that uses 
protoc insert point.

Regards,
Sumit Kumar

On 13 Mar, 2013, at 8:38 PM, Giri Guntipalli giri.guntipa...@gmail.com wrote:

 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.
  
  

-- 
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.




Re: [protobuf] string-valued enum needed when implementing OpenRTB2.1 proto file

2014-04-02 Thread Sumit Kumar
You could define an enum value option such as string_name and use that in your 
proto definition, and then write a simple plugin to generate what you need.

Regards,
Sumit Kumar

 On 31 Mar, 2014, at 12:15 am, Oliver Jowett oliver.jow...@gmail.com wrote:
 
 If the protobuf mapping is a new mapping, why can't you map the 
 string-valued enum to a protobuf enum with the same names? I assume that 
 the string-valued enum has a fixed set of possible values?
 
 Oliver
 
 
 On 30 March 2014 00:57, Zhiqian Yuan onyourmark...@gmail.com wrote:
 I understand. I thought there might be a workaround somewhere;
 
 And yes you can say I am defining a new message format, but what I am 
 implementing is an existing standard, so I think it would be best to 
 strictly follow the standard, rather than having to do a lot of external 
 extra validation. But now it seems that I have to.
 
 在 2014年3月30日星期日UTC+8上午4时06分21秒,Oliver写道:
 On 28 March 2014 15:54, Zhiqian Yuan onyour...@gmail.com wrote:
  Those two fields are string type, but like other integer enumerations, 
 they both have a range to set value. So I decide they should be 
 implemented as string-valued enum type. But there's no such a thing either 
 in C++ or in proto. 
 
 There is no such thing as a string-valued enum type in the protobuf 
 world. You can either have an enum field (that happens to have an integer 
 encoding under the covers, but that doesn't really matter to you); or you 
 can have a string field and do whatever validation you want externally to 
 protobuf.
 
 Are you trying to implement an existing message format, or are you trying 
 to define a new message format? If you have control over the format, what's 
 wrong with a standard enum field for these fields?
 
 Oliver
 
 -- 
 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.
 
 -- 
 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.

-- 
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.


RE: [protobuf] Re: Plans to support C#?

2014-12-19 Thread sumit kumar
Another +1 for oneof C# support

Date: Wed, 17 Dec 2014 13:32:43 -0800
From: ejb...@gmail.com
To: protobuf@googlegroups.com
Subject: [protobuf] Re: Plans to support C#?

+1 for oneof.




-- 

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.
  

-- 
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.


Re: [protobuf] Re: Protobuf Buffers v3.0.0-alpha-1

2015-01-21 Thread Sumit Kumar
Specially makes difficult for adoption in financial applications, the has_field 
was one of the key reasons to migrate over to protofuf.

Financial applications need differentiation in-between 0 value set and not set. 
Eg: Limit order with 0 price is valid but with no price set is invalid. 
Likewise market order with no price set is valid and with any other price set 
is invalid (including the 0 value). And there are many other cases, but anyway 
if the decision is made then not much value discussing it.

Regards,
Sumit Kumar

 On 17 Jan 2015, at 10:52 am, V.B. vidalborro...@gmail.com wrote:
 
 I suppose what I'm really wondering is:
 a) How does it simplify the language implementations exactly?
 b) Why was that not the case for non-primitives, which still have presence 
 logic?
 
 
 On Friday, January 16, 2015 at 6:39:56 PM UTC-5, Feng Xiao wrote:
 The reason for dropping field presence is more of the same with dropping 
 default values. Basically we want to simplify protobuf and make it easier to 
 implement efficiently in more languages. We are preparing the proto3 
 documentation and will share more information about the trade-offs we have 
 made.
 On Fri Jan 16 2015 at 12:17:25 PM V.B. vidalb...@gmail.com wrote:
 Can I ask for more details about why presence logic was removed (e.g. 
 hasFoo() ) for primitives? This has been a very useful feature for us.
 
 
   1. Removal of field presence logic for primitive value fields, 
 removal
  of required fields, and removal of default values. This makes 
 proto3
  significantly easier to implement with open struct 
 representations,
  as in languages like Android Java, Objective C, or Go.
 
 -- 
 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.
 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.

-- 
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.


RE: [protobuf] [Dependencies] Never had so much difficulties to integrate a library (protobuf) in my life (C++ / Qt / Windows)

2015-10-19 Thread sumit kumar
Java guy trying C++, right ? 
Its not protobuf's fault, its your lack of C++ knowledge. You just need to set 
these 3 things in your project:Include path of the protobuf include folder 
(this folder contains the google directory)The protobuf lib pathThe libprobuf 
as lib dependency on your project
Maven won't do this magically either, you still need to set the pom. Anyway, if 
you were able to use protoc, you have all of these on your system. The host 
directory of protoc is where you should start to look.
Regards,Sumit KumarDate: Sun, 18 Oct 2015 14:27:37 -0700
From: gokan.ekinci@gmail.com
To: protobuf@googlegroups.com
Subject: [protobuf] [Dependencies] Never had so much difficulties to integrate 
a library (protobuf) in my life (C++ / Qt / Windows)

Hi,

I have decided to use protobuf because it looked like cool and well documented, 
I've learned almost everything from it (past almost 4 days on Google's 
tutorials), but now I begin to regret my choice.

First of all those are my tools :
* My implementation language : C++
* Operating System : Windows 7 (sorry guys)
* IDE : Qt Creator (Community) with MinGW included in it.
* protobuf : currently stable release 2.6.1

My steps : 
I have followed Google's tutorial here : 
https://developers.google.com/protocol-buffers/docs/cpptutorial#compiling-your-protocol-buffersI
 have downloaded protoc for Windows and source code here (currently stable 
release 2.6.1) : https://developers.google.com/protocol-buffers/docs/downloadsI 
have generated my .proto thanks to protoc and obtained my "file.pb.h" and 
"file.pb.cc".I have integrated those two files into my Qt project.I have tried 
to compile my project... and here problems comming !
My problem :
I have huge dependency problems because everytime I want to compile there's a 
missing dependency !

First this following dependency is missing from my "file.pb.h" 
=> #include 

Let's think about it... Google's tutorial don't even mention this dependency 
problem... but I know this file because I have already seen it somewhere in the 
source code !
So I decide to unzip source code from .tar.gz and integrate the 
"/google/protobuf/" folder in my Qt project... 
I realize that common.h was only a begenning ! Because now it ask me other 
dependencies like "gtest.h" or "config.h" !


My gut tells me that I would never had this integration problem if I used Maven 
with Java but let's forget this personal detail... please help me, I am stucked 
with all those dependency problems. What is the standard way to solve this 
integration problem under Windows ?


Thanks.





-- 

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.
  

-- 
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: how to force go grpc plugin to use new import google.golang.org/protobuf/proto in generated pb.go file

2020-05-12 Thread Sumit Agrawal
Try updating protoc-gen-go version to latest.

On Monday, 11 May 2020 20:22:17 UTC+5:30, Serguei Bezverkhi wrote:
>
> Hello,
>
> When blah.proto file gets converted into blah.pb.go it automatically adds 
> import statement for: github.com/golang/protobuf/proto
>
> that generates en error in the staticheck:
>
> blah.pb.go:8:2: package github.com/golang/protobuf/proto is deprecated: 
> Use the "google.golang.org/protobuf/proto" package instead. (SA1019)
>
> I was wondering if there is a way to force go plugin to import a new 
> package.
>
> Thank you
> Serguei
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/c42a78dc-fe43-4152-ac1f-93dcbd15e454%40googlegroups.com.


[protobuf] Using google proto as a on wire data format

2023-02-26 Thread Sumit Patil
Hii everyone, 
I am trying to use google proto to transfer data from client to server and 
vice versa.
I am not getting, how I can implement such thing. 
I am thinking of these steps:
* Client
1. Set proto message's fields 
2. Serialize to byte array 
3. encrypt
4. Send from client 

* Server
1. Decrypt 
2. Deserialize
3. Print message

Is this process correct and if yes can you suggest 
functions/implementations to do that.
I suppose for client step2 I can use SerializeToArray, but how can I 
encrypt it?
Also is it possible to compress that data, I mean will it work in protobuff?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/deb69e2f-5c32-4cbb-baa2-b2582137f9bcn%40googlegroups.com.


[protobuf] Re: Using google proto as a on wire data format

2023-02-26 Thread Sumit Patil
Note - lang = CPP

On Sunday, 26 February, 2023 at 10:38:40 pm UTC+5:30 Sumit Patil wrote:

> Hii everyone, 
> I am trying to use google proto to transfer data from client to server and 
> vice versa.
> I am not getting, how I can implement such thing. 
> I am thinking of these steps:
> * Client
> 1. Set proto message's fields 
> 2. Serialize to byte array 
> 3. encrypt
> 4. Send from client 
>
> * Server
> 1. Decrypt 
> 2. Deserialize
> 3. Print message
>
> Is this process correct and if yes can you suggest 
> functions/implementations to do that.
> I suppose for client step2 I can use SerializeToArray, but how can I 
> encrypt it?
> Also is it possible to compress that data, I mean will it work in 
> protobuff?
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/66045341-82d4-4fc6-af1a-7485457c0849n%40googlegroups.com.


[protobuf] Protobuf parsing

2023-08-07 Thread Sumit Patil


I am receiving a WatchEvent message and the value stored in this kubernetes 
proto is -

   1. Type - for ex. event such as modified or added or deleted
   2. Object - raw bytes of actual object. Can be any object.

I want to convert those raw bytes to actual objects such as pod. Note that 
I know the kind name of that RawExtension runtime object.

Currently I was doing this but result is negative -


if( eventType == "ADDED" || eventType == "MODIFIED" ) { WatchEvent watch; 
watch.set_type( eventType ); string object = responseJson["object"].dump(); 
watch.mutable_object()->set_raw(object); cout << "Message" << endl; cout << 
watch.DebugString() << endl; Pod pod; JsonStringToMessage( 
watch.object().raw(),  ); cout << "Pod" << endl; cout << 
pod.DebugString() << endl; }

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/f3b09158-a2b7-4764-86e9-31c6d8a90936n%40googlegroups.com.


[protobuf] Re: Protobuf parsing

2023-08-07 Thread Sumit Patil
 if( eventType == "ADDED" || eventType == "MODIFIED" )
{ 
 WatchEvent watch; 
 watch.set_type( eventType ); 
 string object = responseJson["object"].dump(); 
 watch.mutable_object()->set_raw(object); 
 cout << "Message" << endl; 
 cout << watch.DebugString() << endl; 
 Pod pod; 
 JsonStringToMessage( watch.object().raw(),  ); 
 cout << "Pod" << endl;
 cout << pod.DebugString() << endl;
 }

On Monday, 7 August, 2023 at 2:14:29 pm UTC+5:30 Sumit Patil wrote:

>
> I am receiving a WatchEvent message and the value stored in this 
> kubernetes proto is -
>
>1. Type - for ex. event such as modified or added or deleted
>2. Object - raw bytes of actual object. Can be any object.
>
> I want to convert those raw bytes to actual objects such as pod. Note that 
> I know the kind name of that RawExtension runtime object.
>
> Currently I was doing this but result is negative -
>
>
> if( eventType == "ADDED" || eventType == "MODIFIED" ) { WatchEvent watch; 
> watch.set_type( eventType ); string object = responseJson["object"].dump(); 
> watch.mutable_object()->set_raw(object); cout << "Message" << endl; cout 
> << watch.DebugString() << endl; Pod pod; JsonStringToMessage( 
> watch.object().raw(),  ); cout << "Pod" << endl; cout << 
> pod.DebugString() << endl; }
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/59f6ac9f-1299-41ba-a9e5-2768aa28a2c8n%40googlegroups.com.