Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CVariant Class Reference

#include <Variant.h>

Public Types

enum  VariantType {
  VariantTypeNull , VariantTypeConstNull , VariantTypeInteger , VariantTypeUnsignedInteger ,
  VariantTypeBoolean , VariantTypeDouble , VariantTypeString , VariantTypeWideString ,
  VariantTypeArray , VariantTypeObject
}
 
typedef VariantArray::iterator iterator_array
 
typedef VariantArray::const_iterator const_iterator_array
 
typedef VariantMap::iterator iterator_map
 
typedef VariantMap::const_iterator const_iterator_map
 

Public Member Functions

 CVariant ()
 
 CVariant (VariantType type)
 
 CVariant (int integer)
 
 CVariant (int64_t integer)
 
 CVariant (unsigned int unsignedinteger)
 
 CVariant (uint64_t unsignedinteger)
 
 CVariant (double value)
 
 CVariant (float value)
 
 CVariant (bool boolean)
 
 CVariant (const char *str)
 
 CVariant (const char *str, unsigned int length)
 
 CVariant (const std::string &str)
 
 CVariant (std::string &&str)
 
 CVariant (const wchar_t *str)
 
 CVariant (const wchar_t *str, unsigned int length)
 
 CVariant (const std::wstring &str)
 
 CVariant (std::wstring &&str)
 
 CVariant (const std::vector< std::string > &strArray)
 
 CVariant (std::vector< std::string > &&strArray)
 
 CVariant (const std::map< std::string, std::string > &strMap)
 
 CVariant (std::map< std::string, std::string > &&strMap)
 
 CVariant (const std::map< std::string, CVariant > &variantMap)
 
 CVariant (std::map< std::string, CVariant > &&variantMap)
 
 CVariant (const CVariant &variant)
 
 CVariant (CVariant &&rhs) noexcept
 
 ~CVariant ()
 
bool isInteger () const
 
bool isSignedInteger () const
 
bool isUnsignedInteger () const
 
bool isBoolean () const
 
bool isString () const
 
bool isWideString () const
 
bool isDouble () const
 
bool isArray () const
 
bool isObject () const
 
bool isNull () const
 
VariantType type () const
 
int64_t asInteger (int64_t fallback=0) const
 
int32_t asInteger32 (int32_t fallback=0) const
 
uint64_t asUnsignedInteger (uint64_t fallback=0u) const
 
uint32_t asUnsignedInteger32 (uint32_t fallback=0u) const
 
bool asBoolean (bool fallback=false) const
 
std::string asString (std::string_view="") const &
 
std::string asString (std::string_view="") &&
 
std::wstring asWideString (std::wstring_view=L"") const &
 
std::wstring asWideString (std::wstring_view=L"") &&
 
double asDouble (double fallback=0.0) const
 
float asFloat (float fallback=0.0f) const
 
CVariantoperator[] (const std::string &key) &
 
const CVariantoperator[] (const std::string &key) const &
 
CVariant operator[] (const std::string &key) &&
 
CVariantoperator[] (unsigned int position) &
 
const CVariantoperator[] (unsigned int position) const &
 
CVariant operator[] (unsigned int position) &&
 
CVariantoperator= (const CVariant &rhs)
 
CVariantoperator= (CVariant &&rhs) noexcept
 
bool operator== (const CVariant &rhs) const
 
bool operator!= (const CVariant &rhs) const
 
void reserve (size_t length)
 
void push_back (const CVariant &variant)
 
void push_back (CVariant &&variant)
 
void append (const CVariant &variant)
 
void append (CVariant &&variant)
 
const char * c_str () const
 
void swap (CVariant &rhs) noexcept
 
iterator_array begin_array ()
 
const_iterator_array begin_array () const
 
iterator_array end_array ()
 
const_iterator_array end_array () const
 
iterator_map begin_map ()
 
const_iterator_map begin_map () const
 
iterator_map end_map ()
 
const_iterator_map end_map () const
 
unsigned int size () const
 
bool empty () const
 
void clear ()
 
void erase (const std::string &key)
 
void erase (unsigned int position)
 
bool isMember (const std::string &key) const
 

Static Public Attributes

static CVariant ConstNullVariant = CVariant::VariantTypeConstNull
 

Member Typedef Documentation

◆ const_iterator_array

VariantArray::const_iterator CVariant::const_iterator_array

◆ const_iterator_map

VariantMap::const_iterator CVariant::const_iterator_map

◆ iterator_array

VariantArray::iterator CVariant::iterator_array

◆ iterator_map

VariantMap::iterator CVariant::iterator_map

Member Enumeration Documentation

◆ VariantType

Enumerator
VariantTypeNull 
VariantTypeConstNull 
VariantTypeInteger 
VariantTypeUnsignedInteger 
VariantTypeBoolean 
VariantTypeDouble 
VariantTypeString 
VariantTypeWideString 
VariantTypeArray 
VariantTypeObject 

Constructor & Destructor Documentation

◆ CVariant() [1/25]

CVariant::CVariant ( )

◆ CVariant() [2/25]

CVariant::CVariant ( VariantType type)

◆ CVariant() [3/25]

CVariant::CVariant ( int integer)

◆ CVariant() [4/25]

CVariant::CVariant ( int64_t integer)

◆ CVariant() [5/25]

CVariant::CVariant ( unsigned int unsignedinteger)

◆ CVariant() [6/25]

CVariant::CVariant ( uint64_t unsignedinteger)

◆ CVariant() [7/25]

CVariant::CVariant ( double value)

◆ CVariant() [8/25]

CVariant::CVariant ( float value)

◆ CVariant() [9/25]

CVariant::CVariant ( bool boolean)

◆ CVariant() [10/25]

CVariant::CVariant ( const char * str)

◆ CVariant() [11/25]

CVariant::CVariant ( const char * str,
unsigned int length )

◆ CVariant() [12/25]

CVariant::CVariant ( const std::string & str)

◆ CVariant() [13/25]

CVariant::CVariant ( std::string && str)

◆ CVariant() [14/25]

CVariant::CVariant ( const wchar_t * str)

◆ CVariant() [15/25]

CVariant::CVariant ( const wchar_t * str,
unsigned int length )

◆ CVariant() [16/25]

CVariant::CVariant ( const std::wstring & str)

◆ CVariant() [17/25]

CVariant::CVariant ( std::wstring && str)

◆ CVariant() [18/25]

CVariant::CVariant ( const std::vector< std::string > & strArray)

◆ CVariant() [19/25]

CVariant::CVariant ( std::vector< std::string > && strArray)

◆ CVariant() [20/25]

CVariant::CVariant ( const std::map< std::string, std::string > & strMap)

◆ CVariant() [21/25]

CVariant::CVariant ( std::map< std::string, std::string > && strMap)

◆ CVariant() [22/25]

CVariant::CVariant ( const std::map< std::string, CVariant > & variantMap)

◆ CVariant() [23/25]

CVariant::CVariant ( std::map< std::string, CVariant > && variantMap)

◆ CVariant() [24/25]

CVariant::CVariant ( const CVariant & variant)

◆ CVariant() [25/25]

CVariant::CVariant ( CVariant && rhs)
noexcept

◆ ~CVariant()

CVariant::~CVariant ( )

Member Function Documentation

◆ append() [1/2]

void CVariant::append ( const CVariant & variant)

◆ append() [2/2]

void CVariant::append ( CVariant && variant)

◆ asBoolean()

bool CVariant::asBoolean ( bool fallback = false) const

◆ asDouble()

double CVariant::asDouble ( double fallback = 0.0) const

◆ asFloat()

float CVariant::asFloat ( float fallback = 0.0f) const

◆ asInteger()

int64_t CVariant::asInteger ( int64_t fallback = 0) const

◆ asInteger32()

int32_t CVariant::asInteger32 ( int32_t fallback = 0) const

◆ asString() [1/2]

std::string CVariant::asString ( std::string_view fallback = "") &&

◆ asString() [2/2]

std::string CVariant::asString ( std::string_view fallback = "") const &

◆ asUnsignedInteger()

uint64_t CVariant::asUnsignedInteger ( uint64_t fallback = 0u) const

◆ asUnsignedInteger32()

uint32_t CVariant::asUnsignedInteger32 ( uint32_t fallback = 0u) const

◆ asWideString() [1/2]

std::wstring CVariant::asWideString ( std::wstring_view fallback = L"") &&

◆ asWideString() [2/2]

std::wstring CVariant::asWideString ( std::wstring_view fallback = L"") const &

◆ begin_array() [1/2]

CVariant::iterator_array CVariant::begin_array ( )

◆ begin_array() [2/2]

CVariant::const_iterator_array CVariant::begin_array ( ) const

◆ begin_map() [1/2]

CVariant::iterator_map CVariant::begin_map ( )

◆ begin_map() [2/2]

CVariant::const_iterator_map CVariant::begin_map ( ) const

◆ c_str()

const char * CVariant::c_str ( ) const

◆ clear()

void CVariant::clear ( )

◆ empty()

bool CVariant::empty ( ) const

◆ end_array() [1/2]

CVariant::iterator_array CVariant::end_array ( )

◆ end_array() [2/2]

CVariant::const_iterator_array CVariant::end_array ( ) const

◆ end_map() [1/2]

CVariant::iterator_map CVariant::end_map ( )

◆ end_map() [2/2]

CVariant::const_iterator_map CVariant::end_map ( ) const

◆ erase() [1/2]

void CVariant::erase ( const std::string & key)

◆ erase() [2/2]

void CVariant::erase ( unsigned int position)

◆ isArray()

bool CVariant::isArray ( ) const

◆ isBoolean()

bool CVariant::isBoolean ( ) const

◆ isDouble()

bool CVariant::isDouble ( ) const

◆ isInteger()

bool CVariant::isInteger ( ) const

◆ isMember()

bool CVariant::isMember ( const std::string & key) const

◆ isNull()

bool CVariant::isNull ( ) const

◆ isObject()

bool CVariant::isObject ( ) const

◆ isSignedInteger()

bool CVariant::isSignedInteger ( ) const

◆ isString()

bool CVariant::isString ( ) const

◆ isUnsignedInteger()

bool CVariant::isUnsignedInteger ( ) const

◆ isWideString()

bool CVariant::isWideString ( ) const

◆ operator!=()

bool CVariant::operator!= ( const CVariant & rhs) const
inline

◆ operator=() [1/2]

CVariant & CVariant::operator= ( const CVariant & rhs)

◆ operator=() [2/2]

CVariant & CVariant::operator= ( CVariant && rhs)
noexcept

◆ operator==()

bool CVariant::operator== ( const CVariant & rhs) const

◆ operator[]() [1/6]

CVariant & CVariant::operator[] ( const std::string & key) &

◆ operator[]() [2/6]

CVariant CVariant::operator[] ( const std::string & key) &&

◆ operator[]() [3/6]

const CVariant & CVariant::operator[] ( const std::string & key) const &

◆ operator[]() [4/6]

CVariant & CVariant::operator[] ( unsigned int position) &

◆ operator[]() [5/6]

CVariant CVariant::operator[] ( unsigned int position) &&

◆ operator[]() [6/6]

const CVariant & CVariant::operator[] ( unsigned int position) const &

◆ push_back() [1/2]

void CVariant::push_back ( const CVariant & variant)

◆ push_back() [2/2]

void CVariant::push_back ( CVariant && variant)

◆ reserve()

void CVariant::reserve ( size_t length)

◆ size()

unsigned int CVariant::size ( ) const

◆ swap()

void CVariant::swap ( CVariant & rhs)
noexcept

◆ type()

CVariant::VariantType CVariant::type ( ) const

Member Data Documentation

◆ ConstNullVariant

CVariant CVariant::ConstNullVariant = CVariant::VariantTypeConstNull
static

The documentation for this class was generated from the following files: