Qt 4.8
qbasictypesfactory.cpp
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 #include "qbuiltintypes_p.h"
44 #include "qcommonnamespaces_p.h"
45 
46 #include "qbasictypesfactory_p.h"
47 
49 
50 using namespace QPatternist;
51 
53 {
54  /* We don't store a global static here, because it's dependent on the NamePool. */
56 }
57 
59 {
60  m_types.reserve(48);
61 
62 #define add(aName) m_types.insert(BuiltinTypes::aName->name(np), AtomicType::Ptr(BuiltinTypes::aName))
63 #define addNA(aName) m_types.insert(BuiltinTypes::aName->name(np), BuiltinTypes::aName)
64  add(xsString);
65  add(xsBoolean);
66  add(xsDecimal);
67  add(xsDouble);
68  add(xsFloat);
69  add(xsDate);
70  add(xsTime);
71  add(xsDateTime);
72  add(xsDuration);
73  add(xsAnyURI);
74  add(xsGDay);
76  add(xsGMonth);
78  add(xsGYear);
79  add(xsBase64Binary);
80  add(xsHexBinary);
81  add(xsQName);
82  add(xsInteger);
83  addNA(xsAnyType);
84  addNA(xsAnySimpleType);
85  add(xsYearMonthDuration);
88  addNA(xsUntyped);
89  add(xsUntypedAtomic);
90  add(xsNOTATION);
91  /* Add derived primitives. */
92  add(xsNonPositiveInteger);
93  add(xsNegativeInteger);
94  add(xsLong);
95  add(xsInt);
96  add(xsShort);
97  add(xsByte);
98  add(xsNonNegativeInteger);
99  add(xsUnsignedLong);
100  add(xsUnsignedInt);
101  add(xsUnsignedShort);
102  add(xsUnsignedByte);
103  add(xsPositiveInteger);
104  add(xsNormalizedString);
105  add(xsToken);
106  add(xsLanguage);
107  add(xsNMTOKEN);
108  add(xsName);
109  add(xsNCName);
110  add(xsID);
111  add(xsIDREF);
112  add(xsENTITY);
113 
114 #undef add
115 #undef addNA
116 }
117 
119 {
120  return m_types.value(name);
121 }
122 
124 {
125  return m_types;
126 }
127 
static SchemaTypeFactory::Ptr self(const NamePool::Ptr &np)
#define addNA(aName)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsGYearMonth
#define add(aName)
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsTime
qint64 xsInteger
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsGDay
xsDouble xsDecimal
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
void reserve(int size)
Ensures that the QHash's internal hash table consists of at least size buckets.
Definition: qhash.h:846
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
xsAnyAtomicType numeric xsDuration xsDate
const char * name
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsGMonthDay
The namespace for the internal API of QtXmlPatterns.
QExplicitlySharedDataPointer< SchemaTypeFactory > Ptr
virtual SchemaType::Ptr createSchemaType(const QXmlName) const
BasicTypesFactory(const NamePool::Ptr &np)
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Definition: qxmlname.h:58
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsBoolean
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsQName
xsDouble xsFloat
xsAnyAtomicType numeric xsDayTimeDuration
virtual SchemaType::Hash types() const