Skip to content

genrwoody/convert_proto_struct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

convert_proto_struct

中文 | English

介绍

转换Protobuf消息类为c++结构体, 或者转换c++结构体为Protobuf消息类

支持的Protobuf类型:

  1. 基本类型, 如int32, int64, bool, Enum, string等
  2. 容器, repeated, map

不支持: oneof

支持的结构体类型:

  1. 结构体不能设置对齐参数
  2. 基本类型, 如int, int64_t, bool, enum等
  3. 字符串必须是std::string
  4. repeated对应的类型为std::vector
  5. map对应的类型必须是std::map

不支持: 位域

使用方法

可参考test中的示例

About

convert protobuf message to struct, or convert struct to protobuf message.

Topics

Resources

License

Stars

3 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors