本文整理汇总了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;
}
示例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;
}