Protocol Buffers is a newly open-sourced Google data serialization API.
It is fast at both serializing and parsing, and creates data streams much more compact than the equivalent XML.
I'm currently working on a BlitzMax "compiler" and integration of the protobuf library into a module. The compiler generates BlitzMax Types and C++ glue code which integrates directly with the core generated C++.
This makes for the best of both worlds - you get the pure speed of the native C++ parsing/serializer with a proper BlitzMax interface to the data :-)
Once you've run the "compiler" on the .proto file, all you need to do is Import the generated .bmx file, and away you go, creating and using the new Types.
It really is as easy as :
... part of addressbook.proto
.. using the generated code
The module provides support for TStream in serializing and parsing, which opens up the doors to all kinds of protocols ;-)
It also supports String and raw Byte arrays, which hopefully covers all the methods that you might want to throw your serialized data around.
There are some issues with BMK (and BCC) currently (heh, aren't there always when I'm hacking?), but we are working to get these resolved in the not too distant future.
Anyhoo... just thought some of you might be interested. I should hopefully have something available to play with soon.
Comments and stuff welcome as always :-)
<EDIT> - I should probably add, it is all actually working as of now. Tested on Win32 and OS X. ;-)
It is fast at both serializing and parsing, and creates data streams much more compact than the equivalent XML.
I'm currently working on a BlitzMax "compiler" and integration of the protobuf library into a module. The compiler generates BlitzMax Types and C++ glue code which integrates directly with the core generated C++.
This makes for the best of both worlds - you get the pure speed of the native C++ parsing/serializer with a proper BlitzMax interface to the data :-)
Once you've run the "compiler" on the .proto file, all you need to do is Import the generated .bmx file, and away you go, creating and using the new Types.
It really is as easy as :
... part of addressbook.proto
message AddressBook { repeated Person person = 1; }
.. using the generated code
Import "addressbook.pb.bmx" Local address_book:AddressBook = New AddressBook.Create()
The module provides support for TStream in serializing and parsing, which opens up the doors to all kinds of protocols ;-)
It also supports String and raw Byte arrays, which hopefully covers all the methods that you might want to throw your serialized data around.
There are some issues with BMK (and BCC) currently (heh, aren't there always when I'm hacking?), but we are working to get these resolved in the not too distant future.
Anyhoo... just thought some of you might be interested. I should hopefully have something available to play with soon.
Comments and stuff welcome as always :-)
<EDIT> - I should probably add, it is all actually working as of now. Tested on Win32 and OS X. ;-)