다음과 같이 도와 주시겠습니까?이중 등록 된 경우 부스트 트리에서 자식을 지우는 방법은 무엇입니까?
나는이 finalTree를 채울 = treeA + treeB
그러나, 문제는 treeB의 일부 요소가 treeA의 일부와 같은 이름을 가지고있다. 결과적으로 나는 몇몇 아이들을 위해 이중 등록을 할 수 있습니다.
즉.
<category>
<fruit type="banana">
<characteristic>
<point v="0"/>
</characteristic>
</fruit>
<fruit type="orange">
<characteristic>
<point v="1"/>
</characteristic>
</fruit>
<fruit type="banana">
<characteristic>
<point v="2"/>
</characteristic>
</fruit>
<fruit type="fig">
<characteristic>
<point v="3"/>
</characteristic>
</fruit>
</category>
내가 원하는 것은 바나나의 첫 번째 항목을 삭제하고 마지막 항목을 유지하는 것입니다. 지금까지 내가 할 :
boost::property_tree::ptree & node = informationTree.add("information.fruitTypes", "");
node.add("<xmlattr>.type", fruit);
node.add_child("characteristic", char);
문제는 내가 두 번 항목 바나나 또는 다음에 뭔가 다른 것입니다 여부를 알 수 없기 때문에 나는 그것을 제거하는 방법을 모른다는 것이다. 채우기 트리를 복사해야합니까? 제발 뭐라고 제안하나요?