What external file format does the Boost Serialization Library use? The introduction to the library states the requirement that serialization written by one machine must be readable by a different machine. And, elsewhere, it mentions that and XML intermediate file is on possibility; but I can't seem to find what the format being used is. Merrill
Hi Merrill,
Currently Boost.Serialization supports XML and "text" archives, although
XDR is reportedly in the near future.
As for the specifications for the "text" format, I recently posed this
question to Robert Ramey himself:
***************************************************
Short answer is no.
Information on this can be found as comments in the source code. Look
in one of the library files *_archive.cpp. I forget which ones.
I know this might seem odd but there is a good reason. Archives are
defined in pairs - saving and loading. The only real requirement is
that the be mutually compatible. This permits the same user code to
support very wide differences in archive types from binary to xml and
who knows what else.
That is, the archive format for say a text_?archive could be documented
for external use but it is considered an implementation detail
text_archives.
You might consider xml_archives for this job. It would still be
something of a job, but it would be much easier because the xml archives
are human readable.
Good Luck.
Robert Ramey
-----Original Message-----
From: Adam McLaurin [mailto:adam.mclaurin@fastmail.fm]
Sent: Tuesday, November 01, 2005 6:45 PM
To: ramey@rrsd.com
Subject: Documentation on Boost text archive format
Hi Robert,
I am using the Boost.Serialization text archive to serialize my data
before putting it out on the wire. However, I have found absolutely no
documentation that actually defines the format.
I anticipate that there will be Java consumers of my data, so I'd like
to be able to provide them with the format specifications so that they
can implement their own deserializer.
Do you have any format specifications that I could distribute?
Thanks,
Adam McLaurin
***************************************************
On Thu, 10 Nov 2005 08:57:14 -0600 (GMT-06:00), "Merrill Cornish"
What external file format does the Boost Serialization Library use?
The introduction to the library states the requirement that serialization written by one machine must be readable by a different machine. And, elsewhere, it mentions that and XML intermediate file is on possibility; but I can't seem to find what the format being used is.
Merrill _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
"Merrill Cornish"
What external file format does the Boost Serialization Library use?
The introduction to the library states the requirement that serialization written by one machine must be readable by a different machine. And, elsewhere, it mentions that and XML intermediate file is on possibility; but I can't seem to find what the format being used is.
I think the term format in this case is ambiguous. Other than(the current) binary, text and xml archive types, the content and organization of files generated for each archive is determined by the serialize method implementations of your application. IIRC, Robert is improving the documentation to better convey this. Jeff Flinn
This question comes up repeatedly. I'm sure this is because the "tradional" way of transmitting data is to first define a format and then write code to implment it. The serialization system is backwards in this regard. The format is driven by the composition of C++ data structures that are being saved/loaded. The system works by guarenteeing that the tree created by composition of C++ data structures is traversed in the same sequence both on saving and loading. Hence there is almost no need for any apriori specification as to the sequence of data or content of the archive. It is for this reason, that there can be archives of different formats as long as they are defined in compatible pairs. In fact, different formats can be used simultaneously. It is a common desire to interface with the archives generated. This might be possible in some cases but unlikely to be successful generally. This is due to the fact that the "format" is dependent on the C++ data structures that drive it and would be changed if the program changes. It is this same dependency which makes the serialization system (almost) totally automatically applicable to every C++ program and adjustable as the C++ code evolves. As I said, this is different that what many people expect and takes some getting used to. Robert Ramey Merrill Cornish wrote:
What external file format does the Boost Serialization Library use?
The introduction to the library states the requirement that serialization written by one machine must be readable by a different machine. And, elsewhere, it mentions that and XML intermediate file is on possibility; but I can't seem to find what the format being used is.
Merrill
participants (4)
-
Adam M
-
Jeff Flinn
-
Merrill Cornish
-
Robert Ramey