本文整理汇总了C++中QName::localName方法的典型用法代码示例。如果您正苦于以下问题:C++ QName::localName方法的具体用法?C++ QName::localName怎么用?C++ QName::localName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QName
的用法示例。
在下文中一共展示了QName::localName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseComplexType
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: 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()));
}
示例3: 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()));
}
示例4: parseCompositor
void Parser::parseCompositor( ParserContext *context,
const QDomElement &element, ComplexType &ct )
{
QName name = element.tagName();
bool isChoice = name.localName() == "choice";
bool isSequence = name.localName() == "sequence";
Compositor compositor;
if ( isChoice ) compositor.setType( Compositor::Choice );
else if ( isSequence ) compositor.setType( Compositor::Sequence );
if ( isChoice || isSequence ) {
Element::List newElements;
QDomElement childElement = element.firstChildElement();
while ( !childElement.isNull() ) {
QName csName = childElement.tagName();
if ( csName.localName() == "element" ) {
Element newElement;
if ( isChoice ) {
newElement = parseElement( context, childElement,
ct.nameSpace(), element );
} else {
if ( isSequence ) {
// occurence attributes can be either in the
// parent (sequence) to on the current element
if ( childElement.hasAttribute("minOccurs") ||
childElement.hasAttribute("maxOccurs")) {
newElement = parseElement( context, childElement,
ct.nameSpace(), childElement );
} else {
newElement = parseElement( context, childElement,
ct.nameSpace(), element );
}
} else {
newElement = parseElement( context, childElement,
ct.nameSpace(), childElement );
}
}
newElements.append( newElement );
compositor.addChild( csName );
} else if ( csName.localName() == "any" ) {
addAny( context, childElement, ct );
} else if ( isChoice ) {
parseCompositor( context, childElement, ct );
} else if ( isSequence ) {
parseCompositor( context, childElement, ct );
}
childElement = childElement.nextSiblingElement();
}
foreach( Element e, newElements ) {
e.setCompositor( compositor );
ct.addElement( e );
}
示例5: endSubElement
void PartHandler::endSubElement(const QName& qname, RecursiveHandler* parser) {
if (strcmp(qname.localName(), kMeasureTag) == 0) {
auto measure = _measureHandler.result();
measure->setIndex(_measureIndex++);
measure->setParent(_result.get());
_result->addMeasure(std::move(measure));
}
}
示例6: parseCompositor
void Parser::parseCompositor( ParserContext *context,
const QDomElement &element, ComplexType &ct )
{
const QName name( element.tagName() );
bool isChoice = name.localName() == QLatin1String("choice");
bool isSequence = name.localName() == QLatin1String("sequence");
Compositor compositor;
if ( isChoice ) compositor.setType( Compositor::Choice );
else if ( isSequence ) compositor.setType( Compositor::Sequence );
compositor.setMaxOccurs( readMaxOccurs( element ) );
if ( isChoice || isSequence ) {
Element::List newElements;
QDomElement childElement = element.firstChildElement();
while ( !childElement.isNull() ) {
NSManager namespaceManager( context, childElement );
const QName csName( childElement.tagName() );
if ( csName.localName() == QLatin1String("element") ) {
Element newElement;
if ( isChoice ) {
newElement = parseElement( context, childElement,
ct.nameSpace(), element );
} else {
newElement = parseElement( context, childElement,
ct.nameSpace(), childElement );
}
newElements.append( newElement );
compositor.addChild( csName );
} else if ( csName.localName() == QLatin1String("any") ) {
addAny( context, childElement, ct );
} else if ( isChoice ) {
parseCompositor( context, childElement, ct );
} else if ( isSequence ) {
parseCompositor( context, childElement, ct );
}
childElement = childElement.nextSiblingElement();
}
foreach( Element e, newElements ) {
e.setCompositor( compositor );
ct.addElement( e );
}
示例7: all
void Parser::all( ParserContext *context, const QDomElement &element, ComplexType &ct )
{
QDomElement childElement = element.firstChildElement();
while ( !childElement.isNull() ) {
QName name = childElement.tagName();
if ( name.localName() == "element" ) {
ct.addElement( parseElement( context, childElement, ct.nameSpace(),
childElement ) );
} else if ( name.localName() == "annotation" ) {
Annotation::List annotations = parseAnnotation( context, childElement );
ct.setDocumentation( annotations.documentation() );
ct.setAnnotations( annotations );
}
childElement = childElement.nextSiblingElement();
}
}
示例8: parseAnnotation
Annotation::List Parser::parseAnnotation( ParserContext *,
const QDomElement &element )
{
Annotation::List result;
QDomElement e;
for( e = element.firstChildElement(); !e.isNull();
e = e.nextSiblingElement() ) {
QName name = e.tagName();
if ( name.localName() == "documentation" ) {
result.append( Annotation( e ) );
} else if ( name.localName() == "appinfo" ) {
result.append( Annotation( e ) );
}
}
return result;
}
示例9: parseAnnotation
Annotation::List Parser::parseAnnotation( ParserContext *context, const QDomElement &element )
{
Annotation::List result;
QDomElement child;
for( child = element.firstChildElement(); !child.isNull();
child = child.nextSiblingElement() ) {
NSManager namespaceManager( context, child );
const QName name( child.tagName() );
if ( name.localName() == QLatin1String("documentation") ) {
result.append( Annotation( child ) );
} else if ( name.localName() == QLatin1String("appinfo") ) {
result.append( Annotation( child ) );
}
}
return result;
}
示例10:
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;
}
示例11: parseComplexType
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;
}
示例12: 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();
}
示例13: 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();
}
示例14: parseComplexType
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;
}
示例15: 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();
}