Qt 4.8
|
Represents multiple types such as document()
or xs:integer
.
More...
#include <qmultiitemtype_p.h>
Public Functions | |
virtual ItemType::Ptr | atomizedType () const |
virtual QString | displayName (const NamePool::Ptr &np) const |
virtual bool | isAtomicType () const |
virtual bool | isNodeType () const |
virtual bool | itemMatches (const Item &item) const |
MultiItemType (const ItemType::List &typeList) | |
virtual ItemType::Ptr | xdtSuperType () const |
virtual bool | xdtTypeMatches (const ItemType::Ptr &other) const |
Public Functions inherited from QPatternist::ItemType | |
virtual InstanceOf | instanceOf () const |
ItemType () | |
virtual Category | itemTypeCategory () const |
bool | operator!= (const ItemType &other) const |
virtual bool | operator== (const ItemType &other) const |
virtual const ItemType & | operator| (const ItemType &other) const |
virtual | ~ItemType () |
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... | |
Properties | |
const ItemType::List::const_iterator | m_end |
const ItemType::List | m_types |
Additional Inherited Members | |
Public Types inherited from QPatternist::ItemType | |
enum | Category { NodeNameTest = 1, Other = 2 } |
enum | InstanceOf { ClassLocalNameTest, ClassNamespaceNameTest, ClassQNameTest, ClassOther } |
typedef QList< ItemType::Ptr > | List |
typedef QExplicitlySharedDataPointer< ItemType > | Ptr |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Related Functions inherited from QPatternist::ItemType | |
ItemType::Ptr | operator| (const ItemType::Ptr &op1, const ItemType::Ptr &op2) |
void | operator|= (ItemType::Ptr &op1, const ItemType::Ptr &op2) |
Computes the union type of op1 and op2 , and assigns it to op1 . More... | |
Represents multiple types such as document()
or xs:integer
.
In some situations two or more different types are allowed. For example, XQuery's validate
expression accepts document or element nodes(but not attribute nodes, for example). MultiItemType is useful in such situations, its constructor takes a list of ItemType instances which its member functions treats as a wholeness.
For example, xdtTypeMatches() returns true
if any of the represented types matches.
Definition at line 78 of file qmultiitemtype_p.h.
MultiItemType::MultiItemType | ( | const ItemType::List & | typeList | ) |
Creates a MultiItemType representing the types in typeList
. typeList
must contain two or more types.
Definition at line 50 of file qmultiitemtype.cpp.
|
virtual |
Determines the union type of all the represented types atomized types. For example, if the represented types are xs:integer
and document()
, xs:anyAtomicType
is returned, because that's the super type of xs:integer
and xs:untypedAtomic
.
Implements QPatternist::ItemType.
Definition at line 127 of file qmultiitemtype.cpp.
|
virtual |
The display name are the names concatenated with "|" as separator. For example, if this MultiItemType represents the types document()
, xs:integer
, and xs:anyAtomicType
, the display name is "document() | xs:integer | xs:anyAtomicType".
Implements QPatternist::ItemType.
Definition at line 59 of file qmultiitemtype.cpp.
|
virtual |
true
if any of the represented types is an atomic type. Implements QPatternist::ItemType.
Definition at line 105 of file qmultiitemtype.cpp.
|
virtual |
true
if any of the represented types is a node type. Implements QPatternist::ItemType.
Definition at line 96 of file qmultiitemtype.cpp.
|
virtual |
If any of the types this MultiItemType represents matches item
, it is considered a match.
true
if any of the housed ItemType instances matches item
, otherwise false
Implements QPatternist::ItemType.
Definition at line 78 of file qmultiitemtype.cpp.
|
virtual |
Determines the union type of all the represented types super types. For example, if the represented types are xs:integer
, document()
and xs:string
, item()
is returned.
Implements QPatternist::ItemType.
Definition at line 114 of file qmultiitemtype.cpp.
|
virtual |
If any of the types this MultiItemType represents matches other
, it is considered a match.
true
if any of the housed ItemType instances matches other
, otherwise false
Implements QPatternist::ItemType.
Definition at line 87 of file qmultiitemtype.cpp.
|
private |
Definition at line 138 of file qmultiitemtype_p.h.
Referenced by atomizedType(), displayName(), isAtomicType(), isNodeType(), itemMatches(), xdtSuperType(), and xdtTypeMatches().
|
private |
Definition at line 137 of file qmultiitemtype_p.h.
Referenced by atomizedType(), displayName(), isAtomicType(), isNodeType(), itemMatches(), xdtSuperType(), and xdtTypeMatches().