Qt 4.8
Public Types | Public Functions | Static Public Functions | Protected Functions | Protected Variables | List of all members
QPatternist::ValidationError Class Reference

Used for signalling casting errors. More...

#include <qvalidationerror_p.h>

Inheritance diagram for QPatternist::ValidationError:
QPatternist::AtomicValue QSharedData QPatternist::CppCastingHelper< AtomicValue >

Public Types

typedef QExplicitlySharedDataPointer< ValidationErrorPtr
 
- Public Types inherited from QPatternist::AtomicValue
typedef QList< AtomicValue::PtrList
 
typedef QExplicitlySharedDataPointer< AtomicValuePtr
 

Public Functions

ReportContext::ErrorCode errorCode () const
 
virtual bool hasError () const
 
QString message () const
 
virtual QString stringValue () const
 
virtual ItemType::Ptr type () const
 
- Public Functions inherited from QPatternist::AtomicValue
virtual bool evaluateEBV (const QExplicitlySharedDataPointer< DynamicContext > &context) const
 
virtual ~AtomicValue ()
 
- 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...
 
- Public Functions inherited from QPatternist::CppCastingHelper< AtomicValue >
const TCastTarget * as () const
 
TCastTarget * as ()
 

Static Public Functions

static AtomicValue::Ptr createError (const QString &description=QString(), const ReportContext::ErrorCode=ReportContext::FORG0001)
 
- Static Public Functions inherited from QPatternist::AtomicValue
static ItemType::Ptr qtToXDMType (const QXmlItem &item)
 
static QVariant toQt (const AtomicValue *const value)
 
static QVariant toQt (const AtomicValue::Ptr &value)
 
static Item toXDM (const QVariant &value)
 

Protected Functions

 ValidationError (const QString &msg, const ReportContext::ErrorCode code)
 
- Protected Functions inherited from QPatternist::AtomicValue
 AtomicValue ()
 
- Protected Functions inherited from QPatternist::CppCastingHelper< AtomicValue >
 CppCastingHelper ()
 

Protected Variables

const ReportContext::ErrorCode m_code
 
const QString m_message
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Used for signalling casting errors.

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

Definition at line 70 of file qvalidationerror_p.h.

Typedefs

◆ Ptr

Definition at line 73 of file qvalidationerror_p.h.

Constructors and Destructors

◆ ValidationError()

ValidationError::ValidationError ( const QString msg,
const ReportContext::ErrorCode  code 
)
protected

Definition at line 49 of file qvalidationerror.cpp.

Referenced by createError().

50  : m_message(msg),
51  m_code(code)
52 {
53 }
const ReportContext::ErrorCode m_code

Functions

◆ createError()

AtomicValue::Ptr ValidationError::createError ( const QString description = QString(),
const ReportContext::ErrorCode  code = ReportContext::FORG0001 
)
static

◆ errorCode()

ReportContext::ErrorCode ValidationError::errorCode ( ) const
Returns
the error code this ValidationError represents. Typically, this is ReportContext::FORG0001.

Definition at line 85 of file qvalidationerror.cpp.

86 {
87  return m_code;
88 }
const ReportContext::ErrorCode m_code

◆ hasError()

bool ValidationError::hasError ( ) const
virtual
Returns
always true

Reimplemented from QPatternist::AtomicValue.

Definition at line 61 of file qvalidationerror.cpp.

62 {
63  return true;
64 }

◆ message()

QString ValidationError::message ( ) const

A human readable, translated message describing the error.

Definition at line 72 of file qvalidationerror.cpp.

73 {
74  return m_message;
75 }

◆ stringValue()

QString ValidationError::stringValue ( ) const
virtual

Always results in an assert crash.

Implements QPatternist::AtomicValue.

Definition at line 66 of file qvalidationerror.cpp.

67 {
68  Q_ASSERT_X(false, Q_FUNC_INFO, "stringValue() asked for ValidationError -- it makes no sense.");
69  return QString();
70 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

◆ type()

ItemType::Ptr ValidationError::type ( ) const
virtual

Always results in an assert crash.

Implements QPatternist::AtomicValue.

Definition at line 77 of file qvalidationerror.cpp.

78 {
79  Q_ASSERT_X(false, Q_FUNC_INFO,
80  "This function should never be called, the caller "
81  "didn't check whether the AtomicValue was an ValidationError.");
82  return ItemType::Ptr();
83 }
QExplicitlySharedDataPointer< ItemType > Ptr
Definition: qitemtype_p.h:88
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
#define Q_FUNC_INFO
Definition: qglobal.h:1871

Properties

◆ m_code

const ReportContext::ErrorCode QPatternist::ValidationError::m_code
protected

Definition at line 115 of file qvalidationerror_p.h.

Referenced by errorCode().

◆ m_message

const QString QPatternist::ValidationError::m_message
protected

Definition at line 114 of file qvalidationerror_p.h.

Referenced by message().


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