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

A helper class for validating identity constraints. More...

#include <qxsdidchelper_p.h>

Public Functions

 FieldNode ()
 
 FieldNode (const QXmlItem &item, const QString &data, const SchemaType::Ptr &type)
 
bool isEmpty () const
 
bool isEqualTo (const FieldNode &other, const NamePool::Ptr &namePool, const ReportContext::Ptr &context, const SourceLocationReflection *const reflection) const
 
QXmlItem item () const
 

Properties

QString m_data
 
QXmlItem m_item
 
SchemaType::Ptr m_type
 

Detailed Description

A helper class for validating identity constraints.

This class represents a field node from the key-sequence as defined in the validation rules at http://www.w3.org/TR/xmlschema11-1/#d0e32243.

Definition at line 73 of file qxsdidchelper_p.h.

Constructors and Destructors

◆ FieldNode() [1/2]

FieldNode::FieldNode ( )

Creates an empty field node.

Definition at line 51 of file qxsdidchelper.cpp.

52 {
53 }

◆ FieldNode() [2/2]

FieldNode::FieldNode ( const QXmlItem item,
const QString data,
const SchemaType::Ptr type 
)

Creates a field node that is bound to a xml node.

Parameters
itemThe xml node the field is bound to.
dataThe string content of that field.
typeThe type that is bound to that field.

Definition at line 55 of file qxsdidchelper.cpp.

56  : m_item(item)
57  , m_data(data)
58  , m_type(type)
59 {
60 }
SchemaType::Ptr m_type

Functions

◆ isEmpty()

bool FieldNode::isEmpty ( ) const

Returns whether this field is empty.

A field can be empty, if the xpath expression selects an absent attribute or element.

Definition at line 62 of file qxsdidchelper.cpp.

63 {
64  return m_item.isNull();
65 }
bool isNull() const
Returns true if this QXmlItem is neither a node nor an atomic value.

◆ isEqualTo()

bool FieldNode::isEqualTo ( const FieldNode other,
const NamePool::Ptr namePool,
const ReportContext::Ptr context,
const SourceLocationReflection *const  reflection 
) const

Returns whether this field is equal to the other field.

Equal means that both have the same type and there content is equal in the types value space.

Definition at line 67 of file qxsdidchelper.cpp.

68 {
69  if (m_type != other.m_type)
70  return false;
71 
74 
75  return XsdSchemaHelper::constructAndCompare(string, AtomicComparator::OperatorEqual, otherString, m_type, context, reflection);
76 }
static bool constructAndCompare(const DerivedString< TypeString >::Ptr &operand1, const AtomicComparator::Operator op, const DerivedString< TypeString >::Ptr &operand2, const SchemaType::Ptr &type, const ReportContext::Ptr &context, const SourceLocationReflection *const sourceLocationReflection)
SchemaType::Ptr m_type
Represents instances of derived xs:string types, such as xs:normalizedString.
static AtomicValue::Ptr fromLexical(const NamePool::Ptr &np, const QString &lexical)

◆ item()

QXmlItem FieldNode::item ( ) const

Returns the xml node item the field is bound to.

Definition at line 78 of file qxsdidchelper.cpp.

79 {
80  return m_item;
81 }

Properties

◆ m_data

QString QPatternist::FieldNode::m_data
private

Definition at line 113 of file qxsdidchelper_p.h.

Referenced by isEqualTo().

◆ m_item

QXmlItem QPatternist::FieldNode::m_item
private

Definition at line 112 of file qxsdidchelper_p.h.

Referenced by isEmpty(), and item().

◆ m_type

SchemaType::Ptr QPatternist::FieldNode::m_type
private

Definition at line 114 of file qxsdidchelper_p.h.

Referenced by isEqualTo().


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