Qt 4.8
Public Functions | List of all members
QPatternist::ToStringCaster< DerivedType > Class Template Reference

Casts any atomic value to xs:string. More...

#include <qatomiccasters_p.h>

Inheritance diagram for QPatternist::ToStringCaster< DerivedType >:
QPatternist::AtomicCaster QPatternist::AtomicTypeVisitorResult QSharedData

Public Functions

virtual Item castFrom (const Item &from, const QExplicitlySharedDataPointer< DynamicContext > &context) const
 
- Public Functions inherited from QPatternist::AtomicCaster
 AtomicCaster ()
 
virtual ~AtomicCaster ()
 
- Public Functions inherited from QPatternist::AtomicTypeVisitorResult
 AtomicTypeVisitorResult ()
 
virtual ~AtomicTypeVisitorResult ()
 
- 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...
 

Additional Inherited Members

- Public Types inherited from QPatternist::AtomicCaster
typedef QExplicitlySharedDataPointer< AtomicCasterPtr
 
- Public Types inherited from QPatternist::AtomicTypeVisitorResult
typedef QExplicitlySharedDataPointer< AtomicTypeVisitorResultPtr
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

template<TypeOfDerivedString DerivedType>
class QPatternist::ToStringCaster< DerivedType >

Casts any atomic value to xs:string.

This class uses Item::stringValue() for retrieving a string representation, and thus supports casting from atomic values of any type.

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

Definition at line 86 of file qatomiccasters_p.h.

Functions

◆ castFrom()

template<TypeOfDerivedString DerivedType>
virtual Item QPatternist::ToStringCaster< DerivedType >::castFrom ( const Item from,
const QExplicitlySharedDataPointer< DynamicContext > &  context 
) const
inlinevirtual

Casts from to an atomic value of the type this class casts to, and returns that value. The context is used for reporting errors in case the casting fails, and to in general access information from the dynamic context.

Implements QPatternist::AtomicCaster.

Definition at line 89 of file qatomiccasters_p.h.

91  {
92  Q_ASSERT(from);
93  return DerivedString<DerivedType>::fromLexical(context->namePool(), from.stringValue());
94  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static AtomicValue::Ptr fromLexical(const NamePool::Ptr &np, const QString &lexical)

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