|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2005-10-19 01:01:56
The library implementation strives to avoid including redundant data in the
archive.
That's why things are the way they are.
Note that you've expressed a desire to do this in order to support the edit
of
XML archives. In the past I've suggested that this is a bad idea and my
opinion hasn't changed.
But if you insist you want to do it. Make a derivation of xml_archive which
does the following.
Overrides the serialization of class id, load, object_id etc to maintain a
table
which relates object_id -> class_id -> class_name. Then overide
serialization
of save to lookup the class_id, and class name in the table an add them to
the file.
This won't be terrible efficient - but heck - its XML so its not going to be
efficient anyway.
Good luck.
Robert Ramey
Sean Huang wrote:
> ----- Original Message -----
> From: "Robert Ramey" <ramey_at_[hidden]>
> To: <boost-users_at_[hidden]>
> Sent: Thursday, October 13, 2005 4:33 PM
> Subject: Re: [Boost-users] [Serialization]class(type) name in xml
> archive?
>
>
>> That may be helpful - but that's the best I can do. Note that the
>> class_id # in the xml output indicates which type is being handled.
>> I would hope that some sort of XML viewer could make sense of it.
>>
> Do you think it is reasonable to add an option so that users could
> choose to include class names?
> I do not mind adding a lookup table at the end of the archive that
> maps class_id to class_name. But I do not see an easy way to do that.
> Can you shed some light on it?
>
> Thanks,
>
> Sean
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net