找对C序列化库 [英] Looking for C serialization library
问题描述
我写在C服务器的客户端应用程序,需要一些结构来回发送。
据我了解,这将是使用一些库序列化的结构,因为它赶走,然后它们关闭平台的依赖是一个好主意。
I am writing a server-client application in c and need to send some structures back and forth. From what I have learned, it would be a good idea to use some library to serialize the structures as it then rids them off platform dependency.
我看了一些基于XML和基于二进制的序列化方法,但我不知道该用什么库,什么是一般preferred。任何人都可以建议姣好库?此外,我需要它是简单而有效的(我的C code的其余部分顺利)。
I read about some xml based and binary based serialization methods, but I am not sure what library to use and what are generally preferred. Can anyone suggest good libraries for the same? Also I need it to be simple and efficient (going well with the rest of my c code).
任何意见将提前大的help.Thanks。
Any comment would be great a help.Thanks in advance.
推荐答案
那么有谷歌的protobuf的(使用 HTTP ://$c$c.google.com/p/protobuf-c/ 纯C,如果C ++是确定你可以使用的 HTTP://$c$c.google.com/p/protobuf/ )
Well there's google's protobuf (use http://code.google.com/p/protobuf-c/ for pure C, if C++ is ok you can just use http://code.google.com/p/protobuf/)
And there's also tpl, Apache's Avro
和还有另外一个我已经看了,我不记得名字的那一刻,IIRC它比我已经上市,因为它不需要任何形式的模式的那些就更简单了。
And there's another one I've looked at that I can't remember the name of at the moment, IIRC it was even simpler than the ones I already listed since it doesn't require any sort of schema.
(注意:这些都是序列化到一个二进制重新presentation)
(NOTE: these are all serialize to a binary representation)
这篇关于找对C序列化库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!