18QHash< const TypeInfo*, const TypeInfo*> TypeInfo::Private::orderedArrays;
19QHash< const TypeInfo*, const TypeInfo*> TypeInfo::Private::unorderedArrays;
20QHash< const TypeInfo*, const TypeInfo*> TypeInfo::Private::alternativeArrays;
22const TypeInfo* TypeInfo::Private::Boolean =
new TypeInfo(TypeInfo::BooleanType);
23const TypeInfo* TypeInfo::Private::Integer =
new TypeInfo(TypeInfo::IntegerType);
26const TypeInfo* TypeInfo::Private::Rational =
new TypeInfo(TypeInfo::RationalType);
27const TypeInfo* TypeInfo::Private::GPSCoordinate =
new TypeInfo(TypeInfo::GPSCoordinateType);
31 if (Private::orderedArrays.contains(_typeInfo)) {
32 return Private::orderedArrays[ _typeInfo ];
35 Private::orderedArrays[ _typeInfo ] = info;
41 if (Private::unorderedArrays.contains(_typeInfo)) {
42 return Private::unorderedArrays[ _typeInfo ];
44 const TypeInfo* info =
new TypeInfo(TypeInfo::UnorderedArrayType, _typeInfo);
45 Private::unorderedArrays[ _typeInfo ] = info;
49const TypeInfo* TypeInfo::Private::alternativeArray(
const TypeInfo* _typeInfo)
51 if (Private::alternativeArrays.contains(_typeInfo)) {
52 return Private::alternativeArrays[ _typeInfo ];
54 const TypeInfo* info =
new TypeInfo(TypeInfo::AlternativeArrayType, _typeInfo);
55 Private::alternativeArrays[ _typeInfo ] = info;
61 return new TypeInfo(_propertiesType, _embedded, _choices);
64const TypeInfo* TypeInfo::Private::createStructure(
Schema* _structureSchema,
const QString& name)
66 return new TypeInfo(_structureSchema, name);
69const TypeInfo* TypeInfo::Private::LangArray =
new TypeInfo(TypeInfo::LangArrayType);
73 d->propertyType = _propertyType;
74 if (
d->propertyType == TypeInfo::LangArrayType) {
75 d->embeddedTypeInfo = TypeInfo::Private::Text;
77 switch (
d->propertyType) {
95struct Q_DECL_HIDDEN
TypeInfo::Choice::Private {
133 d->propertyType = _propertyType;
134 d->embeddedTypeInfo = _embedded;
140 d->propertyType = _propertyType;
141 d->embeddedTypeInfo = _embedded;
142 d->parser = _embedded->
parser();
143 d->choices = _choices;
149 d->structureSchema = _structureSchema;
150 d->structureName = name;
161 return d->propertyType;
166 return d->embeddedTypeInfo;
176 return d->structureSchema;
181 return d->structureName;
192 Q_FOREACH (
const Value& val, values) {
193 if (!typeInfo->hasCorrectType(val)) {
202 switch (
d->propertyType) {
233 Q_FOREACH (
const Value& vallang, values) {
245 QMap<QString, KisMetaData::Value> structure =
value.asStructure();
246 for (QMap<QString, KisMetaData::Value>::iterator it = structure.begin();
247 it != structure.end(); ++it) {
248 const TypeInfo* typeInfo =
d->structureSchema->propertyType(it.key());
261 return d->embeddedTypeInfo->hasCorrectType(
value);
269 Q_FOREACH (
const Choice& choice,
d->choices) {
float value(const T *src, size_t ch)