本文整理汇总了C++中xml_node::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ xml_node::begin方法的具体用法?C++ xml_node::begin怎么用?C++ xml_node::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml_node
的用法示例。
在下文中一共展示了xml_node::begin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_demo
void gdipp_setting::load_demo(const xml_node &root_node)
{
for (xml_node::iterator iter = root_node.begin(); iter != root_node.end(); iter++)
{
const wstring node_name = iter->name();
const wstring curr_value = iter->first_child().value();
if (node_name == L"font")
_demo_fonts.push_back(curr_value);
else
_demo_setting[node_name] = curr_value;
}
}
示例2: parse_gdimm_setting_node
void gdipp_setting::parse_gdimm_setting_node(const xml_node &setting_node, setting_map &setting_store)
{
const string_t name = setting_node.name();
if (name == L"freetype" || name == L"gamma" || name == L"render_mode" || name == L"shadow")
{
// these settings have nested items
for (xml_node::iterator iter = setting_node.begin(); iter != setting_node.end(); iter++)
setting_store[name + L"/" + iter->name()] = iter->first_child().value();
}
else
setting_store[name] = setting_node.first_child().value();
}
示例3: loadSructure
void meta::loadSructure(xml_node& val) {
if (val == 0) return;
nodetype type_ = nodeType(val.name());
if (type_ == NT_MF_ROOT) meta_node = val;
if (type_ == NT_MF_HOME) homeList_node = val;
if (type_ == NT_MF_REPLIST) reportList_node = val;
if (type_ == NT_MF_TRENDLIST) trendList_node = val;
if (type_ == NT_MF_MESSLIST) messageList_node = val;
num_xmlnode_map* tmpreg = registry(type_);
if (tmpreg) {
xml_attribute atr = val.attribute("key");
if (!atr.empty())
tmpreg->insert(num_xmlnode_pair(atr.as_int(), val));}
xml_node_iterator it = val.begin();
while (it != val.end()) {
loadSructure(*it);
it++;}}
示例4: render_stack
void OraHandler::render_stack( xml_node node, QPainter &painter, int offset_x, int offset_y ) const{
for( xml_node_iterator it = --node.end(); it != --node.begin(); it-- ){
std::string name( (*it).name() );
if( name == "stack" ){
int x = (*it).attribute( "x" ).as_int( 0 );
int y = (*it).attribute( "y" ).as_int( 0 );
render_stack( *it, painter, offset_x+x, offset_y+y );
}
else if( name == "text" ){
qWarning( "No support for text" );
}
else if( name == "layer" ){
QString source( QString::fromUtf8( (*it).attribute( "src" ).value() ) );
int x = (*it).attribute( "x" ).as_int( 0 ) + offset_x;
int y = (*it).attribute( "y" ).as_int( 0 ) + offset_y;
std::string visibility = (*it).attribute( "visibility" ).value();
if( visibility == "" || visibility == "visible" ){
//composite-op
std::string composite = (*it).attribute( "composite-op" ).value();
QPainter::CompositionMode mode = QPainter::CompositionMode_SourceOver;
if( !ora_composite_mode( composite, mode ) )
qWarning( "Unsupported composite-op: %s", composite.c_str() );
painter.setCompositionMode( mode );
double opacity = (*it).attribute( "opacity" ).as_double( 1.0 );
painter.setOpacity( opacity );
std::map<QString,QImage>::const_iterator img_it = images.find( source );
if( img_it != images.end() )
painter.drawImage( x, y, img_it->second );
else
qWarning( "Layer source not found: %s", source.toLocal8Bit().constData() );
//Restore modified settings
painter.setOpacity( 1.0 );
painter.setCompositionMode( QPainter::CompositionMode_SourceOver );
}
}
else{
qWarning( "Unrecognized element: %s", name.c_str() );
}
}
}
示例5: from_xml
text_placements_ptr text_placements_list::from_xml(xml_node const &xml, fontset_map const & fontsets)
{
using boost::property_tree::ptree;
text_placements_list *list = new text_placements_list;
text_placements_ptr ptr = text_placements_ptr(list);
list->defaults.from_xml(xml, fontsets);
xml_node::const_iterator itr = xml.begin();
xml_node::const_iterator end = xml.end();
for( ;itr != end; ++itr)
{
if (itr->is_text() || !itr->is("Placement")) continue;
text_symbolizer_properties &p = list->add();
p.from_xml(*itr, fontsets);
//TODO: if (strict_ &&
// !p.format.fontset.size())
// ensure_font_face(p.format.face_name);
}
return ptr;
}
示例6: begin
const_iterator begin() const
{
return node.begin();
}
示例7: load_exclude
void gdipp_setting::load_exclude(const xml_node &root_node)
{
for (xml_node::iterator iter = root_node.begin(); iter != root_node.end(); iter++)
_exclude_process.push_back(iter->first_child().value());
}