|
Boost : |
From: Marcin Kalicinski (kalita_at_[hidden])
Date: 2006-04-30 07:42:57
Hi Stephen,
Thank you for your comments.
> The proposed property tree library uses a small internal language which is
> passed to the various functions, for instance:
>
> file = ptree.get<std::string>("config.filename");
>
> Personally, I don't think its a good idea to define new syntaxes and pass
> them around as strings. It would be a bit more effort to implement, but I
> think (something like) the following would be preferable:
>
> file = ptree.get<std::string>["config"]["filename"]
I think both approaches have their merits. For example, the above would not
permit storing paths in strings or files. I intend to allow both:
// These will be equivalent
file = pt.["config"]["filename"].get<std::string>(); // #1
file = pt.["config.filename"].get<std::string>(); // #2
> Also, there is an additional runtime overhead in parsing the string, which
> can be avoided by doing it at compile-time using C++'s native syntax.
If performance is important, user will just use #1 syntax.
Best regards,
Marcin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk