本文整理汇总了C++中QName::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ QName::isEmpty方法的具体用法?C++ QName::isEmpty怎么用?C++ QName::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QName
的用法示例。
在下文中一共展示了QName::isEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isComplexType
bool TypeMap::isComplexType( const QName &typeName, const QName& elementName ) const
{
if (!typeName.isEmpty()) {
return isComplexType( typeName );
} else {
QList<Entry>::ConstIterator it = elementEntry( elementName );
return it != mElementMap.constEnd() ? (*it).complexType : false;
}
}
示例2: addSchemaTypes
void TypeMap::addSchemaTypes( const XSD::Types &types, const QString& ns )
{
Q_ASSERT( mNSManager );
XSD::SimpleType::List simpleTypes = types.simpleTypes();
XSD::SimpleType::List::ConstIterator simpleIt;
for ( simpleIt = simpleTypes.constBegin(); simpleIt != simpleTypes.constEnd(); ++simpleIt ) {
Entry entry;
entry.basicType = false;
entry.builtinType = false;
entry.nameSpace = (*simpleIt).nameSpace();
entry.typeName = (*simpleIt).name();
entry.localType = prefixNamespace( mNSManager->prefix( entry.nameSpace ).toUpper() + "__" + adaptLocalTypeName( (*simpleIt).name() ), ns );
entry.baseType = (*simpleIt).baseTypeName();
//qDebug() << entry.baseType.nameSpace() << entry.baseType.localName() << entry.baseType;
//entry.headers << (*simpleIt).name().toLower() + ".h";
entry.forwardDeclarations << entry.localType;
mTypeMap.append( entry );
}
foreach ( const XSD::ComplexType &complex, types.complexTypes() ) {
Entry entry;
entry.basicType = false;
entry.builtinType = false;
entry.complexType = true;
entry.nameSpace = complex.nameSpace();
entry.typeName = complex.name();
entry.isPolymorphic = complex.isPolymorphicBaseClass();
//qDebug() << "TypeMap: adding complex type" << entry.nameSpace << entry.typeName << "derived types:" << complex.derivedTypes();
// Keep empty complex types, useful for document mode.
/*if ( (*complexIt).isEmpty() )
entry.localType = "void";
else*/ {
entry.localType = prefixNamespace( mNSManager->prefix( entry.nameSpace ).toUpper() + "__" + adaptLocalTypeName( complex.name() ), ns );
if (complex.isConflicting()) {
entry.localType += complex.isAnonymous() ? "Element" : "Type";
}
//entry.headers << (*complexIt).name().toLower() + ".h";
entry.forwardDeclarations << entry.localType;
}
mTypeMap.append( entry );
}
XSD::Attribute::List attributes = types.attributes();
XSD::Attribute::List::ConstIterator attrIt;
for ( attrIt = attributes.constBegin(); attrIt != attributes.constEnd(); ++attrIt ) {
if ( (*attrIt).nameSpace() == "http://www.w3.org/2003/05/soap-encoding" ) // e.g. soap-enc:arrayType
continue;
Entry entry;
entry.basicType = false;
entry.builtinType = false;
entry.nameSpace = (*attrIt).nameSpace();
entry.typeName = (*attrIt).name();
entry.localType = prefixNamespace( mNSManager->prefix( entry.nameSpace ).toUpper() + "__" + adaptLocalTypeName( (*attrIt).name() + "Attribute" ), ns );
entry.headers << (*attrIt).name().toLower() + "attribute.h";
entry.forwardDeclarations << entry.localType;
mAttributeMap.append( entry );
}
const XSD::Element::List elements = types.elements();
Q_FOREACH( const XSD::Element& elemIt, elements ) {
Entry entry;
entry.nameSpace = elemIt.nameSpace();
entry.typeName = elemIt.name();
QName type = elemIt.type();
if ( type.isEmpty() ) {
qDebug() << "ERROR: element without type" << elemIt.nameSpace() << elemIt.name();
}
// Resolve to localType(type)
QList<Entry>::ConstIterator it = typeEntry(type);
if ( it == mTypeMap.constEnd() ) {
qDebug() << "ERROR: basic type not found:" << type;
Q_ASSERT(0);
continue;
}
const QString resolvedType = (*it).localType;
Q_ASSERT( !resolvedType.isEmpty() );
entry.localType = resolvedType;
entry.basicType = (*it).basicType;
entry.builtinType = (*it).builtinType;
entry.complexType = (*it).complexType;
entry.baseType = type;
if ( !entry.basicType )
entry.forwardDeclarations << entry.localType;
// The "FooElement" type isn't necessary, we just point to the resolved type
// directly, this is much simpler.
/*} else {
entry.localType = mNSManager->prefix( entry.nameSpace ).toUpper() + "__" + adaptLocalTypeName( elemIt.name() + "Element" );
}*/
//qDebug() << "Adding TypeMap entry for element" << entry.typeName << resolvedType;
mElementMap.append( entry );
}