Search code examples
c++boostboost-propertytree

C++ Boost property tree - Update tree by file


I'm using Boost Property Tree to load ini configuration files.
Using this library, I'm able to load each configuration file into one boost::property_tree::ptree object. Now I want to load multiple configuration files in one ptree object.
How can I do this job? Or how can I merge ptrees into one object?


Solution

  • Do you mean to treat all the individual ini files as one big ini file? If so, you may just read each individual file into a string and then append all the strings together. Finally, load that string into boost::property_tree::ptree.