1
私はboost C++ライブラリを初めて使用していましたが、これを使ってxmlドキュメントを解析したいと思っていましたが、ロジックの把握に問題があります。C++のBoost XML Parser
<?xml version="1.0"?>
<GCC_XML version="0.9.0" cvs_revision="1.140">
<Function id="_6" name="A" returns="_12" context="_1" location="f1:1" file="f1" line="1" mangled="_Z1Aif">
<Argument name="a" type="_12" location="f1:1" file="f1" line="1"/>
<Argument name="c" type="_13" location="f1:1" file="f1" line="1"/>
</Function>
<Function id="_7" name="B" returns="_14" context="_1" location="f1:7" file="f1" line="7" mangled="_Z1Bf">
<Argument name="d" type="_13" location="f1:7" file="f1" line="7"/>
</Function>
</GCC_XML>
私はどのように私はそれについて移動する必要があり、各機能タグの引数タグにアクセスしたい場合は?私はファンクションタグに次のようにアクセスできました。
BOOST_FOREACH(ptree::value_type const& v, pt.get_child("GCC_XML")) {
if(v.first == "Function") {
cout << "Function name : " << v.second.get_child("<xmlattr>.name").data() << endl;
cout << "Function return type : " << v.second.get_child("<xmlattr>.returns").data() << endl;
}
は助けをありがとうございました。 –