Qt 4.8
Public Types | Public Functions | Protected Functions | Friends | List of all members
QPatternist::AnyNodeType Class Reference

Represents the node() item type. More...

#include <qanynodetype_p.h>

Inheritance diagram for QPatternist::AnyNodeType:
QPatternist::ItemType QSharedData QPatternist::AbstractNodeTest QPatternist::BuiltinNodeType< kind > QPatternist::XSLTNodeTest QPatternist::LocalNameTest QPatternist::NamespaceNameTest QPatternist::QNameTest

Public Types

typedef QExplicitlySharedDataPointer< AnyNodeTypePtr
 
- Public Types inherited from QPatternist::ItemType
enum  Category { NodeNameTest = 1, Other = 2 }
 
enum  InstanceOf { ClassLocalNameTest, ClassNamespaceNameTest, ClassQNameTest, ClassOther }
 
typedef QList< ItemType::PtrList
 
typedef QExplicitlySharedDataPointer< ItemTypePtr
 

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
 
virtual QXmlNodeModelIndex::NodeKind nodeKind () const
 
virtual PatternPriority patternPriority () const
 
virtual ItemType::Ptr xdtSuperType () const
 
virtual bool xdtTypeMatches (const ItemType::Ptr &other) const
 Returns true if other matches this type. That is, if other is equal to this type or a subtype of this type. More...
 
- 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 ItemTypeoperator| (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...
 

Protected Functions

 AnyNodeType ()
 

Friends

class BuiltinTypes
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Represents the node() item type.

See also
BuiltinNodeType
Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 71 of file qanynodetype_p.h.

Typedefs

◆ Ptr

Definition at line 75 of file qanynodetype_p.h.

Constructors and Destructors

◆ AnyNodeType()

QPatternist::AnyNodeType::AnyNodeType ( )
inlineprotected

Definition at line 102 of file qanynodetype_p.h.

103  {
104  }

Functions

◆ atomizedType()

ItemType::Ptr AnyNodeType::atomizedType ( ) const
virtual

◆ displayName()

QString AnyNodeType::displayName ( const NamePool::Ptr np) const
virtual
Returns
a string representing the type. Used for diagnostic purposes. For a type whose name is a QName, a lexical representation should be returned with the prefix being a conventional one. Examples of a display names are "item()" and "xs:nonPositiveInteger".

Implements QPatternist::ItemType.

Reimplemented in QPatternist::BuiltinNodeType< kind >, QPatternist::LocalNameTest, QPatternist::NamespaceNameTest, and QPatternist::QNameTest.

Definition at line 66 of file qanynodetype.cpp.

67 {
68  return QLatin1String("node()");
69 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString

◆ isAtomicType()

bool AnyNodeType::isAtomicType ( ) const
virtual

Implements QPatternist::ItemType.

Definition at line 81 of file qanynodetype.cpp.

82 {
83  return false;
84 }

◆ isNodeType()

bool AnyNodeType::isNodeType ( ) const
virtual

Implements QPatternist::ItemType.

Definition at line 76 of file qanynodetype.cpp.

77 {
78  return true;
79 }

◆ itemMatches()

bool AnyNodeType::itemMatches ( const Item item) const
virtual
Parameters
itemthe item that is to be matched. This is guaranteed by the caller to never be null.

Implements QPatternist::ItemType.

Reimplemented in QPatternist::LocalNameTest, QPatternist::NamespaceNameTest, QPatternist::QNameTest, QPatternist::XSLTNodeTest, and QPatternist::BuiltinNodeType< kind >.

Definition at line 56 of file qanynodetype.cpp.

57 {
58  return item.isNode();
59 }
bool isNode() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:349

◆ nodeKind()

QXmlNodeModelIndex::NodeKind AnyNodeType::nodeKind ( ) const
virtual
Returns
the node kind this node ItemType tests for. If it matches any node, zero is returned.

Reimplemented in QPatternist::BuiltinNodeType< kind >.

Definition at line 86 of file qanynodetype.cpp.

87 {
88  /* node() is an abstract type, so we don't have a value for it in
89  * QXmlNodeModelIndex::NodeKind. */
91 }
NodeKind
Identifies a kind of node.

◆ patternPriority()

PatternPriority AnyNodeType::patternPriority ( ) const
virtual

Reimplemented in QPatternist::BuiltinNodeType< kind >, QPatternist::QNameTest, QPatternist::LocalNameTest, and QPatternist::NamespaceNameTest.

Definition at line 93 of file qanynodetype.cpp.

94 {
95  return -0.5;
96 }

◆ xdtSuperType()

ItemType::Ptr AnyNodeType::xdtSuperType ( ) const
virtual

Determines the type's parent type in the XPath Data Model hierarchy. For example, for the type xs:anyAtomicType, the super type in the XPath Data Model is item(), not xs:anySimpleType. SchemaType::xdtSuperType navigates the schema hierarchy.

See also
SchemaType::wxsSuperType()
Returns
the type's super type.

Implements QPatternist::ItemType.

Reimplemented in QPatternist::BuiltinNodeType< kind >, QPatternist::XSLTNodeTest, and QPatternist::AbstractNodeTest.

Definition at line 71 of file qanynodetype.cpp.

72 {
73  return BuiltinTypes::item;
74 }
static const ItemType::Ptr item

◆ xdtTypeMatches()

bool AnyNodeType::xdtTypeMatches ( const ItemType::Ptr other) const
virtual

Returns true if other matches this type. That is, if other is equal to this type or a subtype of this type.

For instance this statements evaluates to true:

but this evaluates to false:

Parameters
otherthe other ItemType that is to be matched. This is guaranteed by the caller to never be null.

Implements QPatternist::ItemType.

Reimplemented in QPatternist::XSLTNodeTest, QPatternist::BuiltinNodeType< kind >, and QPatternist::AbstractNodeTest.

Definition at line 51 of file qanynodetype.cpp.

52 {
53  return other->isNodeType();
54 }
virtual bool isNodeType() const =0

Friends and Related Functions

◆ BuiltinTypes

friend class BuiltinTypes
friend

Definition at line 100 of file qanynodetype_p.h.


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