コード例 #1
0
void PipelineReaderXML::collect_attributes(map_t& attrs, const ptree& tree)
{
    if (tree.count("<xmlattr>"))
    {
        const ptree& subtree = tree.get_child("<xmlattr>");
        parse_attributes(attrs, subtree);
    }
}
コード例 #2
0
ファイル: parser.cpp プロジェクト: woronin/kumir2
void parser::read_game(const ptree &pt, game_t &game)
{
    game.title = pt.get<string>("title");
    game.copyright = pt.get<string>("copyright", string());
    game.license = pt.get<string>("license", string("unspecified"));
    game.homepage = pt.get<string>("homepage", string());

    if (pt.count("authors")) {
        BOOST_FOREACH(const ptree::value_type & v, pt.get_child("authors")) {
                game.authors.push_back(v.second.data());
        }
    }