|
Boost Users : |
Subject: Re: [Boost-users] Optional XML serialization
From: Paul (elegant_dice_at_[hidden])
Date: 2010-02-23 03:08:18
On 23 February 2010 13:53, Robert Ramey <ramey_at_[hidden]> wrote:
>
> > The code above doesn't describe how I was going to achieve that, but
> > basically I was going to delegate the serialization of modules,
> > something like
> >
> > void load(ar, modules, version)
> > {
> > string module_name;
> > ar << module_name;
> > ModuleManager::load_if_possible(config.module, module_name);
> > }
>
> maybe a better option would be to include several archives in one stream.
>
> class header {
> typedef std::pair<enum module_type, size_t> module
> std::list<module> m_list;
> };
>
> void load(stream s, modules, version){
> header h;
> {
> xml_archive xa(s);
> ar >> h;
> }
> foreach(module m in h){
> xml_archive xa(s);
> if(m.:module_type is in modules)
> xar >> ?
> else
> // skip ahead in stream
> }
>
I like this idea! So the result will look like (eg) 10 XML files all
mashed together, with 10 XML headers in the one file?
That makes it an invalid XML file, right? Which is ok for my
purposes, at the moment.
thanks,
Paul
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