Qt 4.8
Static Public Functions | List of all members
QPatternist::ValueFactory Class Reference

Provides fromLexical(), which allows instantiation of atomic values from arbitrary types. More...

#include <qvaluefactory_p.h>

Static Public Functions

static AtomicValue::Ptr fromLexical (const QString &lexicalValue, const SchemaType::Ptr &type, const ReportContext::Ptr &context, const SourceLocationReflection *const sourceLocationReflection)
 Returns an AtomicValue of type type from the lexical space lexicalValue, and raise an error through context if that's impossible. More...
 

Detailed Description

Provides fromLexical(), which allows instantiation of atomic values from arbitrary types.

This class wraps the helper class CastingPlatform with a more specific, high-level API.

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

Definition at line 75 of file qvaluefactory_p.h.

Functions

◆ fromLexical()

AtomicValue::Ptr ValueFactory::fromLexical ( const QString lexicalValue,
const SchemaType::Ptr type,
const ReportContext::Ptr context,
const SourceLocationReflection *const  sourceLocationReflection 
)
static

Returns an AtomicValue of type type from the lexical space lexicalValue, and raise an error through context if that's impossible.

ValueFactory does not take ownership of sourceLocationReflection.

Definition at line 91 of file qvaluefactory.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdTypeChecker::checkConstrainingFacetsBinary(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDateTime(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDouble(), QPatternist::XsdTypeChecker::checkConstrainingFacetsSignedInteger(), QPatternist::XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(), QPatternist::ComparisonFactory::constructAndCompare(), QPatternist::XsdSchemaHelper::constructAndCompare(), and QPatternist::XsdTypeChecker::fromLexical().

95 {
96  Q_ASSERT(context);
97  Q_ASSERT(type);
99  "We can only construct for atomic values.");
100 
101  return PerformValueConstruction(sourceLocationReflection, type)(AtomicString::fromValue(lexicalValue),
102  type,
103  context);
104 }
virtual TypeCategory category() const =0
int type
Definition: qmetatype.cpp:239
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static AtomicString::Ptr fromValue(const QString &value)
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
Helper class for ValueFactory::fromLexical() which exposes CastingPlatform appropriately.
#define Q_FUNC_INFO
Definition: qglobal.h:1871

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