예제 #1
0
파일: serializer.cpp 프로젝트: delgor/Core
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;
}
예제 #2
0
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);
}
예제 #3
0
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);
  }
}
예제 #4
0
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);
}
예제 #6
0
void CreatureAttributes::serialize(Archive& ar, const unsigned int version) {
  serializeImpl(ar, version);
}
예제 #7
0
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);
}
예제 #9
0
파일: serializer.cpp 프로젝트: delgor/Core
QVariantMap Nuria::Serializer::serialize (void *object, Nuria::MetaObject *meta) {
	this->d->failed.clear ();
	this->d->curDepth = this->d->maxDepth + 2;
	
	return serializeImpl (object, meta);
}