It is an autotool to generate encode/decode functions of the struct defined in xml file,current version is 0.1.0.0,because only python code is provided.
soon coming: c++ code and java code.
这是一个自动生成数据结构的压缩和解压缩的代码的工具,数据结构定义在xml中,请按照c/c++的struc来理解定义部分,主要用来网络通信协议使用,业内人士的你懂的。
例子如下:
example:
<struct name="helloworld">
<member name="h1" type="int" count="5"/>
<member name="h2" type="embeded"/>
<member name="h3" type="embeded" count="2"/>
<member name="h4" type="int"/>
<member name="h5" type="float" count="TALL_COUNT" refer="count"/>
<member name="h6" type="char"/>
</struct>
in *.py files we use like this:

h_2 = helloworld()
h_2.h3[1].e7[1].headhead = 9
str = encode_helloworld(h_2)
#socket.send(str)
#socket.recv(str2)
h_3,pos = decode_helloworld(str2)
myassert_true(h_3.h3[1].e7[1].headhead == 9)

Last edited Mar 8, 2011 at 7:55 AM by tsrmtrue, version 5