本文整理汇总了C++中QName类的典型用法代码示例。如果您正苦于以下问题:C++ QName类的具体用法?C++ QName怎么用?C++ QName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newType
ComplexType Parser::parseComplexType( ParserContext *context, const QDomElement &element )
{
ComplexType newType( d->mNameSpace );
newType.setName( element.attribute( QLatin1String("name") ) );
if (debugParsing())
qDebug() << "complexType:" << d->mNameSpace << newType.name();
if ( element.hasAttribute( QLatin1String("mixed") ) )
newType.setContentModel( XSDType::MIXED );
QDomElement childElement = element.firstChildElement();
AttributeGroup::List attributeGroups;
Group::List groups;
while ( !childElement.isNull() ) {
NSManager namespaceManager( context, childElement );
const QName name( childElement.tagName() );
if ( name.localName() == QLatin1String("all") ) {
all( context, childElement, newType );
} else if ( name.localName() == QLatin1String("sequence") || name.localName() == QLatin1String("choice") ) {
Element::List elems;
parseCompositor( context, childElement, newType.nameSpace(), &elems, &groups );
foreach ( const Element& elem, elems )
newType.addElement( elem );
} else if ( name.localName() == QLatin1String("attribute") ) {
示例2: defaultPriority
eFlag Tree::insertRule(Sit S, XSLElement *tmpl)
{
double prio;
Attribute *a = tmpl -> atts.find(XSLA_PRIORITY);
if (!a)
prio = defaultPriority(tmpl);
else
{
if (a -> cont.toDouble(prio))
Err(S, ET_BAD_NUMBER);
};
QName q;
GP( QName ) mode = NULL;
if (!!(a = tmpl -> atts.find(XSLA_NAME)))
E( tmpl -> setLogical(S, q, a -> cont, FALSE) );
if (q.getLocal() != UNDEF_PHRASE &&
subtrees.getCurrent() -> getStructure() ->
rules().findByName(*this, q))
{
Str fullName;
expandQStr(q, fullName);
Err1(S, ET_DUPLICATE_RULE_NAME, fullName);
};
if (!!(a = tmpl -> atts.find(XSLA_MODE)))
E( tmpl -> setLogical(S, *(mode = new QName),
a -> cont, FALSE) );
subtrees.getCurrent() -> getStructure() ->
rules().insert(new RuleItem(tmpl,prio,q,mode.keep()));
return OK;
}
示例3: pRet
//=============================================================================
// ElementType::addAttributeType
//
// Add a new attribute to our map
//
//=============================================================================
AutoPtr<AttributeType> ElementType::addAttributeType(const QName& name, bool bExternallyDeclared)
{
QC_DBG_ASSERT(m_attributeTypeMap.find(name.getRawName()) == m_attributeTypeMap.end());
AutoPtr<AttributeType> pRet(new AttributeType(*this, bExternallyDeclared, name));
m_attributeTypeMap[name.getRawName()] = pRet;
return pRet;
}
示例4: endSubElement
void KeyHandler::endSubElement(const QName& qname, RecursiveHandler* parser) {
if (strcmp(qname.localName(), kCancelTag) == 0)
_result->setCancel(_integerHandler.result());
else if (strcmp(qname.localName(), kFifthsTag) == 0)
_result->setFifths(_integerHandler.result());
else if (strcmp(qname.localName(), kModeTag) == 0)
_result->setMode(modeFromString(_stringHandler.result()));
}
示例5: endSubElement
void RestHandler::endSubElement(const QName& qname, RecursiveHandler* parser) {
using dom::presentOptional;
if (strcmp(qname.localName(), kDisplayStepTag) == 0)
_result->setDisplayStep(presentOptional(PitchHandler::stepFromString(_stringHandler.result())));
else if (strcmp(qname.localName(), kDisplayOctaveTag) == 0)
_result->setDisplayOctave(presentOptional(_integerHandler.result()));
}
示例6:
QList<TypeMap::Entry>::ConstIterator TypeMap::elementEntry( const QName &typeName ) const
{
QList<Entry>::ConstIterator it;
for ( it = mElementMap.constBegin(); it != mElementMap.constEnd(); ++it ) {
if ( (*it).typeName == typeName.localName() && (*it).nameSpace == typeName.nameSpace() )
break;
}
return it;
}
示例7: localTypeForAttribute
QString TypeMap::localTypeForAttribute( const QName &typeName ) const
{
QList<Entry>::ConstIterator it;
for ( it = mAttributeMap.constBegin(); it != mAttributeMap.constEnd(); ++it ) {
if ( (*it).typeName == typeName.localName() && (*it).nameSpace == typeName.nameSpace() )
return (*it).localType;
}
return QString();
}
示例8: forwardDeclarationsForAttribute
QStringList TypeMap::forwardDeclarationsForAttribute( const QName &typeName ) const
{
QList<Entry>::ConstIterator it;
for ( it = mAttributeMap.constBegin(); it != mAttributeMap.constEnd(); ++it ) {
if ( (*it).typeName == typeName.localName() && (*it).nameSpace == typeName.nameSpace() )
return (*it).forwardDeclarations;
}
return QStringList();
}
示例9: findBinding
Binding WSDL::findBinding( const QName &bindingName ) const
{
const Binding::List list = mDefinitions.bindings();
Binding::List::ConstIterator it;
for ( it = list.constBegin(); it != list.constEnd(); ++it ) {
if ( (*it).name() == bindingName.localName() && (*it).nameSpace() == bindingName.nameSpace() ) {
return *it;
}
}
return Binding();
}
示例10: cmpQNameStrings
Bool Tree::cmpQNameStrings(const QName &q, const Str& uri, const Str& local)
{
if (q.getLocal() == stdPhrase(PHRASE_STAR))
return (Bool)(
q.getUri() == UNDEF_PHRASE || dict().getKey(q.getUri()) == uri);
else
{
return (Bool)
(dict().getKey(q.getUri()) == uri &&
dict().getKey(q.getLocal()) == local);
}
}
示例11: findPortType
PortType WSDL::findPortType( const QName &portTypeName ) const
{
const PortType::List list = mDefinitions.portTypes();
PortType::List::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
if ( (*it).name() == portTypeName.localName() && (*it).nameSpace() == portTypeName.nameSpace() ) {
return *it;
}
}
qDebug( "findPortType: no match found for '%s'!", qPrintable( portTypeName.qname() ) );
return PortType();
}
示例12: findMessage
Message WSDL::findMessage( const QName &messageName ) const
{
const Message::List list = mDefinitions.messages();
Message::List::ConstIterator it;
for ( it = list.constBegin(); it != list.constEnd(); ++it ) {
if ( (*it).name() == messageName.localName() && (*it).nameSpace() == messageName.nameSpace() ) {
return *it;
}
}
qDebug( "findMessage: no match found for '%s'!", qPrintable( messageName.qname() ) );
return Message();
}
示例13: cmpQNamesForeign
Bool Tree::cmpQNamesForeign(const QName &q, const HashTable& dictForeign, const QName &qForeign)
{
/*
printf("comparing names (%s,%s,%s) and (%s,%s,%s)\n",
(char*)(((Tree*)this)->expand(q.getPrefix())),
(char*)(((Tree*)this)->expand(q.getUri())),
(char*)(((Tree*)this)->expand(q.getLocal())),
(char*)(dictForeign.getKey(qForeign.getPrefix())),
(char*)(dictForeign.getKey(qForeign.getUri())),
(char*)(dictForeign.getKey(qForeign.getLocal()))
);
*/
if (q.getLocal() == stdPhrase(PHRASE_STAR))
{
return (Bool)(q.getPrefix() == UNDEF_PHRASE ||
(dict().getKey(q.getUri()) == dictForeign.getKey(qForeign.getUri())));
}
else
{
return (Bool)
(dict().getKey(q.getUri()) == dictForeign.getKey(qForeign.getUri()) &&
dict().getKey(q.getLocal()) == dictForeign.getKey(qForeign.getLocal()));
}
}
示例14: newType
ComplexType Parser::parseComplexType( ParserContext *context, const QDomElement &element )
{
ComplexType newType( d->mNameSpace );
newType.setName( element.attribute( QLatin1String("name") ) );
if (debugParsing())
qDebug() << "complexType:" << d->mNameSpace << newType.name();
if ( element.hasAttribute( QLatin1String("mixed") ) )
newType.setContentModel( XSDType::MIXED );
QDomElement childElement = element.firstChildElement();
AttributeGroup::List attributeGroups;
while ( !childElement.isNull() ) {
NSManager namespaceManager( context, childElement );
const QName name( childElement.tagName() );
if ( name.localName() == QLatin1String("all") ) {
all( context, childElement, newType );
} else if ( name.localName() == QLatin1String("sequence") ) {
parseCompositor( context, childElement, newType );
} else if ( name.localName() == QLatin1String("choice") ) {
parseCompositor( context, childElement, newType );
} else if ( name.localName() == QLatin1String("attribute") ) {
newType.addAttribute( parseAttribute( context, childElement ) );
} else if ( name.localName() == QLatin1String("attributeGroup") ) {
AttributeGroup g = parseAttributeGroup( context, childElement );
attributeGroups.append( g );
} else if ( name.localName() == QLatin1String("anyAttribute") ) {
addAnyAttribute( context, childElement, newType );
} else if ( name.localName() == QLatin1String("complexContent") ) {
parseComplexContent( context, childElement, newType );
} else if ( name.localName() == QLatin1String("simpleContent") ) {
parseSimpleContent( context, childElement, newType );
} else if ( name.localName() == QLatin1String("annotation") ) {
Annotation::List annotations = parseAnnotation( context, childElement );
newType.setDocumentation( annotations.documentation() );
newType.setAnnotations( annotations );
}
childElement = childElement.nextSiblingElement();
}
newType.setAttributeGroups( attributeGroups );
return newType;
}
示例15: newType
ComplexType Parser::parseComplexType( ParserContext *context,
const QDomElement &complexTypeElement,
const QString elementName )
{
ComplexType newType( d->mNameSpace );
newType.setName( complexTypeElement.attribute( "name" ) );
if ( complexTypeElement.hasAttribute( "mixed" ) )
newType.setContentModel( XSDType::MIXED );
QDomElement childElement = complexTypeElement.firstChildElement();
AttributeGroup::List attributeGroups;
while ( !childElement.isNull() ) {
QName name = childElement.tagName();
if ( name.localName() == "all" ) {
all( context, childElement, newType );
} else if ( name.localName() == "sequence" ) {
parseCompositor( context, childElement, newType );
} else if ( name.localName() == "choice" ) {
parseCompositor( context, childElement, newType );
} else if ( name.localName() == "attribute" ) {
newType.addAttribute( parseAttribute( context, childElement, elementName ) );
} else if ( name.localName() == "attributeGroup" ) {
AttributeGroup g = parseAttributeGroup( context, childElement );
attributeGroups.append( g );
} else if ( name.localName() == "anyAttribute" ) {
addAnyAttribute( context, childElement, newType );
} else if ( name.localName() == "complexContent" ) {
parseComplexContent( context, childElement, newType );
} else if ( name.localName() == "simpleContent" ) {
parseSimpleContent( context, childElement, newType );
} else if ( name.localName() == "annotation" ) {
Annotation::List annotations = parseAnnotation( context, childElement );
newType.setDocumentation( annotations.documentation() );
newType.setAnnotations( annotations );
}
childElement = childElement.nextSiblingElement();
}
newType.setAttributeGroups( attributeGroups );
return newType;
}