63 return QtXmlPatterns::tr(
"Required type is %1, but %2 was found.")
74 "This test ensures 'code' exists, otherwise codeToString() would assert.");
81 return verifyType(cardVerified, reqType, context, code, options);
107 context->
warning(QtXmlPatterns::tr(
"Promoting %1 to %2 may cause loss of precision.")
141 "When the Expression sets the RequiresContextItem property, it must " 142 "return a type in expectedContextItemType()");
176 if(reqType->isAtomicType())
184 if(!operandType->isAtomicType())
191 if(reqType->xdtTypeMatches(operandType))
206 context, reqSeqType);
218 numberArgs.
append(operand);
228 if(reqType->xdtTypeMatches(operandType))
241 if(operandType->xdtTypeMatches(reqType))
252 else if(reqType->isNodeType())
267 else if(!operandType->xdtTypeMatches(reqType))
282 if(!reqType->xdtTypeMatches(operandType) &&
283 !operandSeqType->cardinality().allowsEmpty())
286 code, operand.
data());
static QString codeToString(const ReportContext::ErrorCode errorCode)
virtual bool compatModeEnabled() const =0
#define QT_END_NAMESPACE
This macro expands to.
Base class for all AST nodes in an XPath/XQuery/XSL-T expression.
static Expression::Ptr typeCheck(Expression *const op, const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
QString formatType(const NamePool::Ptr &np, const T &type)
Formats ItemType and SequenceType.
virtual NamePool::Ptr namePool() const =0
virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context, const SequenceType::Ptr &reqType)
bool testFlag(Enum f) const
Returns true if the flag is set, otherwise false.
The QString class provides a Unicode character string.
virtual ItemType::Ptr expectedContextItemType() const
When set, the function conversion rules are applied.
static Expression::Ptr verifyCardinality(const Expression::Ptr &operand, const Cardinality &card, const StaticContext::Ptr &context, const ReportContext::ErrorCode code=ReportContext::XPTY0004)
static const AtomicType::Ptr xsString
void append(const T &t)
Inserts value at the end of the list.
T * data() const
Returns a pointer to the shared data object.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void error(const QString &message, const ReportContext::ErrorCode errorCode, const QSourceLocation &sourceLocation)
static bool isEmpty(const char *str)
static const ItemType::Ptr item
The namespace for the internal API of QtXmlPatterns.
static const AtomicType::Ptr xsDouble
virtual Cardinality cardinality() const =0
Verifies that the items in a sequence an Expression evaluates is of a certain ItemType.
virtual QExplicitlySharedDataPointer< FunctionFactory > functionSignatures() const =0
virtual Expression::List operands() const =0
static const AtomicType::Ptr xsUntypedAtomic
Performs atomization. Effectively, it is an implementation of the fn:data() function.
T & first()
Returns a reference to the first item in the list.
QExplicitlySharedDataPointer< Expression > Ptr
A smart pointer wrapping mutable Expression instances.
virtual SequenceType::Ptr staticType() const =0
UntypedAtomicConverter for ArgumentReference, if needed.
static const EmptySequenceType::Ptr Empty
#define Q_ASSERT_X(cond, where, what)
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Contains functions used for formatting arguments, such as keywords and paths, in translated strings...
static Expression::Ptr verifyType(const Expression::Ptr &operand, const SequenceType::Ptr &reqSeqType, const StaticContext::Ptr &context, const ReportContext::ErrorCode code, const Options options)
Implements the type checking and promotion part of the Function Conversion Rules. ...
static Expression::Ptr applyFunctionConversion(const Expression::Ptr &operand, const SequenceType::Ptr &reqType, const StaticContext::Ptr &context, const ReportContext::ErrorCode code=ReportContext::XPTY0004, const Options=Options(AutomaticallyConvert|CheckFocus))
Builds a pipeline of artificial AST nodes that ensures operand conforms to the type reqType by applyi...
static const AtomicType::Ptr xsFloat
virtual Properties properties() const
static const AtomicType::Ptr numeric
virtual ItemType::Ptr contextItemType() const =0
The static type of the context item.
static const SequenceType::Ptr EBV
Casts every item in a sequence obtained from evaluating an Expression, to a requested atomic type...
static const AtomicType::Ptr xsDecimal
static QString wrongType(const NamePool::Ptr &np, const ItemType::Ptr &reqType, const ItemType::Ptr &opType)
Centralizes a message-string to reduce work for translators and increase consistency.
void warning(const QString &message, const QSourceLocation &sourceLocation=QSourceLocation())
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
virtual ItemType::Ptr itemType() const =0
void wrapExpressionWith(const SourceLocationReflection *const existingNode, const QExplicitlySharedDataPointer< Expression > &newNode)
Ensures source locations are handled in such a manner that existingNode wraps newNode.
bool is(const ID id) const
static const AtomicType::Ptr xsAnyURI
static QByteArray toType(const QByteArray &t)
static bool promotionPossible(const ItemType::Ptr &fromType, const ItemType::Ptr &toType, const StaticContext::Ptr &context)
Whether the focus should be checked or not.