ashish g
ashish g

Reputation: 449

changing the data type of boost property tree

Based on my previous post here, I take it that it is not possible to read an xml file directly into a property tree of char16_t.

https://stackoverflow.com/questions/28689003/using-boost-xml-parser-to-load-a-property-tree-with-char16-t

So I am looking at reading it as a regular char and then converting them to char16_t. I can handle the conversion between char and char16_t correctly, however I am not sure how to copy the data from one property tree to another.

I thought I can iterate over ptree but looks like I can only iterate on 1st level of children. I am not sure how to get the recursive call to duplicate a ptree with different data type.

Any tips?

Upvotes: 0

Views: 277

Answers (1)

ashish g
ashish g

Reputation: 449

In case anyone stumbles on this post trying to recursively copy from one ptree to another, you can check the function ptree_to_ptree() here: http://coliru.stacked-crooked.com/a/a7e0c2393ed9a98e

Upvotes: 0

Related Questions