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


C++ Tag::empty方法代码示例

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


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

示例1: handleIq

  bool Registration::handleIq( Stanza *stanza )
  {
    if( stanza->subtype() == StanzaIqError )
    {
      Tag *e = stanza->findChild( "error" );

      if( e->empty() || !m_registrationHandler )
        return false;

      if( e->hasChild( "conflict" ) || e->hasAttribute( "code", "409" ) )
        m_registrationHandler->handleRegistrationResult( RegistrationHandler::REGISTRATION_CONFLICT );
      else if( e->hasChild( "not-acceptable" ) || e->hasAttribute( "code", "406" ) )
        m_registrationHandler->handleRegistrationResult( RegistrationHandler::REGISTRATION_NOT_ACCEPTABLE );
      else if( e->hasChild( "bad-request" ) || e->hasAttribute( "code", "400" ) )
        m_registrationHandler->handleRegistrationResult( RegistrationHandler::REGISTRATION_BAD_REQUEST );
      else if( e->hasChild( "forbidden" ) || e->hasAttribute( "code", "403" ) )
        m_registrationHandler->handleRegistrationResult( RegistrationHandler::REGISTRATION_FORBIDDEN );
      else if( e->hasChild( "registration-required" ) || e->hasAttribute( "code", "407" ) )
        m_registrationHandler->handleRegistrationResult(
            RegistrationHandler::REGISTRATION_REGISTRATION_REQUIRED );
      else if( e->hasChild( "unexpected-request" ) || e->hasAttribute( "code", "400" ) )
        m_registrationHandler->handleRegistrationResult(
            RegistrationHandler::REGISTRATION_UNEXPECTED_REQUEST );
      else if( e->hasChild( "not-authorized" ) || e->hasAttribute( "code", "401" ) )
        m_registrationHandler->handleRegistrationResult( RegistrationHandler::REGISTRATION_NOT_AUTHORIZED );
      else if( e->hasChild( "not-allowed" ) || e->hasAttribute( "code", "405" ) )
        m_registrationHandler->handleRegistrationResult( RegistrationHandler::REGISTRATION_NOT_ALLOWED );
      else
        m_registrationHandler->handleRegistrationResult( RegistrationHandler::UNKNOWN_ERROR );
    }
    return false;
  }
开发者ID:SupportSpace,项目名称:SupportCenter,代码行数:32,代码来源:registration.cpp

示例2: addCoordsToWay

 Coords addCoordsToWay(XmapWay& way, const Symbol& symbol, OsmWay osmWay, bool reverse = false) {
     if (reverse) {
         osmWay.reverse();
     }
     Tag dashSymbolTag = symbol.NdSymbolTag();
     Coords lastGeographicCoords;
     for (const auto& osmNode : osmWay) {
         int flags = 0;
         if (!dashSymbolTag.empty()) {
             if(osmNode.getTagMap().exist(dashSymbolTag)) {
                 flags = 32;
             }
         }
         Coords coords = osmNode.getCoords();
         lastGeographicCoords = coords;
         coords = Main::transform.geographicToMap(coords);
         way.addCoord(coords,flags);
     }
     return lastGeographicCoords;
 }
开发者ID:sembruk,项目名称:osm2xmap,代码行数:20,代码来源:main.cpp


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