Exemple #1
0
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;
}
Exemple #2
0
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;
}
Exemple #3
0
template <> ResourceRefList Variant::Get<ResourceRefList>() const
{
    return GetResourceRefList();
}