本文整理汇总了C++中itemtype::Ptr::isNodeType方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::isNodeType方法的具体用法?C++ Ptr::isNodeType怎么用?C++ Ptr::isNodeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类itemtype::Ptr
的用法示例。
在下文中一共展示了Ptr::isNodeType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xdtTypeMatches
bool XSLTNodeTest::xdtTypeMatches(const ItemType::Ptr &other) const
{
if(!other->isNodeType())
return false;
return *static_cast<const XSLTNodeTest *>(other.data()) == *this
? true
: xdtTypeMatches(other->xdtSuperType());
}
示例2: xdtTypeMatches
bool BuiltinNodeType<kind>::xdtTypeMatches(const ItemType::Ptr &other) const
{
if(!other->isNodeType())
return false;
return *static_cast<const BuiltinNodeType *>(other.data()) == *this
? true
: xdtTypeMatches(other->xdtSuperType());
}
示例3: xdtTypeMatches
bool AbstractNodeTest::xdtTypeMatches(const ItemType::Ptr &other) const
{
Q_ASSERT(other);
if(other->isNodeType())
{
if(*other == *this)
return true;
else
return xdtTypeMatches(other->xdtSuperType());
}
else
return false;
}
示例4: verifyType
//.........这里部分代码省略.........
return result;
}
const bool compatModeEnabled = context->compatModeEnabled();
if((options.testFlag(AutomaticallyConvert) && BuiltinTypes::xsUntypedAtomic->xdtTypeMatches(operandType)) ||
(compatModeEnabled && BuiltinTypes::xsString->xdtTypeMatches(reqType)))
{
if(*reqType == *BuiltinTypes::numeric)
{
result = typeCheck(new UntypedAtomicConverter(result, BuiltinTypes::xsDouble, code),
context, reqSeqType);
}
else
result = typeCheck(new UntypedAtomicConverter(result, reqType, code), context, reqSeqType);
/* The UntypedAtomicConverter might know more about the type, so reload. */
operandType = result->staticType()->itemType();
}
else if(compatModeEnabled && *reqType == *BuiltinTypes::xsDouble)
{
const FunctionFactory::Ptr functions(context->functionSignatures());
Expression::List numberArgs;
numberArgs.append(operand);
result = functions->createFunctionCall(QXmlName(StandardNamespaces::fn, StandardLocalNames::number),
numberArgs,
context,
operand.data())->typeCheck(context, reqSeqType);
operandType = result->staticType()->itemType();
context->wrapExpressionWith(operand.data(), result);
}
if(reqType->xdtTypeMatches(operandType))
return result;
/* Test if promotion will solve it; the xdtTypeMatches didn't
* do that. */
if(options.testFlag(AutomaticallyConvert) && promotionPossible(operandType, reqType, context))
{
if(options.testFlag(GeneratePromotion))
return Expression::Ptr(new UntypedAtomicConverter(result, reqType));
else
return result;
}
if(operandType->xdtTypeMatches(reqType))
{
/* For example, operandType is numeric, and reqType is xs:integer. */
return Expression::Ptr(new ItemVerifier(result, reqType, code));
}
else
{
context->error(wrongType(context->namePool(), reqType, operandType), code, operand.data());
return result;
}
}
else if(reqType->isNodeType())
{
ReportContext::ErrorCode myCode;
if(*reqType == *CommonSequenceTypes::EBV->itemType())
myCode = ReportContext::FORG0006;
else
myCode = code;
/* empty-sequence() is considered valid because it's ok to do
* for example nilled( () ). That is, to pass an empty sequence to a
* function requiring for example node()?. */
if(*operandType == *CommonSequenceTypes::Empty)
return result;
else if(!operandType->xdtTypeMatches(reqType))
{
context->error(wrongType(context->namePool(), reqType, operandType), myCode, operand.data());
return result;
}
/* Operand must be an item. Thus, the sequence can contain both
* nodes and atomic values: we have to verify. */
return Expression::Ptr(new ItemVerifier(result, reqType, myCode));
}
else
{
Q_ASSERT(*reqType == *CommonSequenceTypes::Empty);
/* element() doesn't match empty-sequence(), but element()* does. */
if(!reqType->xdtTypeMatches(operandType) &&
!operandSeqType->cardinality().allowsEmpty())
{
context->error(wrongType(context->namePool(), reqType, operandType),
code, operand.data());
return result;
}
}
/* This line should be reached if required type is
* EBVType, and the operand is compatible. */
return result;
}
示例5: xdtTypeMatches
bool AnyNodeType::xdtTypeMatches(const ItemType::Ptr &other) const
{
return other->isNodeType();
}