[Boost-users] Serialization TextArchive are Cross-Language?

5 views
Skip to first unread message

Marco Piacentini

unread,
Jun 8, 2011, 11:07:37 AM6/8/11
to boost...@lists.boost.org
Hy...I try to explain better my question...
Im using boost serialization text archive before sending data over TCP connection...
Now I need to pass the received data to a Java application...so I would know if the serialized stream is composed only by the data or by the data + boost serialization(tag, code, etc.)...
In this case my only chance to transfer the data to the java application, is to filter them before transfering?thanks... 

Robert Ramey

unread,
Jun 9, 2011, 3:33:30 PM6/9/11
to boost...@lists.boost.org

I'll try to answer the question - but I'm sort of speculating as to what
you want to do. I throw in some miscellanous observations which
may or may not be helpful.

a) Generally I don't suggest that one tries to use boost serialization
to export data to non C++ applications. The library is intended to
provide the easiest to use and most efficient implementation of
serialization for C++ environments. Any ability to use this to
export data to/from other environments is a coincidence.

b) There are other tools for accomplishing the above. There
is google protocol buffers and there is boost spirit/karma/qi
which handle data in a way that is not connected to C++. Of
course they won't be as automatic as serialization for just this
reason.

c) Never the less, some people have been able to do this. In
large part it consists of not using those parts of the library which
are strongly dependent C++ such as serialization of pointers. A
useful place to start is one of the examples included with the package
which creates a write only archive which can export any data which
includes serialization functions. The leverages the serialization functions
to save a lot of work at the expense of being to read the archive back.
Something like might work for you.

d) there are other examples around for serializing files with JSON
and YAML formats. Again, these would likely mean not using
some of the features of the serialization library - which might be
be fine for you app.

I realize this might not be much comfort - but hope it helps
anyway.

Robert Ramey

_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Reply all
Reply to author
Forward
0 new messages