|
Boost : |
From: Marcin Kalicinski (kalita_at_[hidden])
Date: 2006-04-19 13:07:42
> Two things that I had to roll into my config system:
> a) ability to include other files
This is a parser job to handle includes. Of the parsers included with the
library only INFO supports them, but I believe other formats (XML, JSON,
INI) do not have a notion of include at all.
> b) inline variable expansion, e.g.
> site.root = c:\dev
> site.home = ${site.root}\home
Yeah, long time ago the library supported that. There are actually 2 types
of "dynamic values", or inline-expanded values as you call them:
1. Values which are expanded statically during parsing
2. Values which are fully dynamic - i.e. lookup is performed everytime you
access the value (so if you change the original, the dependent changes as
well).
#1 is just a parser issue - something along the lines of statically expanded
entity references in XML. #2 requires support infrastructure from the
basic_ptree class - namely a pointer to parent. And a way to describe
relative paths, so more extra characters would be needed than just the
separator.
> What are your thoughts on this being included in your library?
> Anyone else need to do this type of stuff, or would find this useful?
If there is enough interest I may try to revive it. On the other hand, a
better solution might be to build another class on top of ptree that
supports dynamic values.
Marcin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk