Re: [protobuf] repeated elements

2015-05-12 Thread rhlake

On Wednesday, May 6, 2015 at 3:53:03 PM UTC-4, Henner Zeller wrote:

 On 6 May 2015 at 06:29, rhlake rhl...@comcast.net javascript: wrote:

 I have the following message definition in a proto file which is causing 
 a *serialization error*:
  
  
 message   Request {
  
  repeated  LanguageType  LanguageList = 1;
 }
  
  
 enum LanguageType   {
  
   English = 0;
   German = 1;
   Spanish = 2;
 }
  
  
 *If I make the following change:*
  
  
 message   Request {
  
  repeated  LanguageTypeList  
 LanguageListParam = 1;
 }
  
  
 message   LanguageTypeList  {
  
  optional LanguageType  LanguageList = 1;
 }
  
 enum LanguageType   {
  
   English = 0;
   German = 1;
   Spanish = 2;
 }
  
  
 can anyone explain what is happening?  does *repeated* *NOT WORK* with* 
 enums*?


 Repeated does work with enums.

 Can you give a bit more context, e.g. what is the language you are 
 creating code for, and what exactly does the serialization error manifest 
 (error message or error code).

 How do you serialize and deserialize the data ? A common problem is to not 
 deal with NUL bytes properly in the stream, i.e. if you interpret something 
 as a NUL-terminated C-string somewhere in the process it might look like a 
 too short buffer.

 -h

 
 
Version:   C++ / 2.5.0 version
 
Error:

1.   level_ LOGLEVEL_FATAL (3)   
google::protobuf::LogLevel

2.   filename_  d:\\svn\\lg_radiosimulator\\01. 
src\\gpb_lib\\src\\component\\protocal\\src\\google\\protobuf\\repeated_field.h
   


3.   line_   625

4.   message_  CHECK failed: (index)  (size())

 
 Trace:

1.  GeneratedMessageReflection::SetRepeatedEnum

2.  void GeneratedMessageReflection::SetRepeatedEnum(

3.  Message* message,

4.  const FieldDescriptor* field, int index,

5.  const EnumValueDescriptor* value) const {

6.USAGE_CHECK_ALL(SetRepeatedEnum, REPEATED, ENUM);

7.USAGE_CHECK_ENUM_VALUE(SetRepeatedEnum);

8.if (field-is_extension()) {
MutableExtensionSet(message)-SetRepeatedEnum(

9.field-number(), index, value-number());

10.   } else {

11.   SetRepeatedFieldint(message, field, index, 
value-number());ß 

12.   }

 

template typename Type

inline void GeneratedMessageReflection::SetRepeatedField(

Message* message, const FieldDescriptor* field,

int index, Type value) const {

  MutableRawRepeatedFieldType (message, field)-Set(index, value); ß--- 
Set.

}

 

template typename Element

inline void RepeatedFieldElement::Set(int index, const Element value) {

  GOOGLE_DCHECK_LT(index, size());  
ß Error happens.

  elements_[index] = value;
 
 
Thank You

-- 
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] repeated elements

2015-05-06 Thread rhlake
I have the following message definition in a proto file which is causing a 
*serialization 
error*:
 
 
message   Request {
 
 repeated  LanguageType  LanguageList = 1;
}
 
 
enum LanguageType   {
 
  English = 0;
  German = 1;
  Spanish = 2;
}
 
 
*If I make the following change:*
 
 
message   Request {
 
 repeated  LanguageTypeList  LanguageListParam 
= 1;
}
 
 
message   LanguageTypeList  {
 
 optional LanguageType  LanguageList = 1;
}
 
enum LanguageType   {
 
  English = 0;
  German = 1;
  Spanish = 2;
}
 
 
can anyone explain what is happening?  does *repeated* *NOT WORK* with* 
enums*?
 
thank you

-- 
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] GB 18030 Character Set

2013-02-12 Thread rhlake
Does anyone have any experience trying to send GB 18030 (Chineese Character 
Set) accross a wire using protocol buffers?  
 
if so, which scalar type did you use? bytes?
 
thank you

-- 
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 405 in protobuf: c++ code generation for enum does not handle namespaces properly

2012-09-24 Thread rhlake
When are you planning on releasing version 2.5.0 ?
 
do you have a list of items that are being addressed in 2.5.0 ?
 
thank you,
Robert
 

On Tuesday, August 7, 2012 9:00:29 AM UTC-4, (unknown) wrote:

 Updates: 
 Labels: FixedIn-2.5.0 

 Comment #2 on issue 405 by liuj...@google.com: c++ code generation for 
 enum   
 does not handle namespaces properly 
 http://code.google.com/p/protobuf/issues/detail?id=405 

 This has been fixed internally. Will be included in the next release. 



-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/iHz6bl9ui4MJ.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.