Stencil& Stencil::html(const std::string& html){ // Clear content before appending new content from Html::Document clear(); Html::Document doc(html); auto body = doc.find("body"); if(auto elem = body.find("main","id","content")){ append_children(elem); } else append_children(doc.find("body")); return *this; }
void config::append(const config &cfg) { append_children(cfg); BOOST_FOREACH(const attribute &v, cfg.values) { values[v.first] = v.second; } }
void config::append(const config &cfg) { append_children(cfg); foreach (const attribute &v, cfg.values) { values[v.first] = v.second; } }
Node Node::append_xml(const std::string& xml){ Document doc(xml); // To append a pugi::xml_document it is necessary to append each of // it children (instead of just the document root) append_children(doc); return doc; }
config& config::operator=(const config& cfg) { if(this == &cfg) { return *this; } clear(); append_children(cfg); values.insert(cfg.values.begin(), cfg.values.end()); return *this; }
config::config(const config& cfg) : values(cfg.values), children(), ordered_children() { append_children(cfg); }