bool QoreValue::isEqualHard(const QoreValue n) const { qore_type_t t = getType(); if (t != n.getType()) return false; switch (t) { case NT_INT: return getAsBigInt() == n.getAsBigInt(); case NT_BOOLEAN: return getAsBool() == n.getAsBool(); case NT_FLOAT: return getAsFloat() == n.getAsFloat(); case NT_NOTHING: case NT_NULL: return true; } return !compareHard(v.n, n.v.n, 0); }
bool OrNothingTypeInfo::acceptInputImpl(QoreValue& n, ExceptionSink *xsink) const { qore_type_t t = n.getType(); if (t == NT_NOTHING) return true; if (t == NT_NULL) { discard(n.assign((AbstractQoreNode*)0), xsink); return true; } if (qc) { if (t != NT_OBJECT) return false; const QoreClass* n_qc = reinterpret_cast<const QoreObject*>(n.getInternalNode())->getClass(); return qore_class_private::runtimeCheckCompatibleClass(*qc, *n_qc); } return t == qt; }
int QoreTypeInfo::runtimeAcceptInputIntern(bool &priv_error, QoreValue& n) const { qore_type_t nt = n.getType(); if (qt != nt) return -1; if (qt != NT_OBJECT || !qc) return 0; bool priv; if (reinterpret_cast<const QoreObject*>(n.getInternalNode())->getClass()->getClass(*qc, priv)) { if (!priv) return 0; // check private access if required class is privately // inherited in the input argument's class if (qore_class_private::runtimeCheckPrivateClassAccess(*qc)) return 0; priv_error = true; } return -1; }
QoreValue pseudo_classes_eval(const QoreValue n, const char *name, const QoreListNode *args, ExceptionSink *xsink) { return qore_class_private::evalPseudoMethod(pseudo_get_class(n.getType()), n, name, args, xsink); }