Qt 4.8
Public Functions | Properties | List of all members
QPatternist::NodeNamespaceResolver Class Reference

A NamespaceResolver that use a QXmlNodeModelIndex's in-scope namespace bindings for resolving namespaces. More...

#include <qnodenamespaceresolver_p.h>

Inheritance diagram for QPatternist::NodeNamespaceResolver:
QPatternist::NamespaceResolver QSharedData

Public Functions

virtual void addBinding (const QXmlName nb)
 
virtual Bindings bindings () const
 
virtual QXmlName::NamespaceCode lookupNamespaceURI (const QXmlName::PrefixCode prefix) const
 
 NodeNamespaceResolver (const Item &item)
 
- Public Functions inherited from QPatternist::NamespaceResolver
 NamespaceResolver ()
 
virtual ~NamespaceResolver ()
 
- 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 QXmlNodeModelIndex m_node
 

Additional Inherited Members

- Public Types inherited from QPatternist::NamespaceResolver
typedef QHash< QXmlName::PrefixCode, QXmlName::NamespaceCodeBindings
 
enum  Constants { NoBinding = -1 }
 
typedef QExplicitlySharedDataPointer< NamespaceResolverPtr
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

A NamespaceResolver that use a QXmlNodeModelIndex's in-scope namespace bindings for resolving namespaces.

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

Definition at line 73 of file qnodenamespaceresolver_p.h.

Constructors and Destructors

◆ NodeNamespaceResolver()

NodeNamespaceResolver::NodeNamespaceResolver ( const Item item)

Definition at line 51 of file qnodenamespaceresolver.cpp.

51  : m_node(item.asNode())
52 {
54 }
bool isNull() const
Returns true if this QXmlNodeModelIndex is a default constructed value, otherwise false...
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const QXmlNodeModelIndex & asNode() const
Definition: qitem_p.h:379

Functions

◆ addBinding()

void NodeNamespaceResolver::addBinding ( const QXmlName  nb)
virtual

Adds the mapping from prefix to namespaceURI to this NamespaceResolver. If this NamespaceResolver already contains a binding involving prefix, the old binding is replaced.

Implements QPatternist::NamespaceResolver.

Definition at line 56 of file qnodenamespaceresolver.cpp.

57 {
58  Q_UNUSED(nb);
59  Q_ASSERT_X(false, Q_FUNC_INFO, "Calling this function for this sub-class makes little sense.");
60 }
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ bindings()

NamespaceResolver::Bindings NodeNamespaceResolver::bindings ( ) const
virtual
Returns
all bindings this NamespaceResolver handles.

Implements QPatternist::NamespaceResolver.

Definition at line 77 of file qnodenamespaceresolver.cpp.

78 {
79  Q_ASSERT_X(false, Q_FUNC_INFO, "Not implemented.");
81 }
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
QHash< QXmlName::PrefixCode, QXmlName::NamespaceCode > Bindings
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ lookupNamespaceURI()

QXmlName::NamespaceCode NodeNamespaceResolver::lookupNamespaceURI ( const QXmlName::PrefixCode  prefix) const
virtual

Resolves the prefix to the corresponding namespace URI. If no binding exists for prefix, NoBinding is returned.

Returns
the namespace corresponding to prefix.

Implements QPatternist::NamespaceResolver.

Definition at line 62 of file qnodenamespaceresolver.cpp.

63 {
65 
66  if(ns == NoBinding)
67  {
68  if(prefix == StandardPrefixes::empty)
70  else
71  return NoBinding;
72  }
73  else
74  return ns;
75 }
qint16 NamespaceCode
Definition: qxmlname.h:82
QXmlName::NamespaceCode namespaceForPrefix(const QXmlName::PrefixCode prefix) const
Definition: qitem_p.h:504

Properties

◆ m_node

const QXmlNodeModelIndex QPatternist::NodeNamespaceResolver::m_node
private

Definition at line 83 of file qnodenamespaceresolver_p.h.

Referenced by lookupNamespaceURI(), and NodeNamespaceResolver().


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