Qt 4.8
Public Functions | Static Public Functions | Protected Functions | Properties | List of all members
QPatternist::BasicTypesFactory Class Reference

Factory for creating schema types for the types defined in XSL-T 2.0. More...

#include <qbasictypesfactory_p.h>

Inheritance diagram for QPatternist::BasicTypesFactory:
QPatternist::SchemaTypeFactory QSharedData

Public Functions

virtual SchemaType::Ptr createSchemaType (const QXmlName) const
 
virtual SchemaType::Hash types () const
 
- Public Functions inherited from QPatternist::SchemaTypeFactory
 SchemaTypeFactory ()
 
virtual ~SchemaTypeFactory ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 

Static Public Functions

static SchemaTypeFactory::Ptr self (const NamePool::Ptr &np)
 

Protected Functions

 BasicTypesFactory (const NamePool::Ptr &np)
 

Properties

SchemaType::Hash m_types
 

Additional Inherited Members

- Public Types inherited from QPatternist::SchemaTypeFactory
typedef QExplicitlySharedDataPointer< SchemaTypeFactoryPtr
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Factory for creating schema types for the types defined in XSL-T 2.0.

Theses types are essentially the builtin primitive types, plus xs:integer, and the types defined in the XPath Data Model.

See also
XQuery 1.0 and XPath 2.0 Data Model, 2.6.2 Predefined Types
XSL Transformations (XSLT) Version 2.0, 3.13 Built-in Types
XML Schema Part 2: Datatypes Second Edition, 3.2 Primitive datatypes
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 80 of file qbasictypesfactory_p.h.

Constructors and Destructors

◆ BasicTypesFactory()

BasicTypesFactory::BasicTypesFactory ( const NamePool::Ptr np)
protected

This constructor is protected. Use the static self() function to retrieve a singleton instance.

Definition at line 58 of file qbasictypesfactory.cpp.

Referenced by self().

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 }
#define addNA(aName)
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
void reserve(int size)
Ensures that the QHash&#39;s internal hash table consists of at least size buckets.
Definition: qhash.h:846
xsAnyAtomicType numeric xsDuration xsDate
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsGMonthDay
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsBoolean
xsAnyAtomicType numeric xsDuration xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsAnyAtomicType xsQName
xsDouble xsFloat
xsAnyAtomicType numeric xsDayTimeDuration

Functions

◆ createSchemaType()

SchemaType::Ptr BasicTypesFactory::createSchemaType ( const QXmlName  name) const
virtual

Creates a primitive type for name. If name is not supported, null is returned. The intened supported types are the builtin primitive and derived types. That is, the 19 W3C XML Schema types, and the additional 5 in the XPath Data MOdel.

Note
This does not handle user defined types, only builtin types.

Implements QPatternist::SchemaTypeFactory.

Definition at line 118 of file qbasictypesfactory.cpp.

119 {
120  return m_types.value(name);
121 }
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606

◆ self()

SchemaTypeFactory::Ptr BasicTypesFactory::self ( const NamePool::Ptr np)
static
Returns
the singleton instance of BasicTypesFactory.

Definition at line 52 of file qbasictypesfactory.cpp.

Referenced by QPatternist::XsdSchemaTypesFactory::createSchemaType(), QPatternist::GenericStaticContext::schemaDefinitions(), and QPatternist::FunctionFactoryCollection::xpath20Factory().

53 {
54  /* We don't store a global static here, because it's dependent on the NamePool. */
56 }
QExplicitlySharedDataPointer< SchemaTypeFactory > Ptr
BasicTypesFactory(const NamePool::Ptr &np)

◆ types()

SchemaType::Hash BasicTypesFactory::types ( ) const
virtual
Returns
a dictionary containing the types this factory serves. The key is the type's QName in Clark name syntax.

Implements QPatternist::SchemaTypeFactory.

Definition at line 123 of file qbasictypesfactory.cpp.

124 {
125  return m_types;
126 }

Properties

◆ m_types

SchemaType::Hash QPatternist::BasicTypesFactory::m_types
private

A dictonary of builtin primitive and derived primitives.

Definition at line 113 of file qbasictypesfactory_p.h.

Referenced by BasicTypesFactory(), createSchemaType(), and types().


The documentation for this class was generated from the following files: