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

Represents an item in the XPath 2.0 Data Model. More...

#include <qitem_p.h>

Public Types

typedef QPatternist::EmptyIterator< ItemEmptyIterator
 
typedef QAbstractXmlForwardIterator< ItemIterator
 
typedef QList< ItemList
 
typedef QPatternist::SingletonIterator< ItemSingletonIterator
 
typedef QVector< ItemVector
 

Public Functions

template<typename TCastTarget >
TCastTarget * as () const
 
const AtomicValueasAtomicValue () const
 
const QXmlNodeModelIndexasNode () const
 
bool isAtomicValue () const
 Determines whether this item is an atomic value, or a node. More...
 
bool isNode () const
 Determines whether this item is an atomic value, or a node. More...
 
bool isNull () const
 
 Item ()
 
 Item (const QXmlNodeModelIndex &n)
 
 Item (const Item &other)
 
 Item (const AtomicValue::Ptr &a)
 
 Item (const AtomicValue *const a)
 
 operator bool () const
 
Itemoperator= (const Item &other)
 
void reset ()
 
Item::Iterator::Ptr sequencedTypedValue () const
 Returns the typed value of this item. More...
 
QString stringValue () const
 Returns the string value of this Item. More...
 
QExplicitlySharedDataPointer< ItemTypetype () const
 Returns the ItemType this Item is of. More...
 
 ~Item ()
 

Static Public Functions

static Item fromPublic (const QXmlItem &i)
 
static QXmlItem toPublic (const Item &i)
 

Properties

union {
   const AtomicValue *   atomicValue
 
   NodeIndexStorage   node
 
}; 
 

Friends

class ::QXmlItem
 

Detailed Description

Represents an item in the XPath 2.0 Data Model.

There exists two types of items: nodes and atomic values.

The XQuery 1.0 and XPath 2.0 Data Model and XML Path Language (XPath) 2.0 specification makes a very strong distinction between a sequence of items and an atomized sequence.

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

Definition at line 182 of file qitem_p.h.

Typedefs

◆ EmptyIterator

Definition at line 203 of file qitem_p.h.

◆ Iterator

A smart pointer wrapping an Item instance.

Definition at line 190 of file qitem_p.h.

◆ List

A list of Item instances, each wrapped in a smart pointer.

Definition at line 195 of file qitem_p.h.

◆ SingletonIterator

Definition at line 202 of file qitem_p.h.

◆ Vector

A vector of Item instances, each wrapped in a smart pointer.

Definition at line 200 of file qitem_p.h.

Constructors and Destructors

◆ Item() [1/5]

QPatternist::Item::Item ( )
inline

Default constructor.

Definition at line 208 of file qitem_p.h.

Referenced by sequencedTypedValue().

209  {
210  node.reset();
211  }
NodeIndexStorage node
Definition: qitem_p.h:425

◆ Item() [2/5]

QPatternist::Item::Item ( const QXmlNodeModelIndex n)
inline

Definition at line 213 of file qitem_p.h.

213  : node(n.m_storage)
214  {
215  }
NodeIndexStorage node
Definition: qitem_p.h:425
QPatternist::NodeIndexStorage m_storage

◆ Item() [3/5]

QPatternist::Item::Item ( const Item other)
inline

Definition at line 217 of file qitem_p.h.

217  : node(other.node)
218  {
219  Q_ASSERT_X(sizeof(QXmlNodeModelIndex) >= sizeof(AtomicValue), Q_FUNC_INFO,
220  "Since we're only copying the node member, it must be the largest.");
221  if(isAtomicValue())
222  atomicValue->ref.ref();
223  }
QAtomicInt ref
Definition: qshareddata.h:59
The QXmlNodeModelIndex class identifies a node in an XML node model subclassed from QAbstractXmlNodeM...
NodeIndexStorage node
Definition: qitem_p.h:425
bool ref()
Atomically increments the value of this QAtomicInt.
const AtomicValue * atomicValue
Definition: qitem_p.h:426
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ Item() [4/5]

QPatternist::Item::Item ( const AtomicValue::Ptr a)
inline

Definition at line 225 of file qitem_p.h.

226  {
227  node.reset();
228  if(a)
229  {
230  atomicValue = a.data();
231  atomicValue->ref.ref();
232 
233  /* Signal that we're housing an atomic value. */
234  node.model = reinterpret_cast<const QAbstractXmlNodeModel *>(~0);
235  }
236  }
QAtomicInt ref
Definition: qshareddata.h:59
NodeIndexStorage node
Definition: qitem_p.h:425
long ASN1_INTEGER_get ASN1_INTEGER * a
bool ref()
Atomically increments the value of this QAtomicInt.
const AtomicValue * atomicValue
Definition: qitem_p.h:426
const QAbstractXmlNodeModel * model
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML ...

◆ Item() [5/5]

QPatternist::Item::Item ( const AtomicValue *const  a)
inline

Definition at line 238 of file qitem_p.h.

239  {
240  /* Note, the implementation is a copy of the constructor above. */
241  node.reset();
242  if(a)
243  {
244  atomicValue = a;
245  atomicValue->ref.ref();
246 
247  /* Signal that we're housing an atomic value. */
248  node.model = reinterpret_cast<const QAbstractXmlNodeModel *>(~0);
249  }
250  }
QAtomicInt ref
Definition: qshareddata.h:59
NodeIndexStorage node
Definition: qitem_p.h:425
long ASN1_INTEGER_get ASN1_INTEGER * a
bool ref()
Atomically increments the value of this QAtomicInt.
const AtomicValue * atomicValue
Definition: qitem_p.h:426
const QAbstractXmlNodeModel * model
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML ...

◆ ~Item()

QPatternist::Item::~Item ( )
inline

Definition at line 252 of file qitem_p.h.

253  {
254  if(isAtomicValue() && !atomicValue->ref.deref())
255  delete atomicValue;
256  }
QAtomicInt ref
Definition: qshareddata.h:59
const AtomicValue * atomicValue
Definition: qitem_p.h:426
bool deref()
Atomically decrements the value of this QAtomicInt.
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335

Functions

◆ as()

template<typename TCastTarget >
TCastTarget* QPatternist::Item::as ( ) const
inline

Definition at line 278 of file qitem_p.h.

Referenced by QPatternist::ComparingAggregator< oper, result >::applyNumericPromotion(), QPatternist::DecimalMathematician::calculate(), QPatternist::IntegerMathematician::calculate(), QPatternist::DurationNumericMathematician::calculate(), QPatternist::DurationDurationMathematician::calculate(), QPatternist::DateTimeDurationMathematician::calculate(), QPatternist::AbstractDateTimeMathematician::calculate(), QPatternist::HexBinaryToBase64BinaryCaster::castFrom(), QPatternist::Base64BinaryToHexBinaryCaster::castFrom(), QPatternist::NumericToBooleanCaster::castFrom(), QPatternist::BooleanToDecimalCaster::castFrom(), QPatternist::BooleanToIntegerCaster::castFrom(), QPatternist::AbstractDateTimeToGYearCaster::castFrom(), QPatternist::AbstractDateTimeToGYearMonthCaster::castFrom(), QPatternist::AbstractDateTimeToGMonthCaster::castFrom(), QPatternist::AbstractDateTimeToGMonthDayCaster::castFrom(), QPatternist::AbstractDateTimeToGDayCaster::castFrom(), QPatternist::AbstractDateTimeToDateTimeCaster::castFrom(), QPatternist::AbstractDateTimeToDateCaster::castFrom(), QPatternist::AbstractDateTimeToTimeCaster::castFrom(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToDayTimeDurationCaster::castFrom(), QPatternist::AbstractDurationToYearMonthDurationCaster::castFrom(), QPatternist::CastAs::castToQName(), QPatternist::BooleanComparator::compare(), QPatternist::AbstractFloatComparator::compare(), QPatternist::DecimalComparator::compare(), QPatternist::IntegerComparator::compare(), QPatternist::AbstractDateTimeComparator::compare(), QPatternist::AbstractDurationComparator::compare(), QPatternist::BinaryDataComparator::equals(), QPatternist::BooleanComparator::equals(), QPatternist::AbstractFloatComparator::equals(), QPatternist::DecimalComparator::equals(), QPatternist::IntegerComparator::equals(), QPatternist::QNameComparator::equals(), QPatternist::AbstractDateTimeComparator::equals(), QPatternist::AbstractDurationComparator::equals(), QPatternist::Boolean::evaluateEBV(), QPatternist::CastableAs::evaluateEBV(), QPatternist::InsertBeforeFN::evaluateSequence(), QPatternist::RemoveFN::evaluateSequence(), QPatternist::SubsequenceFN::evaluateSequence(), QPatternist::FunctionAvailableFN::evaluateSingleton(), QPatternist::ErrorFN::evaluateSingleton(), QPatternist::AdjustTimezone::evaluateSingleton(), QPatternist::UnaryExpression::evaluateSingleton(), QPatternist::PrefixFromQNameFN::evaluateSingleton(), QPatternist::SubstringFN::evaluateSingleton(), QPatternist::LocalNameFromQNameFN::evaluateSingleton(), QPatternist::NumberFN::evaluateSingleton(), QPatternist::NamespaceURIFromQNameFN::evaluateSingleton(), QPatternist::RoundHalfToEvenFN::evaluateSingleton(), QPatternist::RemoveFN::evaluateSingleton(), qLess< Item::List >::isNaN(), QPatternist::OrderBy::mapToSequence(), and qLess< Item::List >::operator()().

279  {
280 #if defined(Patternist_DEBUG) && !defined(Q_CC_XLC)
281 /* At least on aix-xlc-64, the compiler cries when it sees dynamic_cast. */
282  Q_ASSERT_X(atomicValue == 0 || dynamic_cast<const TCastTarget *>(atomicValue),
283  Q_FUNC_INFO,
284  "The cast is invalid. This class does not inherit the cast target.");
285 #endif
286  return const_cast<TCastTarget *>(static_cast<const TCastTarget *>(atomicValue));
287  }
const AtomicValue * atomicValue
Definition: qitem_p.h:426
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ asAtomicValue()

const AtomicValue* QPatternist::Item::asAtomicValue ( ) const
inline

Definition at line 373 of file qitem_p.h.

Referenced by fromPublic(), QAbstractXmlReceiver::item(), and QXmlItem::QXmlItem().

374  {
376  return atomicValue;
377  }
const AtomicValue * atomicValue
Definition: qitem_p.h:426
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335

◆ asNode()

const QXmlNodeModelIndex& QPatternist::Item::asNode ( ) const
inline

Definition at line 379 of file qitem_p.h.

Referenced by QPatternist::AxisStep::evaluateSequence(), QPatternist::UnparsedEntityPublicIDFN::evaluateSingleton(), QPatternist::UnparsedEntityURIFN::evaluateSingleton(), QPatternist::GenerateIDFN::evaluateSingleton(), QPatternist::AxisStep::evaluateSingleton(), QPatternist::ParentNodeAxis::evaluateSingleton(), QPatternist::LangFN::evaluateSingleton(), QPatternist::RootFN::evaluateSingleton(), QPatternist::BuiltinNodeType< kind >::itemMatches(), QPatternist::XSLTNodeTest::itemMatches(), QPatternist::LocalNameTest::itemMatches(), QPatternist::NamespaceNameTest::itemMatches(), QPatternist::QNameTest::itemMatches(), QPatternist::NodeSortExpression::lessThanUsingNodeModel(), QPatternist::ExceptIterator::next(), QPatternist::UnionIterator::next(), QPatternist::IntersectIterator::next(), QPatternist::DeduplicateIterator::next(), QPatternist::XSLTSimpleContentConstructor::processItem(), QAbstractXmlReceiver::sendAsNode(), QPatternist::QAbstractXmlReceiver::sendAsNode(), and sequencedTypedValue().

380  {
382  "This item isn't a valid QXmlNodeModelIndex.");
384  "If this doesn't hold, something is wrong.");
385 
386  return reinterpret_cast<const QXmlNodeModelIndex &>(node);
387  }
bool isNull() const
Definition: qitem_p.h:394
The QXmlNodeModelIndex class identifies a node in an XML node model subclassed from QAbstractXmlNodeM...
NodeIndexStorage node
Definition: qitem_p.h:425
bool isNode() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:349
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ fromPublic()

static Item QPatternist::Item::fromPublic ( const QXmlItem i)
inlinestatic

Definition at line 408 of file qitem_p.h.

Referenced by QXmlQueryPrivate::dynamicContext(), QXmlItem::isNode(), and QPatternist::VariableLoader::itemForName().

409  {
410  const Item it(i.m_node);
411  if(it.isAtomicValue())
412  it.asAtomicValue()->ref.ref();
413 
414  return it;
415  }
#define it(className, varName)
QPatternist::NodeIndexStorage m_node
The Item is the most basic of all visual items in QML.

◆ isAtomicValue()

bool QPatternist::Item::isAtomicValue ( ) const
inline

Determines whether this item is an atomic value, or a node.

If this Item is null, false is returned.

See also
isNode()
Returns
true if it is an atomic value, otherwise false.

Definition at line 335 of file qitem_p.h.

Referenced by QPatternist::Path::evaluateSequence(), fromPublic(), QPatternist::Literal::id(), QPatternist::CastingPlatform< UntypedAtomicConverter, true >::issueCastError(), QXmlFormatter::item(), QXmlSerializer::item(), QPatternist::AccelTreeBuilder< true >::item(), QPatternist::Literal::Literal(), QPatternist::ArgumentConverter::mapToSequence(), QPatternist::PullBridge::next(), operator=(), and sequencedTypedValue().

336  {
337  /* Setting node.model to ~0, signals that it's an atomic value. */
338  return node.model == reinterpret_cast<QAbstractXmlNodeModel *>(~0);
339  }
NodeIndexStorage node
Definition: qitem_p.h:425
const QAbstractXmlNodeModel * model
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML ...

◆ isNode()

bool QPatternist::Item::isNode ( ) const
inline

Determines whether this item is an atomic value, or a node.

If this Item is null, false is returned.

See also
isAtomicValue()
Returns
true if this item is a node, otherwise false.

Definition at line 349 of file qitem_p.h.

Referenced by QPatternist::Boolean::evaluateEBV(), QXmlItem::isNode(), QAbstractXmlReceiver::item(), QXmlSerializer::item(), QPatternist::DocumentContentValidator::item(), QPatternist::OutputValidator::item(), QPatternist::NumericType::itemMatches(), QPatternist::AnyNodeType::itemMatches(), QPatternist::BuiltinNodeType< kind >::itemMatches(), QPatternist::XSLTNodeTest::itemMatches(), QPatternist::NamespaceNameTest::itemMatches(), QPatternist::QNameTest::itemMatches(), QPatternist::LocalNameTest::itemMatches(), QPatternist::EBVType::itemMatches(), QPatternist::AtomicType::itemMatches(), QPatternist::NodeSortExpression::lessThanUsingNodeModel(), QPatternist::PullBridge::next(), QPatternist::XSLTSimpleContentConstructor::processItem(), QAbstractXmlReceiver::sendAsNode(), and QPatternist::QAbstractXmlReceiver::sendAsNode().

350  {
351  //return !isAtomicValue();
352  return node.model && node.model != reinterpret_cast<QAbstractXmlNodeModel *>(~0);
353  }
NodeIndexStorage node
Definition: qitem_p.h:425
const QAbstractXmlNodeModel * model
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML ...

◆ isNull()

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

Definition at line 394 of file qitem_p.h.

395  {
396  return !node.model;
397  }
NodeIndexStorage node
Definition: qitem_p.h:425
const QAbstractXmlNodeModel * model

◆ operator bool()

QPatternist::Item::operator bool ( ) const
inline

Definition at line 389 of file qitem_p.h.

390  {
391  return node.model;
392  }
NodeIndexStorage node
Definition: qitem_p.h:425
const QAbstractXmlNodeModel * model

◆ operator=()

Item& QPatternist::Item::operator= ( const Item other)
inline

Definition at line 258 of file qitem_p.h.

259  {
260  Q_ASSERT_X(sizeof(QXmlNodeModelIndex) >= sizeof(AtomicValue *), Q_FUNC_INFO,
261  "If this doesn't hold, we won't copy all data.");
262 
263  if(other.isAtomicValue())
264  other.atomicValue->ref.ref();
265 
266  if(isAtomicValue())
267  {
268  if(!atomicValue->ref.deref())
269  delete atomicValue;
270  }
271 
272  node = other.node;
273 
274  return *this;
275  }
QAtomicInt ref
Definition: qshareddata.h:59
The QXmlNodeModelIndex class identifies a node in an XML node model subclassed from QAbstractXmlNodeM...
NodeIndexStorage node
Definition: qitem_p.h:425
const AtomicValue * atomicValue
Definition: qitem_p.h:426
bool deref()
Atomically decrements the value of this QAtomicInt.
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ reset()

void QPatternist::Item::reset ( )
inline

Definition at line 399 of file qitem_p.h.

Referenced by QPatternist::UnionIterator::next(), QPatternist::ToCodepointsIterator::next(), QPatternist::SubsequenceIterator::next(), QPatternist::RemovalIterator::next(), QPatternist::InsertionIterator::next(), QPatternist::IndexOfIterator::next(), QPatternist::DistinctIterator::next(), and QPatternist::RangeIterator::next().

400  {
401  /* Delete the atomicValue if necessary*/
402  if(isAtomicValue() && !atomicValue->ref.deref())
403  delete atomicValue;
404 
405  node.reset();
406  }
QAtomicInt ref
Definition: qshareddata.h:59
NodeIndexStorage node
Definition: qitem_p.h:425
const AtomicValue * atomicValue
Definition: qitem_p.h:426
bool deref()
Atomically decrements the value of this QAtomicInt.
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335

◆ sequencedTypedValue()

Item::Iterator::Ptr Item::sequencedTypedValue ( ) const

Returns the typed value of this item.

Conceptually, this functions corresponds to the dm:typed-value accessor. Here are examples of what the typed value of an Item is:

  • The typed value of an atomic value is always the atomic value itself.
  • A comment node has always a typed value of type xs:string
  • For attribute and element nodes, the typed value can be arbitrary. For example, an element can have a sequence of xs:dateTime instances.
Returns
the typed value of this item
See also
XQuery 1.0 and XPath 2.0 Data Model, 5.15 typed-value Accessor

Definition at line 50 of file qitem.cpp.

Referenced by QPatternist::ArgumentConverter::mapToSequence(), QPatternist::Atomizer::mapToSequence(), and QPatternist::XSLTSimpleContentConstructor::processItem().

51 {
52  if(isAtomicValue())
53  return makeSingletonIterator(Item(atomicValue));
54  else
55  return asNode().sequencedTypedValue();
56 }
const AtomicValue * atomicValue
Definition: qitem_p.h:426
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< QPatternist::Item > > sequencedTypedValue() const
Definition: qitem_p.h:519
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335
const QXmlNodeModelIndex & asNode() const
Definition: qitem_p.h:379

◆ stringValue()

QString QPatternist::Item::stringValue ( ) const
inline

Returns the string value of this Item.

In the case of a node, it is the node value corresponding to the particular node type. For atomic values, it is equivalent to the value cast as xs:string.

Conceptually, this functions corresponds to the dm:string-value accessor.

See also
XQuery 1.0 and XPath 2.0 Data Model, 5.13 string-value Accessor
Returns
the string value.

Definition at line 302 of file qitem_p.h.

Referenced by QPatternist::ToStringCaster< DerivedType >::castFrom(), QPatternist::StringToAbstractFloatCaster< isDouble >::castFrom(), QPatternist::ToUntypedAtomicCaster::castFrom(), QPatternist::ToAnyURICaster::castFrom(), QPatternist::StringToBase64BinaryCaster::castFrom(), QPatternist::StringToHexBinaryCaster::castFrom(), QPatternist::StringToBooleanCaster::castFrom(), QPatternist::StringToDecimalCaster::castFrom(), QPatternist::StringToIntegerCaster::castFrom(), QPatternist::StringToGYearCaster::castFrom(), QPatternist::StringToGDayCaster::castFrom(), QPatternist::StringToGMonthCaster::castFrom(), QPatternist::StringToGYearMonthCaster::castFrom(), QPatternist::StringToGMonthDayCaster::castFrom(), QPatternist::StringToDateTimeCaster::castFrom(), QPatternist::StringToTimeCaster::castFrom(), QPatternist::StringToDateCaster::castFrom(), QPatternist::StringToDurationCaster::castFrom(), QPatternist::StringToDayTimeDurationCaster::castFrom(), QPatternist::StringToYearMonthDurationCaster::castFrom(), QPatternist::StringToDerivedIntegerCaster< type >::castFrom(), QPatternist::AnyToDerivedStringCaster< type >::castFrom(), QPatternist::StringComparator::compare(), QPatternist::CaseInsensitiveStringComparator::compare(), QPatternist::PatternPlatform::compress(), QPatternist::Literal::description(), QPatternist::NormalizeUnicodeFN::determineNormalizationForm(), QPatternist::StringComparator::equals(), QPatternist::CaseInsensitiveStringComparator::equals(), QPatternist::ResolveURIFN::evaluateSingleton(), QPatternist::SystemPropertyFN::evaluateSingleton(), QPatternist::FunctionAvailableFN::evaluateSingleton(), QPatternist::TypeAvailableFN::evaluateSingleton(), QPatternist::NCNameConstructor::evaluateSingleton(), QPatternist::QNameConstructor::evaluateSingleton(), QPatternist::ErrorFN::evaluateSingleton(), QPatternist::QNameFN::evaluateSingleton(), QPatternist::ConcatFN::evaluateSingleton(), QPatternist::TranslateFN::evaluateSingleton(), QPatternist::CastingPlatform< UntypedAtomicConverter, true >::issueCastError(), QXmlFormatter::item(), QXmlSerializer::item(), QPatternist::AccelTreeBuilder< true >::item(), QPatternist::TraceCallback::mapToItem(), QPatternist::ReplaceFN::parseReplacement(), QPatternist::PatternPlatform::pattern(), QPatternist::XSLTSimpleContentConstructor::processItem(), QPatternist::AttributeConstructor::processValue(), QAbstractXmlReceiver::sendAsNode(), QPatternist::QAbstractXmlReceiver::sendAsNode(), QPatternist::DocFN::typeCheck(), and QPatternist::ItemVerifier::verifyItem().

303  {
304  if(isAtomicValue())
305  return atomicValue->stringValue();
306  else
307  return asNode().stringValue();
308  }
const AtomicValue * atomicValue
Definition: qitem_p.h:426
virtual QString stringValue() const =0
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335
const QXmlNodeModelIndex & asNode() const
Definition: qitem_p.h:379
QString stringValue() const
Definition: qitem_p.h:509

◆ toPublic()

static QXmlItem QPatternist::Item::toPublic ( const Item i)
inlinestatic

Definition at line 417 of file qitem_p.h.

Referenced by QXmlResultItems::next().

418  {
419  return QXmlItem(i);
420  }
The QXmlItem class contains either an XML node or an atomic value.

◆ type()

QExplicitlySharedDataPointer<ItemType> QPatternist::Item::type ( ) const
inline

Returns the ItemType this Item is of.

For example, if this Item is an XML node, more specifically a text node, text() is returned. That is, BuiltinTypes::text. However, if this Item is an atomic value of type xs:long that is what's returned, BuiltinTypes::xsLong.

Returns
the type of this Item.

Definition at line 365 of file qitem_p.h.

Referenced by QPatternist::ComparingAggregator< oper, result >::applyNumericPromotion(), QPatternist::CastingPlatform< UntypedAtomicConverter, true >::cast(), QPatternist::NumericToDecimalCaster< IsInteger >::castFrom(), QPatternist::NumericToDerivedIntegerCaster< type >::castFrom(), QPatternist::ComparisonPlatform< IndexOfIterator, false >::detailedFlexibleCompare(), QPatternist::ComparisonPlatform< IndexOfIterator, false >::flexibleCompare(), QPatternist::Literal::id(), qLess< Item::List >::isNaN(), QPatternist::CastingPlatform< UntypedAtomicConverter, true >::issueCastError(), QPatternist::AtomicType::itemMatches(), QPatternist::ArgumentConverter::mapToSequence(), and QPatternist::Literal::staticType().

366  {
367  if(isAtomicValue())
368  return atomicValue->type();
369  else
370  return asNode().type();
371  }
QPatternist::ItemTypePtr type() const
Definition: qitem_p.h:514
const AtomicValue * atomicValue
Definition: qitem_p.h:426
virtual ItemType::Ptr type() const =0
bool isAtomicValue() const
Determines whether this item is an atomic value, or a node.
Definition: qitem_p.h:335
const QXmlNodeModelIndex & asNode() const
Definition: qitem_p.h:379

Friends and Related Functions

◆ ::QXmlItem

friend class :: QXmlItem
friend

Definition at line 184 of file qitem_p.h.

Properties

◆ @379

union { ... }

◆ atomicValue

const AtomicValue* QPatternist::Item::atomicValue

Definition at line 426 of file qitem_p.h.

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

◆ node

NodeIndexStorage QPatternist::Item::node

Definition at line 425 of file qitem_p.h.

Referenced by operator=().


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