bool Nuria::Serializer::fieldToVariant (QVariant &value, bool &ignore) { QByteArray typeName = QByteArray (value.typeName (), -1); MetaObject *meta = this->d->finder (typeName); if (meta) { void *dataPtr = value.data (); if (typeName.endsWith ('*')) { dataPtr = *reinterpret_cast< void ** > (dataPtr); } if (this->d->curDepth == 1) { ignore = true; } else { value = serializeImpl (dataPtr, meta); } return true; } // Variant::convert() triggers QVariant conversion internally QVariant conv = Nuria::Variant::convert (value, QMetaType::QString); if (conv.isValid ()) { value = conv; return true; } return false; }
void ResourceData::serialize(VariableSerializer* serializer) const { if (UNLIKELY(serializer->incNestedLevel((void*)this, true))) { serializer->writeOverflow((void*)this, true); } else { serializeImpl(serializer); } serializer->decNestedLevel((void*)this); }
void ArrayData::serialize(VariableSerializer *serializer, bool skipNestCheck /* = false */) const { if (size() == 0) { serializer->writeArrayHeader(0, isVectorData()); serializer->writeArrayFooter(); return; } if (!skipNestCheck) { if (serializer->incNestedLevel((void*)this)) { serializer->writeOverflow((void*)this); } else { serializeImpl(serializer); } serializer->decNestedLevel((void*)this); } else { // If isObject, the array is temporary and we should not check or save // its pointer. serializeImpl(serializer); } }
int DebuggerWireHelpers::WireSerialize(const Variant& data, String& sdata) { TRACE(7, "DebuggerWireHelpers::WireSerialize(const Variant& data,\n"); return serializeImpl(data, sdata); }
int DebuggerWireHelpers::WireSerialize(CVarRef data, String& sdata) { return serializeImpl(data, sdata); }
void CreatureAttributes::serialize(Archive& ar, const unsigned int version) { serializeImpl(ar, version); }
template<> void CreatureAttributes::serialize(PrettyInputArchive& ar1, unsigned version) { serializeImpl(ar1, version); ar1(endInput()); initializeLastingEffects(); }
int DebuggerWireHelpers::WireSerialize(CObjRef data, String& sdata) { TRACE(7, "DebuggerWireHelpers::WireSerialize(CObjRef data,\n"); return serializeImpl(data, sdata); }
QVariantMap Nuria::Serializer::serialize (void *object, Nuria::MetaObject *meta) { this->d->failed.clear (); this->d->curDepth = this->d->maxDepth + 2; return serializeImpl (object, meta); }