Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] xml files that can be hand-edited
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-03-17 02:58:28


Paul wrote:

> I would also need to re-number all the class_ids, but those appear to
> be only used if I'm tracking a pointer AND I have multiple instances
> of that pointer in the file. If the item is not a pointer, it looks
> like the class_id is *always* thrown away.

maybe, one would have to look inside the loading code.
   
> So, I'm thinking of:
> a) never allow tracking (its a compromise to give me the next item)
> b) never writing out class_id or tracking_level
> c) always writing out the version
>
> the result would look like this:
> <brother version="2">
> .. etc, and then later in the file ...
> <sister version="2">
>
> That way items in the XML file could be rearranged by hand and I
> would not need to do the difficult task of adjusting the tag
> attributes.
>
> Does this sound sensible?

Doesnt' sound like a good idea to me. IT's just too hard to keep
everything in sync. Sounds to me that what you need is
something other than the serialization library. There are
XML readers out there.

> I had a look into inheriting and creating my own archive, but it
> appears all of the changes required happen in the
> basic_oarchive_impl, which seems pretty fundamental and hard to
> override.

Recent uploads to the documenation show examples of how to do
exactly this with XML archives.

You could also make your own version of xml_archive with the changes
you describe above. Given the changes you want to do- this is how I would
do it.

> Will I need to create and maintain my own patch in order to "hack"
> this change.

No other way to do this.

Robert Ramey

>
> Thanks,
> Paul
>
>
>
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users



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