0

The normal way of doing it is using

boost::property_tree::ptree pt1;
boost::property_tree::read_xml( XML_FILE_PATH, pt1  );

But what this does is that it reads the entire XML File, which is really huge in the pt1

So I think it is inefficient when we just want to read a childTree.

There is another overload function for read_xml which takes in the File Type istream but I don't know how to work with to solve this

boost::property_tree::read_xml( iStream, pt1  );

Thanks

rrajanuk
  • 27
  • 8
  • 1
    How can you validate that the file is correct and have the top-level tag closed if you don't read the whole file? Same with any sub-tree, you need to read until the tag is closed. – Some programmer dude Sep 04 '20 at 04:19
  • The overloaded function will require you to create a `std::istream` (like `std::ifstream`) but will still read the whole thing – Zaiborg Sep 04 '20 at 09:25

0 Answers0