69 : m_sourceLocation(location)
107 number = number.
mid(1);
121 const int length = lexicalValue.
length() - 1;
125 while (lexicalValue.
at(pos) == zeroChar && (pos != length))
133 while (value.
at(pos) == zeroChar) {
137 value = value.
left(pos + 1);
142 for (
int i = 0; i < value.
count(); ++i)
146 if (totalDigits == 0)
162 return (trimmedValue.length() - pos - 1);
167 , m_namePool(m_context->namePool())
168 , m_namespaceBindings(namespaceBindings)
213 while (it.hasNext()) {
216 result.
insert(it.key(), it.value());
276 for (
int i = 0; i < entries.
count(); ++i) {
284 for (
int i = 0; i < entries.
count(); ++i) {
291 *boundType = simpleType->
itemType();
300 bool foundValidType =
false;
301 for (
int i = 0; i < memberTypes.
count(); ++i) {
304 foundValidType =
true;
307 *boundType = memberTypes.
at(i);
313 if (!foundValidType) {
328 return (value == otherValue);
334 if (valueName == otherValueName)
350 for (
int i = 0; i < values.
count(); ++i) {
358 for (
int i = 0; i < memberTypes.
count(); ++i) {
429 if (length->toInteger() != value.
length()) {
430 errorMsg = QtXmlPatterns::tr(
"String content does not match the length facet.");
437 if (length->toInteger() > value.
length()) {
438 errorMsg = QtXmlPatterns::tr(
"String content does not match the minLength facet.");
445 if (length->toInteger() < value.
length()) {
446 errorMsg = QtXmlPatterns::tr(
"String content does not match the maxLength facet.");
454 for (
int j = 0; j < multiValue.
count(); ++j) {
464 errorMsg = QtXmlPatterns::tr(
"String content does not match pattern facet.");
474 for (
int j = 0; j < multiValue.
count(); ++j) {
482 errorMsg = QtXmlPatterns::tr(
"String content is not listed in the enumeration facet.");
498 if (facetValue->toInteger() < value) {
499 errorMsg = QtXmlPatterns::tr(
"Signed integer content does not match the maxInclusive facet.");
506 if (facetValue->toInteger() <= value) {
507 errorMsg = QtXmlPatterns::tr(
"Signed integer content does not match the maxExclusive facet.");
514 if (facetValue->toInteger() > value) {
515 errorMsg = QtXmlPatterns::tr(
"Signed integer content does not match the minInclusive facet.");
522 if (facetValue->toInteger() >= value) {
523 errorMsg = QtXmlPatterns::tr(
"Signed integer content does not match the minExclusive facet.");
533 for (
int j = 0; j < multiValue.
count(); ++j) {
541 errorMsg = QtXmlPatterns::tr(
"Signed integer content is not listed in the enumeration facet.");
549 for (
int j = 0; j < multiValue.
count(); ++j) {
559 errorMsg = QtXmlPatterns::tr(
"Signed integer content does not match pattern facet.");
568 errorMsg = QtXmlPatterns::tr(
"Signed integer content does not match in the totalDigits facet.");
584 if (facetValue->toUnsignedInteger() < value) {
585 errorMsg = QtXmlPatterns::tr(
"Unsigned integer content does not match the maxInclusive facet.");
592 if (facetValue->toUnsignedInteger() <= value) {
593 errorMsg = QtXmlPatterns::tr(
"Unsigned integer content does not match the maxExclusive facet.");
600 if (facetValue->toUnsignedInteger() > value) {
601 errorMsg = QtXmlPatterns::tr(
"Unsigned integer content does not match the minInclusive facet.");
608 if (facetValue->toUnsignedInteger() >= value) {
609 errorMsg = QtXmlPatterns::tr(
"Unsigned integer content does not match the minExclusive facet.");
619 for (
int j = 0; j < multiValue.
count(); ++j) {
627 errorMsg = QtXmlPatterns::tr(
"Unsigned integer content is not listed in the enumeration facet.");
635 for (
int j = 0; j < multiValue.
count(); ++j) {
645 errorMsg = QtXmlPatterns::tr(
"Unsigned integer content does not match pattern facet.");
654 errorMsg = QtXmlPatterns::tr(
"Unsigned integer content does not match in the totalDigits facet.");
670 if (facetValue->toDouble() < value) {
671 errorMsg = QtXmlPatterns::tr(
"Double content does not match the maxInclusive facet.");
678 if (facetValue->toDouble() <= value) {
679 errorMsg = QtXmlPatterns::tr(
"Double content does not match the maxExclusive facet.");
686 if (facetValue->toDouble() > value) {
687 errorMsg = QtXmlPatterns::tr(
"Double content does not match the minInclusive facet.");
694 if (facetValue->toDouble() >= value) {
695 errorMsg = QtXmlPatterns::tr(
"Double content does not match the minExclusive facet.");
706 for (
int j = 0; j < multiValue.count(); ++j) {
714 if (facetValue->isNaN() && valuePtr->isNaN()) {
721 errorMsg = QtXmlPatterns::tr(
"Double content is not listed in the enumeration facet.");
729 for (
int j = 0; j < multiValue.
count(); ++j) {
739 errorMsg = QtXmlPatterns::tr(
"Double content does not match pattern facet.");
757 errorMsg = QtXmlPatterns::tr(
"Decimal content does not match in the fractionDigits facet.");
766 errorMsg = QtXmlPatterns::tr(
"Decimal content does not match in the totalDigits facet.");
779 if (facetValue->toDateTime() < value) {
780 errorMsg = QtXmlPatterns::tr(
"Date time content does not match the maxInclusive facet.");
787 if (facetValue->toDateTime() <= value) {
788 errorMsg = QtXmlPatterns::tr(
"Date time content does not match the maxExclusive facet.");
795 if (facetValue->toDateTime() > value) {
796 errorMsg = QtXmlPatterns::tr(
"Date time content does not match the minInclusive facet.");
803 if (facetValue->toDateTime() >= value) {
804 errorMsg = QtXmlPatterns::tr(
"Date time content does not match the minExclusive facet.");
813 for (
int j = 0; j < multiValue.
count(); ++j) {
815 if (facetValue->toDateTime() == value) {
822 errorMsg = QtXmlPatterns::tr(
"Date time content is not listed in the enumeration facet.");
830 for (
int j = 0; j < multiValue.
count(); ++j) {
840 errorMsg = QtXmlPatterns::tr(
"Date time content does not match pattern facet.");
855 errorMsg = QtXmlPatterns::tr(
"Duration content does not match the maxInclusive facet.");
864 errorMsg = QtXmlPatterns::tr(
"Duration content does not match the maxExclusive facet.");
873 errorMsg = QtXmlPatterns::tr(
"Duration content does not match the minInclusive facet.");
882 errorMsg = QtXmlPatterns::tr(
"Duration content does not match the minExclusive facet.");
892 for (
int j = 0; j < multiValue.
count(); ++j) {
900 errorMsg = QtXmlPatterns::tr(
"Duration content is not listed in the enumeration facet.");
908 for (
int j = 0; j < multiValue.
count(); ++j) {
918 errorMsg = QtXmlPatterns::tr(
"Duration content does not match pattern facet.");
935 for (
int j = 0; j < multiValue.
count(); ++j) {
945 errorMsg = QtXmlPatterns::tr(
"Boolean content does not match pattern facet.");
961 if (length->toInteger() != value.
length()) {
962 errorMsg = QtXmlPatterns::tr(
"Binary content does not match the length facet.");
969 if (length->toInteger() > value.
length()) {
970 errorMsg = QtXmlPatterns::tr(
"Binary content does not match the minLength facet.");
977 if (length->toInteger() < value.
length()) {
978 errorMsg = QtXmlPatterns::tr(
"Binary content does not match the maxLength facet.");
986 for (
int j = 0; j < multiValue.
count(); ++j) {
989 if (value == facetValue) {
996 errorMsg = QtXmlPatterns::tr(
"Binary content is not listed in the enumeration facet.");
1023 errorMsg = QtXmlPatterns::tr(
"Invalid QName content: %1.").
arg(
formatData(lexicalValue));
1030 for (
int j = 0; j < multiValue.
count(); ++j) {
1033 if (value == facetValue) {
1040 errorMsg = QtXmlPatterns::tr(
"QName content is not listed in the enumeration facet.");
1048 for (
int j = 0; j < multiValue.
count(); ++j) {
1058 errorMsg = QtXmlPatterns::tr(
"QName content does not match pattern facet.");
1084 for (
int j = 0; j < multiValue.
count(); ++j) {
1087 if (value == facetValue) {
1094 errorMsg = QtXmlPatterns::tr(
"Notation content is not listed in the enumeration facet.");
1112 if (value->toInteger() != values.
count()) {
1113 errorMsg = QtXmlPatterns::tr(
"List content does not match length facet.");
1119 if (value->toInteger() > values.
count()) {
1120 errorMsg = QtXmlPatterns::tr(
"List content does not match minLength facet.");
1126 if (value->toInteger() < values.
count()) {
1127 errorMsg = QtXmlPatterns::tr(
"List content does not match maxLength facet.");
1139 for (
int i = 0; i < values.
count(); ++i) {
1147 for (
int i = 0; i < multiValue.
count(); ++i) {
1152 for (
int j = 0; j < facetValueList.
count(); ++j) {
1157 if (instanceValues.
count() != facetValues.
count())
1161 bool matchesAll =
true;
1162 for (
int j = 0; j < instanceValues.
count(); ++j) {
1163 if (instanceValues.
at(j) != facetValues.
at(j)) {
1177 for (
int i = 0; i < values.
count(); ++i) {
1187 for (
int i = 0; i < multiValue.
count(); ++i) {
1192 for (
int j = 0; j < facetValueList.
count(); ++j) {
1197 if (instanceValues.
count() != facetValues.
count())
1201 bool matchesAll =
true;
1202 for (
int j = 0; j < instanceValues.
count(); ++j) {
1217 errorMsg = QtXmlPatterns::tr(
"List content is not listed in the enumeration facet.");
1225 for (
int j = 0; j < multiValue.
count(); ++j) {
1235 errorMsg = QtXmlPatterns::tr(
"List content does not match pattern facet.");
1263 for (
int i = 0; i < memberTypes.
count(); ++i) {
1265 for (
int j = 0; j < facetValues.
count(); ++j) {
1274 errorMsg = QtXmlPatterns::tr(
"Union content is not listed in the enumeration facet.");
1282 for (
int j = 0; j < multiValue.
count(); ++j) {
1292 errorMsg = QtXmlPatterns::tr(
"Union content does not match pattern facet.");
1345 return QXmlName(namespaceCode, localNameCode, prefixCode);
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Match an assertion (Assertion Definition)
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static AtomicValue::Ptr fromLexical(const QString &lexicalValue, const SchemaType::Ptr &type, const ReportContext::Ptr &context, const SourceLocationReflection *const sourceLocationReflection)
Returns an AtomicValue of type type from the lexical space lexicalValue, and raise an error through c...
static const AtomicType::Ptr xsBase64Binary
static AnySimpleType::Ptr comparableType(const AnySimpleType::Ptr &type)
virtual TypeCategory category() const
virtual qulonglong toUnsignedInteger() const =0
#define QT_END_NAMESPACE
This macro expands to.
NamespaceCode LocalNameCode
Base class for classes implementing values related to time, date or both.
Match a minimum inclusive (Minimum Inclusive Definition)
const QChar at(int i) const
Returns the character at the given index position in the string.
The QRegExp class provides pattern matching using regular expressions.
bool checkConstrainingFacetsString(const QString &value, const XsdFacet::Hash &facets, const AnySimpleType::Ptr &type, QString &errorMsg) const
virtual bool hasError() const
#define it(className, varName)
int count(const T &t) const
Returns the number of occurrences of value in the vector.
static const AtomicType::Ptr xsDuration
XsdSchemaSourceLocationReflection(const QSourceLocation &location)
QString & replace(int i, int len, QChar after)
QString formatType(const NamePool::Ptr &np, const T &type)
Formats ItemType and SequenceType.
The QByteArray class provides an array of bytes.
int length() const
Returns the number of characters in this string.
QXmlName convertToQName(const QString &name) const
virtual TypeCategory category() const
static const AtomicType::Ptr xsGYearMonth
static AtomicValue::Ptr createError(const QString &description=QString(), const ReportContext::ErrorCode=ReportContext::FORG0001)
static int totalDigitsForSignedLongLong(long long value)
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static const AtomicType::Ptr xsGMonthDay
bool checkConstrainingFacetsUnion(const QString &value, const QString &lexicalValue, const XsdSimpleType::Ptr &simpleType, const XsdFacet::Hash &facets, QString &errorMsg) const
bool checkConstrainingFacetsDuration(const AtomicValue::Ptr &value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const
bool checkConstrainingFacetsDateTime(const QDateTime &value, const QString &lexicalValue, const XsdFacet::Hash &facets, const AnySimpleType::Ptr &type, QString &errorMsg) const
int count(const T &t) const
Returns the number of occurrences of value in the list.
virtual NamePool::Ptr namePool() const
const QSourceLocation m_sourceLocation
XsdSchemaContext::Ptr m_context
The QString class provides a Unicode character string.
static QString toString(NodeName token)
static bool constructAndCompare(const DerivedString< TypeString >::Ptr &operand1, const AtomicComparator::Operator op, const DerivedString< TypeString >::Ptr &operand2, const SchemaType::Ptr &type, const ReportContext::Ptr &context, const SourceLocationReflection *const sourceLocationReflection)
static int totalDigitsForUnsignedLongLong(unsigned long long value)
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
QString prefix(const QXmlNamePool &query) const
Returns the prefix.
const T value(const Key &key) const
Returns the value associated with the key.
static const AtomicType::Ptr xsUnsignedByte
QHash< XsdFacet::Type, XsdFacet::Ptr > Hash
virtual QXmlName name(const NamePool::Ptr &np) const
Returns the name of the type.
Match a maximum exclusive (Maximum Exclusive Definition)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
static const AtomicType::Ptr xsString
QXmlName::PrefixCode allocatePrefix(const QString &prefix)
static int fractionDigitsForDecimal(const QString &lexicalValue)
Match an enumeration (Enumeration Definition)
QXmlName::LocalNameCode allocateLocalName(const QString &ln)
void append(const T &t)
Inserts value at the end of the list.
static const AtomicType::Ptr xsGDay
virtual SchemaType::Ptr wxsSuperType() const
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual const SourceLocationReflection * actualReflection() const
const TCastTarget * as() const
Match the minimum length (Minimum Length Definition)
static XsdFacet::Hash mergedFacetsForType(const SchemaType::Ptr &type, const XsdSchemaContext::Ptr &context)
static QNameValue::Ptr fromValue(const NamePool::Ptr &np, const QXmlName name)
bool checkConstrainingFacetsSignedInteger(long long value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
static const AtomicType::Ptr xsDateTime
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
virtual xsDouble toDouble() const
const T & at(int i) const
Returns the item at index position i in the list.
AtomicValue::Ptr fromLexical(const QString &value, const SchemaType::Ptr &type, const ReportContext::Ptr &context, const SourceLocationReflection *const reflection) const
The QStringList class provides a list of strings.
static int totalDigitsForDecimal(const QString &lexicalValue)
static const AtomicType::Ptr xsUnsignedInt
The namespace for the internal API of QtXmlPatterns.
static const AtomicType::Ptr xsDouble
The QSourceLocation class identifies a location in a resource by URI, line, and column.
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
virtual QString stringValue() const =0
bool checkConstrainingFacetsBoolean(bool value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const
static QString normalizedValue(const QString &value, const XsdFacet::Hash &facets)
bool checkConstrainingFacetsQName(const QXmlName &, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const
const QDateTime & toDateTime() const
bool isValidString(const QString &normalizedString, const AnySimpleType::Ptr &type, QString &errorMsg, AnySimpleType::Ptr *boundType=0) const
const NamePool::Ptr m_namePool
static const AtomicType::Ptr xsGYear
static QString formatData(const QString &data)
Match a whitespace rule (White Space Definition)
Match a maximum inclusive (Maximum Inclusive Definition)
const T & at(int i) const
Returns the item at index position i in the vector.
static const AtomicType::Ptr xsUntypedAtomic
bool checkConstrainingFacetsUnsignedInteger(unsigned long long value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const
virtual QSourceLocation sourceLocation() const
int length() const
Same as size().
Implements the value instance of the xs:boolean type.
Match some double digits (Fraction Digits Definition)
T & first()
Returns a reference to the first item in the list.
Represents instances of derived xs:string types, such as xs:normalizedString.
Match a minimum exclusive (Minimum Exclusive Definition)
static const MacSpecialKey entries[NumEntries]
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
NamespaceCode namespaceURI() const
Match some integer digits (Total Digits Definition)
bool valuesAreEqual(const QString &value, const QString &otherValue, const AnySimpleType::Ptr &type) const
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...
The QDateTime class provides date and time functions.
static const AtomicType::Ptr xsQName
Base class for all numeric values.
static bool wxsTypeMatches(const SchemaType::Ptr &type, const SchemaType::Ptr &otherType, QSet< SchemaType::Ptr > &visitedTypes, SchemaType::Ptr &conflictingType)
QExplicitlySharedDataPointer< XsdSimpleType > Ptr
QString simplified() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end, and that has each sequence o...
Match the exact length (Length Definition)
virtual xsInteger toInteger() const =0
An implementation of SourceLocationReflection that takes a QSourceLocation.
static const SchemaType::Ptr xsAnySimpleType
Match a regular expression (Pattern Definition)
static const AtomicType::Ptr xsFloat
static QTestResult::TestLocation location
Implements the value instance of the xs:QName type.
XsdFacet::Hash facetsForType(const AnySimpleType::Ptr &type) const
virtual xsDouble toDouble() const =0
static Numeric::Ptr fromValue(const xsDouble num)
QExplicitlySharedDataPointer< AnySimpleType > Ptr
AnySimpleType::Ptr primitiveType() const
static const AtomicType::Ptr xsInteger
QHashIterator< XsdFacet::Type, XsdFacet::Ptr > HashIterator
Implements the value instance of the xs:decimal type.
static const AtomicType::Ptr xsTime
const QByteArray & asByteArray() const
AnySimpleType::List memberTypes() const
bool exactMatch(const QString &str) const
Returns true if str is matched exactly by this regular expression; otherwise returns false...
static const AtomicType::Ptr xsUnsignedShort
static const AtomicType::Ptr xsDecimal
static const AtomicType::Ptr xsBoolean
bool checkConstrainingFacetsDecimal(const AtomicValue::Ptr &value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
SourceLocationReflection * m_reflection
static const AtomicType::Ptr xsDate
QVector< QXmlName > m_namespaceBindings
static const AtomicType::Ptr xsLong
static bool isQName(const QString &qName)
bool checkConstrainingFacetsNotation(const QXmlName &value, const XsdFacet::Hash &facets, QString &errorMsg) const
Implements the value instance of the xs:base64Binary type.
virtual bool isDefinedBySchema() const
bool checkConstrainingFacetsDouble(double value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const
static const AtomicType::Ptr xsNOTATION
static const AtomicType::Ptr xsGMonth
virtual SchemaType::Ptr wxsSuperType() const =0
bool checkConstrainingFacets(const AtomicValue::Ptr &value, const QString &lexicalValue, const AnySimpleType::Ptr &type, QString &errorMsg) const
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
static const AtomicType::Ptr xsHexBinary
static const AtomicType::Ptr xsUnsignedLong
bool isDigit() const
Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false...
static const AtomicType::Ptr xsAnyURI
virtual QXmlName name(const NamePool::Ptr &np) const =0
Returns the name of the type.
Match the maximum length (Maximum Length Definition)
XsdTypeChecker(const XsdSchemaContext::Ptr &context, const QVector< QXmlName > &namespaceBindings, const QSourceLocation &location)
static AtomicValue::Ptr fromLexical(const NamePool::Ptr &np, const QString &lexical)
Base class for all instances that represents something at a certain location.
bool checkConstrainingFacetsList(const QStringList &values, const QString &lexicalValue, const AnySimpleType::Ptr &itemType, const XsdFacet::Hash &facets, QString &errorMsg) const
bool checkConstrainingFacetsBinary(const QByteArray &value, const XsdFacet::Hash &facets, const AnySimpleType::Ptr &type, QString &errorMsg) const
AnySimpleType::Ptr itemType() const