当前位置: 首页>>代码示例>>C++>>正文


C++ XMLAttributes::end方法代码示例

本文整理汇总了C++中XMLAttributes::end方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLAttributes::end方法的具体用法?C++ XMLAttributes::end怎么用?C++ XMLAttributes::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XMLAttributes的用法示例。


在下文中一共展示了XMLAttributes::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void CascadeStyles
     (
          const XMLIterator &i,
          XMLCreatorEnv *env,
          XMLAttributes &attributes,
          XMLStyle &branch_style,
          XMLCreatorEnv &ch_env
      )
{ 
    XMLStyle *parent_style=0;
    const std::string &name = (*i)._name;
    const XMLParser::Node &node = (*i);

    XMLAttributes::iterator attr_i = attributes.end();
    insert( node._attributes.begin(), node._attributes.end(), attributes, attr_i );
    
    std::string style_name;
    if ( try_attribute( (*i)._attributes, "style", &style_name ) )
    {
        const XMLStyle &ref_style = QueryStyle( style_name );
        
        XMLStyle::iterator sty_i = branch_style.end();
        insert( ref_style.begin(), ref_style.end(), branch_style, sty_i );
    }

    if ( (*env).Query("parent_style", parent_style ) )
    {
        XMLStyle::iterator sty_i = branch_style.end();
        insert( parent_style->begin(), parent_style->end(), branch_style, sty_i );
    }

    XMLStyle::iterator st_it = branch_style.find(name);
    if ( st_it != branch_style.end() )
    {
        XMLAttributes::iterator attr_i = attributes.end();
        insert( (*st_it).second.begin(), (*st_it).second.end(), attributes, attr_i );
    }
    
    std::string inner_style_name;
    if ( try_attribute( (*i)._attributes, "inner_style", &inner_style_name ) )
    {
        const XMLStyle &ref_style = QueryStyle( inner_style_name );
        ch_env.Set("parent_style", &ref_style );
    }
    else if ( !branch_style.empty() )
    {
        int disable_style = false;
        try_attribute_i( (*i)._attributes, "disable_style", &disable_style );

        if ( !disable_style ) // apply Cascading Style Derivation for children
        {
            ch_env.Set("parent_style", &branch_style);
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:utgs-svn,代码行数:55,代码来源:CreateStyle.cpp

示例2: startElement

void XMLValueMap::startElement(const string &name, const XMLAttributes &attrs) {
  depth++;

  if (depth == 1) {
    if (name != root) THROWS("Invalid root element '" << name << "'");
    return;

  } else if (depth > 2)
    THROWS("Invalid child eleent '" << name << "' in XML value map");

  XMLAttributes::const_iterator it;

  it = attrs.find("v");
  if (it == attrs.end()) it = attrs.find("value");

  if (it != attrs.end()) {
    setXMLValue(name, it->second);
    xmlValueSet = true;

  } else xmlValueSet = false;
}
开发者ID:equinoxefr,项目名称:cbang,代码行数:21,代码来源:XMLValueMap.cpp


注:本文中的XMLAttributes::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。