Qt 4.8
Public Functions | Protected Variables | List of all members
QPatternist::AbstractNodeTest Class Reference

A name test that is of the type prefix:ncName. More...

#include <qabstractnodetest_p.h>

Inheritance diagram for QPatternist::AbstractNodeTest:
QPatternist::AnyNodeType QPatternist::ItemType QSharedData QPatternist::LocalNameTest QPatternist::NamespaceNameTest QPatternist::QNameTest

Public Functions

 AbstractNodeTest (const ItemType::Ptr &primaryType)
 
virtual ItemType::Ptr atomizedType () 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::AnyNodeType
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
 
- 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 Variables

const ItemType::Ptr m_primaryType
 

Additional Inherited Members

- Public Types inherited from QPatternist::AnyNodeType
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 Variables inherited from QSharedData
QAtomicInt ref
 
- Protected Functions inherited from QPatternist::AnyNodeType
 AnyNodeType ()
 

Detailed Description

A name test that is of the type prefix:ncName.

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

Definition at line 69 of file qabstractnodetest_p.h.

Constructors and Destructors

◆ AbstractNodeTest()

AbstractNodeTest::AbstractNodeTest ( const ItemType::Ptr primaryType)

Definition at line 48 of file qabstractnodetest.cpp.

48  : m_primaryType(primaryType)
49 {
51 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Functions

◆ atomizedType()

ItemType::Ptr AbstractNodeTest::atomizedType ( ) const
virtual
See also
XQuery 1.0 and XPath 2.0 Data Model, G.15 dm:typed-value Accessor

Reimplemented from QPatternist::AnyNodeType.

Definition at line 68 of file qabstractnodetest.cpp.

69 {
70  return m_primaryType->atomizedType();
71 }
virtual ItemType::Ptr atomizedType() const =0

◆ xdtSuperType()

ItemType::Ptr AbstractNodeTest::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.

Reimplemented from QPatternist::AnyNodeType.

Definition at line 73 of file qabstractnodetest.cpp.

74 {
75  return m_primaryType;
76 }

◆ xdtTypeMatches()

bool AbstractNodeTest::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.

Reimplemented from QPatternist::AnyNodeType.

Definition at line 53 of file qabstractnodetest.cpp.

54 {
55  Q_ASSERT(other);
56 
57  if(other->isNodeType())
58  {
59  if(*other == *this)
60  return true;
61  else
62  return xdtTypeMatches(other->xdtSuperType());
63  }
64  else
65  return false;
66 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
virtual ItemType::Ptr xdtSuperType() const =0
virtual bool isNodeType() const =0
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...

Properties

◆ m_primaryType

const ItemType::Ptr QPatternist::AbstractNodeTest::m_primaryType
protected

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