I need to read properties from a file to affect program behavior. Looks like boost::property_tree will do quite nicely. But, I’m wondering if when fetching different kinds of values that the library may reads the file multiple times?
For performance reason I’d like it to only be once. Most of the properties will be simple values like numbers, and strings. But occasionally there will be lists of numbers and lists strings.
I figure the it parses the file only once, but you never know and hence the question.
thanks.
You control it, and it reads only once:
Include the correct header and read ini, json or xml files into the tree using the corresponding read_XXX method.
You then use a “path” to access elements from the tree, or you can iterate over subtrees
or direct access via a path: