Variant JSONValue::GetVariantValue(unsigned index, VariantType type) const { Variant ret; if (type == VAR_RESOURCEREF) ret = GetResourceRef(index); else if (type == VAR_RESOURCEREFLIST) ret = GetResourceRefList(index); else if (type == VAR_VARIANTVECTOR || type == VAR_VARIANTMAP) LOGERROR("Unsupported value type"); else ret.FromString(type, GetCString(index)); return ret; }
Variant XMLElement::GetVariantValue(VariantType type) const { Variant ret; if (type == VAR_RESOURCEREF) ret = GetResourceRef(); else if (type == VAR_RESOURCEREFLIST) ret = GetResourceRefList(); else if (type == VAR_VARIANTVECTOR) ret = GetVariantVector(); else if (type == VAR_VARIANTMAP) ret = GetVariantMap(); else ret.FromString(type, GetAttributeCString("value")); return ret; }
template <> ResourceRefList Variant::Get<ResourceRefList>() const { return GetResourceRefList(); }