Boost logo

Boost :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2007-12-05 16:15:15


Scott Woods wrote:
> IIUC, the example above appears to be an example of a "header reader" that
> can be used at runtime to switch code paths inside the application.
Yep, that's what it is.
> Imagine you have an application that saves its configuration in a file using
> the I/O chain library. You decide that the encoding will be binary to
> discourage
> users from fiddling. You further decide that users arent so bad and that
> an advanced tab will let them switch between binary encoding, XML and
> others.
> It might allow for easy exchange of configurations within a user community.
>
That sounds like completely changing the serialization format of the
configuration. I don't think my streams are going to help you much
there. A binary structured format and XML are completely different
things. You can implement both on top of my streams, sure, but beyond
that I think you're left with having to replace the entire serializer
component. That means switch or virtual functions. Virtuals would be a
better solution here, I think.

Sebastian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk