diff options
author | Tobias Arrskog <topfs2@xbmc.org> | 2011-05-05 06:31:49 +0200 |
---|---|---|
committer | Tobias Arrskog <topfs2@xbmc.org> | 2011-05-17 20:14:50 +0200 |
commit | 07ceb9f58024b7e1a9bc62ff7ea5628b01db6b7d (patch) | |
tree | ae5697e50f4c67a466917041d40573b28999d088 | |
parent | 100af5fac3f578556c85ef206ad1534e3d9fec5f (diff) |
Added CVariant::type which returns the type of the current variant (easier than multiple isFoo queries)
-rw-r--r-- | xbmc/utils/Variant.cpp | 5 | ||||
-rw-r--r-- | xbmc/utils/Variant.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/xbmc/utils/Variant.cpp b/xbmc/utils/Variant.cpp index 6f6fb2599a..c9c3ca55e9 100644 --- a/xbmc/utils/Variant.cpp +++ b/xbmc/utils/Variant.cpp @@ -185,6 +185,11 @@ bool CVariant::isNull() const return m_type == VariantTypeNull || m_type == VariantTypeConstNull; } +CVariant::VariantType CVariant::type() const +{ + return m_type; +} + int64_t CVariant::asInteger(int64_t fallback) const { if (m_type == VariantTypeInteger) diff --git a/xbmc/utils/Variant.h b/xbmc/utils/Variant.h index 238fb89d07..b344d749ca 100644 --- a/xbmc/utils/Variant.h +++ b/xbmc/utils/Variant.h @@ -69,6 +69,8 @@ public: bool isObject() const; bool isNull() const; + VariantType type() const; + int64_t asInteger(int64_t fallback = 0) const; uint64_t asUnsignedInteger(uint64_t fallback = 0u) const; bool asBoolean(bool fallback = false) const; |