Qt 4.8
Public Types | Public Functions | Static Public Functions | Properties | Related Functions | List of all members
QPatternist::NamespaceBinding Class Reference

Represents a namespace binding: a prefix, and a namespace URI. More...

#include <qnamespacebinding_p.h>

Public Types

enum  { InvalidCode = -1 }
 
typedef QVector< NamespaceBindingVector
 

Public Functions

bool isNull () const
 
 NamespaceBinding ()
 
 NamespaceBinding (const QXmlName::PrefixCode p, const QXmlName::NamespaceCode n)
 
QXmlName::NamespaceCode namespaceURI () const
 
bool operator== (const NamespaceBinding &other) const
 
QXmlName::PrefixCode prefix () const
 

Static Public Functions

static NamespaceBinding fromQXmlName (const QXmlName qName)
 Constructs a NamespaceBinding whose prefix and namespace is taken from qName. More...
 

Properties

QXmlName::NamespaceCode m_namespace
 
QXmlName::PrefixCode m_prefix
 

Related Functions

(Note that these are not member functions.)

static uint qHash (const NamespaceBinding nb)
 

Detailed Description

Represents a namespace binding: a prefix, and a namespace URI.

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

Definition at line 70 of file qnamespacebinding_p.h.

Typedefs

◆ Vector

Definition at line 78 of file qnamespacebinding_p.h.

Enumerations

◆ anonymous enum

anonymous enum
Enumerator
InvalidCode 

Definition at line 73 of file qnamespacebinding_p.h.

Constructors and Destructors

◆ NamespaceBinding() [1/2]

QPatternist::NamespaceBinding::NamespaceBinding ( )
inline

◆ NamespaceBinding() [2/2]

QPatternist::NamespaceBinding::NamespaceBinding ( const QXmlName::PrefixCode  p,
const QXmlName::NamespaceCode  n 
)
inline

Definition at line 85 of file qnamespacebinding_p.h.

86  : m_prefix(p),
87  m_namespace(n)
88  {
89  }
QXmlName::NamespaceCode m_namespace

Functions

◆ fromQXmlName()

static NamespaceBinding QPatternist::NamespaceBinding::fromQXmlName ( const QXmlName  qName)
inlinestatic

Constructs a NamespaceBinding whose prefix and namespace is taken from qName.

The local name in qName is ignored. qName may not be null.

Definition at line 118 of file qnamespacebinding_p.h.

119  {
120  Q_ASSERT(!qName.isNull());
121  return NamespaceBinding(qName.prefix(), qName.namespaceURI());
122  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QString prefix(const QXmlNamePool &query) const
Returns the prefix.
Definition: qxmlname.cpp:370
NamespaceCode namespaceURI() const
Definition: qnamepool_p.h:503
bool isNull() const
Returns true if this QXmlName is not initialized with a valid combination of {namespace URI}...
Definition: qxmlname.cpp:224

◆ isNull()

bool QPatternist::NamespaceBinding::isNull ( ) const
inline

Definition at line 107 of file qnamespacebinding_p.h.

◆ namespaceURI()

QXmlName::NamespaceCode QPatternist::NamespaceBinding::namespaceURI ( ) const
inline

Definition at line 102 of file qnamespacebinding_p.h.

Referenced by qHash().

103  {
104  return m_namespace;
105  }
QXmlName::NamespaceCode m_namespace

◆ operator==()

bool QPatternist::NamespaceBinding::operator== ( const NamespaceBinding other) const
inline

Definition at line 91 of file qnamespacebinding_p.h.

92  {
93  return m_prefix == other.m_prefix &&
94  m_namespace == other.m_namespace;
95  }
QXmlName::NamespaceCode m_namespace

◆ prefix()

QXmlName::PrefixCode QPatternist::NamespaceBinding::prefix ( ) const
inline

Definition at line 97 of file qnamespacebinding_p.h.

Referenced by qHash().

98  {
99  return m_prefix;
100  }

Friends and Related Functions

◆ qHash()

static uint qHash ( const NamespaceBinding  nb)
related

Definition at line 132 of file qnamespacebinding_p.h.

133  {
134  return (nb.prefix() << 16) + nb.namespaceURI();
135  }

Properties

◆ m_namespace

QXmlName::NamespaceCode QPatternist::NamespaceBinding::m_namespace
private

Definition at line 126 of file qnamespacebinding_p.h.

Referenced by namespaceURI(), and operator==().

◆ m_prefix

QXmlName::PrefixCode QPatternist::NamespaceBinding::m_prefix
private

Definition at line 125 of file qnamespacebinding_p.h.

Referenced by isNull(), operator==(), and prefix().


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