本文整理汇总了C++中boost::property_tree::ptree::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ptree::push_back方法的具体用法?C++ ptree::push_back怎么用?C++ ptree::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::property_tree::ptree
的用法示例。
在下文中一共展示了ptree::push_back方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_css
void set_css(boost::property_tree::ptree & pt, const std::string & name, const T & v)
{
boost::property_tree::ptree & css_node = pt.push_back(
boost::property_tree::ptree::value_type("CssParameter",
boost::property_tree::ptree()))->second;
css_node.put("<xmlattr>.name", name );
css_node.put_value( v );
}
示例2: convert
void convert(const boost::property_tree::wptree & in, boost::property_tree::ptree & out)
{
out.data() = utf8(in.data());
for(boost::property_tree::wptree::const_iterator i = in.begin(), end = in.end(); i != end; ++i)
{
out.push_back(boost::property_tree::ptree::value_type(utf8(i->first), boost::property_tree::ptree()));
convert(i->second, out.back().second);
}
}
示例3: serializeQueryData
Status serializeQueryData(const QueryData& q, pt::ptree& tree) {
for (const auto& r : q) {
pt::ptree serialized;
auto s = serializeRow(r, serialized);
if (!s.ok()) {
return s;
}
tree.push_back(std::make_pair("", serialized));
}
return Status(0, "OK");
}
示例4: operator
void operator()( boost::property_tree::ptree & s, object_type & obj ) {
size_t all_count = obj.allele_count();
size_t i = 0;
while( i < all_count ) {
boost::property_tree::ptree all;
all.put( "position", obj.getPositionAt(i) );
s.push_back( std::make_pair("", all ) );
++i;
}
}
示例5: to_xml
void expression_format::to_xml(boost::property_tree::ptree &xml) const
{
ptree &new_node = xml.push_back(ptree::value_type("ExpressionFormat", ptree()))->second;
if (face_name) set_attr(new_node, "face-name", to_expression_string(*face_name));
if (text_size) set_attr(new_node, "size", to_expression_string(*text_size));
if (character_spacing) set_attr(new_node, "character-spacing", to_expression_string(*character_spacing));
if (line_spacing) set_attr(new_node, "line-spacing", to_expression_string(*line_spacing));
if (text_opacity) set_attr(new_node, "opacity", to_expression_string(*text_opacity));
if (wrap_before) set_attr(new_node, "wrap-before", to_expression_string(*wrap_before));
if (wrap_char) set_attr(new_node, "wrap-character", to_expression_string(*wrap_char));
if (fill) set_attr(new_node, "fill", to_expression_string(*fill));
if (halo_fill) set_attr(new_node, "halo-fill", to_expression_string(*halo_fill));
if (halo_radius) set_attr(new_node, "halo-radius", to_expression_string(*halo_radius));
if (child_) child_->to_xml(new_node);
}
示例6: serializeQueryLogItemAsEvents
Status serializeQueryLogItemAsEvents(const QueryLogItem& i, pt::ptree& tree) {
pt::ptree diff_results;
auto status = serializeDiffResults(i.results, diff_results);
if (!status.ok()) {
return status;
}
for (auto& action : diff_results) {
for (auto& row : action.second) {
pt::ptree event;
serializeEvent(i, row.second, event);
event.put<std::string>("action", action.first);
tree.push_back(std::make_pair("", event));
}
}
return Status(0, "OK");
}
示例7: serializeScheduledQueryLogItemAsEvents
Status serializeScheduledQueryLogItemAsEvents(
const ScheduledQueryLogItem& item, boost::property_tree::ptree& tree) {
try {
pt::ptree diff_results;
auto status = serializeDiffResults(item.diffResults, diff_results);
if (!status.ok()) {
return status;
}
for (auto& i : diff_results) {
for (auto& j : i.second) {
pt::ptree event;
serializeEvent(item, j.second, event);
event.put<std::string>("action", i.first);
tree.push_back(std::make_pair("", event));
}
}
} catch (const std::exception& e) {
return Status(1, e.what());
}
return Status(0, "OK");
}