protobuf-LiteralByteString
全部标签 我的代码目前传递大量(有时是嵌套的)C(或C++普通旧数据)结构和数组。我想将它们与googleprotobufs相互转换。我可以手动编写在这两种格式之间进行转换的代码,但自动生成此类代码会更不容易出错。做这个的最好方式是什么?(这在具有足够自省(introspection)能力的语言中很容易迭代成员变量的名称,但这是我们正在谈论的C++代码)我正在考虑的一件事是编写python代码来解析C结构,然后吐出一个.proto文件,以及为所有类型从一个成员复制到另一个成员(在任一方向)的C代码,但也许有更好的方法……或者可能已经有另一个IDL可以生成:.h包含所有嵌套类型的文件.proto文
我在构建过程中遇到这样的错误:e:/Users/some/path/SomeClass.java:86:error:cannotfindsymbole:e:staticConnectionTypegetConnectionType(Contextcontext){e:^e:symbol:classConnectionTypee:location:classSomeClass其中ConnectionType是protobuf生成的类。所以看起来kapt不能解析生成的类。我尝试了什么?一开始我添加了kotlin-apt插件:applyplugin:'kotlin-kapt'然后我将brot
我在构建过程中遇到这样的错误:e:/Users/some/path/SomeClass.java:86:error:cannotfindsymbole:e:staticConnectionTypegetConnectionType(Contextcontext){e:^e:symbol:classConnectionTypee:location:classSomeClass其中ConnectionType是protobuf生成的类。所以看起来kapt不能解析生成的类。我尝试了什么?一开始我添加了kotlin-apt插件:applyplugin:'kotlin-kapt'然后我将brot
我正在使用protobuf-embedded-c在小型系统上将不同的数据从它传输到PC。问题是,如果我在两端都使用嵌入式库,一切正常。如果我在PC上使用谷歌C++,它就不再工作了。我想我将问题追溯到每条消息中都有长度前缀的嵌入式库,但我似乎无法在C++库上以一种好的方式做到这一点。这是我用来调试它的测试应用程序:人.proto:enumPhoneType{MOBILE=0;HOME=1;WORK=2;}messagePhoneNumber{requiredfloatnumber=1;requiredPhoneTypetype=2;}主要.cpp:#include#include#def
我们有一些(很多).NET类。我们使用了protobuf-net标记它们,并通过googleoriginallibrary为C++代码端生成.proto包装器.所以我有一条消息(某些EventBase类上的C++DebugString()(在.NETEventCharacterMoved中继承EventBase而在C++中我只写入可选属性)):UserId:-2792EventCharacterMoved{Coordinates{Position{X:196.41913Y:130Z:213}Rotation{X:207Y:130Z:213}}OldCoordinates{Positio
我正在使用protobuf和Linux。它的编译器protoc在哪里?我已经从主站点下载了这个包,编译并成功安装了它,但是我找不到protoc来构建我自己的格式文件。它在哪里?更新这是我构建protobuf的文件夹:aclocal.m4depcompMakefile.inautogen.sheditorsmissingCHANGES.txtexamplesprotobuf-lite.pcconfig.guessgenerate_descriptor_proto.shprotobuf-lite.pc.inconfig.hgtestprotobuf.pcconfig.h.ininstall
我应该如何在Protobuf消息中添加方法?假设我的.proto文件中有:packageproto;messagePerson{requiredstringname=1;requiredint32id=2;optionalstringemail=3;}我想添加一个方法,例如,字符串concatenateNameEmail()到消息中。我现在做的是像这样创建自己的C++类:classPerson:publicproto::Person{public:Person(proto::Personconst&person_):proto::Person(person_){}stringconca
我目前收到一个错误,它指向protoc生成的头文件中的这些行:#if2006001但我的协议(protocol)版本与上面的版本匹配:protoc--versionlibprotoc2.6.1我做错了什么?最初我的protoc版本是3.0.0然后通过同步回2.6.1并执行这些步骤重新安装它;makedistclean,./configure,make,makeinstall安装所需的2.6.1版本。我需要旧版本,因为那是我们服务器中安装的版本。 最佳答案 问题是您系统上安装的header(在/usr/include/google/p
当我尝试解析大消息时收到此警告和错误。我知道64MB是默认限制。我现在正在使用message.ParseFromIstream。有谁知道访问CodedInputStream对象以调用SetTotalBytesLimit函数?或任何其他方式来解决这个问题?Readingdangerouslylargeprotocolmessage.Ifthemessageturnsouttobelargerthan67108864bytes,parsingwillbehaltedforsecurityreasons.Toincreasethelimit(ortodisablethesewarnings)
我下载源Protobufzip文件。然后我打开我的ClassicEclipse并选择File->Import->ExistingMavenProjects。我选择根文件夹为/java。显示pom.xml已经勾选,选择Next。屏幕显示:SetupMavenpluginconnectors:withmaven-antrun-plugin:1.3:run(2errors):Nomarketplaceentriesfoundtohandlemaven-antrun-plugin:1.3:runinEclipse.PleaseseeHelpformoreinformation.我是不是漏掉了什