Qt 4.8
qxsdschemahelper_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
49 //
50 // We mean it.
51 
52 #ifndef Patternist_XsdSchemaHelper_H
53 #define Patternist_XsdSchemaHelper_H
54 
55 #include "qcomparisonfactory_p.h"
56 #include "qschematype_p.h"
57 #include "qxsdattributegroup_p.h"
58 #include "qxsdelement_p.h"
59 #include "qxsdparticle_p.h"
60 #include "qxsdschemacontext_p.h"
61 #include "qxsdwildcard_p.h"
62 
64 
66 
67 namespace QPatternist
68 {
69 
77  {
78  public:
83  static bool isParticleEmptiable(const XsdParticle::Ptr &particle);
84 
88  static bool wildcardAllowsNamespaceName(const QString &nameSpace,
89  const XsdWildcard::NamespaceConstraint::Ptr &constraint);
90 
94  static bool wildcardAllowsExpandedName(const QXmlName &name,
95  const XsdWildcard::Ptr &wildcard,
96  const NamePool::Ptr &namePool);
97 
101  static bool isWildcardSubset(const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &otherWildcard);
102 
106  static XsdWildcard::Ptr wildcardUnion(const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &otherWildcard);
107 
112  const XsdWildcard::Ptr &otherWildcard);
113 
118  static bool isValidlySubstitutable(const SchemaType::Ptr &type,
119  const SchemaType::Ptr &otherType,
120  const SchemaType::DerivationConstraints &constraints);
121 
126  static bool isSimpleDerivationOk(const SchemaType::Ptr &derivedType,
127  const SchemaType::Ptr &baseType,
128  const SchemaType::DerivationConstraints &constraints);
129 
134  static bool isComplexDerivationOk(const SchemaType::Ptr &derivedType,
135  const SchemaType::Ptr &baseType,
136  const SchemaType::DerivationConstraints &constraints);
137 
143  static bool constructAndCompare(const DerivedString<TypeString>::Ptr &operand1,
145  const DerivedString<TypeString>::Ptr &operand2,
146  const SchemaType::Ptr &type,
147  const ReportContext::Ptr &context,
148  const SourceLocationReflection *const sourceLocationReflection);
149 
154  static bool checkWildcardProcessContents(const XsdWildcard::Ptr &baseWildcard,
155  const XsdWildcard::Ptr &derivedWildcard);
156 
160  static bool foundSubstitutionGroupTransitive(const XsdElement::Ptr &head,
161  const XsdElement::Ptr &member,
162  QSet<XsdElement::Ptr> &visitedElements);
163 
168  static void foundSubstitutionGroupTypeInheritance(const SchemaType::Ptr &headType,
169  const SchemaType::Ptr &memberType,
170  QSet<SchemaType::DerivationMethod> &derivationSet,
171  NamedSchemaComponent::BlockingConstraints &blockSet);
172 
176  static bool substitutionGroupOkTransitive(const XsdElement::Ptr &head,
177  const XsdElement::Ptr &member,
178  const NamePool::Ptr &namePool);
179 
183  static bool isValidAttributeGroupRestriction(const XsdAttributeGroup::Ptr &derivedAttributeGroup,
184  const XsdAttributeGroup::Ptr &attributeGroup,
185  const XsdSchemaContext::Ptr &context,
186  QString &errorMsg);
187 
191  static bool isValidAttributeUsesRestriction(const XsdAttributeUse::List &derivedAttributeUses,
192  const XsdAttributeUse::List &attributeUses,
193  const XsdWildcard::Ptr &derivedWildcard,
194  const XsdWildcard::Ptr &wildcard,
195  const XsdSchemaContext::Ptr &context,
196  QString &errorMsg);
197 
201  static bool isValidAttributeUsesExtension(const XsdAttributeUse::List &derivedAttributeUses,
202  const XsdAttributeUse::List &attributeUses,
203  const XsdWildcard::Ptr &derivedWildcard,
204  const XsdWildcard::Ptr &wildcard,
205  const XsdSchemaContext::Ptr &context,
206  QString &errorMsg);
207 
208  private:
210  };
211 }
212 
214 
216 
217 #endif
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
static bool wildcardAllowsNamespaceName(const QString &nameSpace, const XsdWildcard::NamespaceConstraint::Ptr &constraint)
static XsdWildcard::Ptr wildcardIntersection(const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &otherWildcard)
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
static bool foundSubstitutionGroupTransitive(const XsdElement::Ptr &head, const XsdElement::Ptr &member, QSet< XsdElement::Ptr > &visitedElements)
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
Contains helper methods that are used by XsdSchemaParser, XsdSchemaResolver and XsdSchemaChecker.
The QString class provides a Unicode character string.
Definition: qstring.h:83
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 void foundSubstitutionGroupTypeInheritance(const SchemaType::Ptr &headType, const SchemaType::Ptr &memberType, QSet< SchemaType::DerivationMethod > &derivationSet, NamedSchemaComponent::BlockingConstraints &blockSet)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static bool checkWildcardProcessContents(const XsdWildcard::Ptr &baseWildcard, const XsdWildcard::Ptr &derivedWildcard)
const char * name
static bool isValidAttributeUsesExtension(const XsdAttributeUse::List &derivedAttributeUses, const XsdAttributeUse::List &attributeUses, const XsdWildcard::Ptr &derivedWildcard, const XsdWildcard::Ptr &wildcard, const XsdSchemaContext::Ptr &context, QString &errorMsg)
The namespace for the internal API of QtXmlPatterns.
static bool isValidAttributeGroupRestriction(const XsdAttributeGroup::Ptr &derivedAttributeGroup, const XsdAttributeGroup::Ptr &attributeGroup, const XsdSchemaContext::Ptr &context, QString &errorMsg)
static bool isComplexDerivationOk(const SchemaType::Ptr &derivedType, const SchemaType::Ptr &baseType, const SchemaType::DerivationConstraints &constraints)
static bool isSimpleDerivationOk(const SchemaType::Ptr &derivedType, const SchemaType::Ptr &baseType, const SchemaType::DerivationConstraints &constraints)
static bool isWildcardSubset(const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &otherWildcard)
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Definition: qxmlname.h:58
static XsdWildcard::Ptr wildcardUnion(const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &otherWildcard)
static bool isParticleEmptiable(const XsdParticle::Ptr &particle)
static bool substitutionGroupOkTransitive(const XsdElement::Ptr &head, const XsdElement::Ptr &member, const NamePool::Ptr &namePool)
static bool isValidlySubstitutable(const SchemaType::Ptr &type, const SchemaType::Ptr &otherType, const SchemaType::DerivationConstraints &constraints)
static bool wildcardAllowsExpandedName(const QXmlName &name, const XsdWildcard::Ptr &wildcard, const NamePool::Ptr &namePool)
#define QT_END_HEADER
Definition: qglobal.h:137
Base class for all instances that represents something at a certain location.
static bool isValidAttributeUsesRestriction(const XsdAttributeUse::List &derivedAttributeUses, const XsdAttributeUse::List &attributeUses, const XsdWildcard::Ptr &derivedWildcard, const XsdWildcard::Ptr &wildcard, const XsdSchemaContext::Ptr &context, QString &errorMsg)