简体   繁体   English

更改boost属性树的数据类型

[英]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 . 根据我之前的帖子,我认为不可能将xml文件直接读入char16_t的属性树。

https://stackoverflow.com/questions/28689003/using-boost-xml-parser-to-load-a-property-tree-with-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 . 因此,我将其视为常规char ,然后将它们转换为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. 我可以正确处理char和char16_t之间的转换,但是我不确定如何将数据从一个属性树复制到另一个属性树。

I thought I can iterate over ptree but looks like I can only iterate on 1st level of children. 我以为我可以迭代ptree但看起来我只能迭代第一级别的孩子。 I am not sure how to get the recursive call to duplicate a ptree with different data type. 我不知道如何获得递归调用来复制具有不同数据类型的ptree。

Any tips? 有小费吗?

如果有人在这篇文章中偶然发现试图以递归方式从一个ptree复制到另一个ptree,你可以在这里查看函数ptree_to_ptree(): http ://coliru.stacked-crooked.com/a/a7e0c2393ed9a98e

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM