Boost logo

Boost Users :

Subject: Re: [Boost-users] Optional XML serialization
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-02-23 00:53:24


> 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
}

> By the way, is there a reason why there is no YAML archive format?
> Why only XML as a human-readable option?

Someone started a project to do this, but I don't know what happened to it.

Robert Ramey


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