TTKMusicPlayer  4.2.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
QJsonValue Class Reference

#include <QJsonValue.h>

Classes

union  ValueType
 

Public Types

enum  Type {
  Null = 0x0, Bool = 0x1, Double = 0x2, String = 0x3,
  Array = 0x4, Object = 0x5, Undefined = 0x80
}
 

Public Member Functions

 QJsonValue (Type type=Null)
 
 QJsonValue (bool b)
 
 QJsonValue (double n)
 
 QJsonValue (int n)
 
 QJsonValue (qint64 n)
 
 QJsonValue (const QString &s)
 
 QJsonValue (QLatin1String s)
 
 QJsonValue (const char *s)
 
 QJsonValue (const QJsonArray &a)
 
 QJsonValue (const QJsonObject &o)
 
 QJsonValue (const QJsonValue &other)
 
 ~QJsonValue ()
 
QJsonValueoperator= (const QJsonValue &other)
 
bool operator!= (const QJsonValue &other) const
 
bool operator== (const QJsonValue &other) const
 
bool isArray () const
 
bool isBool () const
 
bool isDouble () const
 
bool isNull () const
 
bool isObject () const
 
bool isString () const
 
bool isUndefined () const
 
QJsonArray toArray (const QJsonArray &defaultValue) const
 
QJsonArray toArray () const
 
bool toBool (bool defaultValue=false) const
 
double toDouble (double defaultValue=0) const
 
int toInt (int defaultValue=0) const
 
QJsonObject toObject (const QJsonObject &defaultValue) const
 
QJsonObject toObject () const
 
QString toString (const QString &defaultValue=QString()) const
 
QVariant toVariant () const
 
Type type () const
 

Static Public Member Functions

static QJsonValue fromVariant (const QVariant &variant)
 

Private Member Functions

 QJsonValue (const void *)
 
void swap (QJsonValue &other)
 

Private Attributes

Type type_
 
ValueType value_
 

Detailed Description

Definition at line 36 of file QJsonValue.h.

Member Enumeration Documentation

Enumerator
Null 
Bool 
Double 
String 
Array 
Object 
Undefined 

Definition at line 38 of file QJsonValue.h.

Constructor & Destructor Documentation

QJsonValue::QJsonValue ( Type  type = Null)

Definition at line 32 of file QJsonValue.cpp.

Referenced by fromVariant(), and operator=().

QJsonValue::QJsonValue ( bool  b)

Definition at line 38 of file QJsonValue.cpp.

References QJsonValue::ValueType::b, and value_.

QJsonValue::QJsonValue ( double  n)

Definition at line 45 of file QJsonValue.cpp.

References QJsonValue::ValueType::n, and value_.

QJsonValue::QJsonValue ( int  n)

Definition at line 89 of file QJsonValue.cpp.

References QJsonValue::ValueType::n, and value_.

QJsonValue::QJsonValue ( qint64  n)

Definition at line 96 of file QJsonValue.cpp.

References QJsonValue::ValueType::n, and value_.

QJsonValue::QJsonValue ( const QString &  s)

Definition at line 52 of file QJsonValue.cpp.

References QJsonValue::ValueType::s, and value_.

QJsonValue::QJsonValue ( QLatin1String  s)

Definition at line 59 of file QJsonValue.cpp.

References QJsonValue::ValueType::s, and value_.

QJsonValue::QJsonValue ( const char *  s)

Definition at line 67 of file QJsonValue.cpp.

References QJsonValue::ValueType::s, and value_.

QJsonValue::QJsonValue ( const QJsonArray a)

Definition at line 75 of file QJsonValue.cpp.

References QJsonArray::clone(), QJsonValue::ValueType::r, and value_.

QJsonValue::QJsonValue ( const QJsonObject o)

Definition at line 82 of file QJsonValue.cpp.

References QJsonObject::clone(), QJsonValue::ValueType::r, and value_.

QJsonValue::QJsonValue ( const QJsonValue other)
QJsonValue::~QJsonValue ( )
QJsonValue::QJsonValue ( const void *  )
private

Member Function Documentation

QJsonValue QJsonValue::fromVariant ( const QVariant &  variant)
static
bool QJsonValue::isArray ( ) const

Definition at line 189 of file QJsonValue.cpp.

References Array, and type_.

Referenced by QJsonValueRef::isArray(), and toArray().

bool QJsonValue::isBool ( ) const

Definition at line 196 of file QJsonValue.cpp.

References Bool, and type_.

Referenced by QJsonValueRef::isBool(), and toBool().

bool QJsonValue::isDouble ( ) const

Definition at line 203 of file QJsonValue.cpp.

References Double, and type_.

Referenced by QJsonValueRef::isDouble(), toDouble(), and toInt().

bool QJsonValue::isNull ( ) const

Definition at line 210 of file QJsonValue.cpp.

References Null, and type_.

Referenced by QJsonValueRef::isNull().

bool QJsonValue::isObject ( ) const

Definition at line 217 of file QJsonValue.cpp.

References Object, and type_.

Referenced by QJsonValueRef::isObject(), and toObject().

bool QJsonValue::isString ( ) const

Definition at line 224 of file QJsonValue.cpp.

References String, and type_.

Referenced by QJsonValueRef::isString(), and toString().

bool QJsonValue::isUndefined ( ) const

Definition at line 231 of file QJsonValue.cpp.

References type_, and Undefined.

Referenced by QJsonValueRef::isUndefined().

bool QJsonValue::operator!= ( const QJsonValue other) const

Definition at line 157 of file QJsonValue.cpp.

QJsonValue & QJsonValue::operator= ( const QJsonValue other)

Definition at line 149 of file QJsonValue.cpp.

References QJsonValue().

bool QJsonValue::operator== ( const QJsonValue other) const
void QJsonValue::swap ( QJsonValue other)
private

Definition at line 388 of file QJsonValue.cpp.

References type_, and value_.

QJsonArray QJsonValue::toArray ( const QJsonArray defaultValue) const
QJsonArray QJsonValue::toArray ( ) const

Definition at line 256 of file QJsonValue.cpp.

bool QJsonValue::toBool ( bool  defaultValue = false) const

Definition at line 263 of file QJsonValue.cpp.

References QJsonValue::ValueType::b, isBool(), and value_.

Referenced by QJsonValueRef::toBool(), and QJsonDocument::toJson().

double QJsonValue::toDouble ( double  defaultValue = 0) const

Definition at line 274 of file QJsonValue.cpp.

References isDouble(), QJsonValue::ValueType::n, and value_.

Referenced by QJsonValueRef::toDouble(), and QJsonDocument::toJson().

int QJsonValue::toInt ( int  defaultValue = 0) const

Definition at line 285 of file QJsonValue.cpp.

References isDouble(), QJsonValue::ValueType::n, and value_.

Referenced by QJsonValueRef::toInt().

QJsonObject QJsonValue::toObject ( const QJsonObject defaultValue) const
QJsonObject QJsonValue::toObject ( ) const

Definition at line 307 of file QJsonValue.cpp.

QString QJsonValue::toString ( const QString &  defaultValue = QString()) const

Definition at line 314 of file QJsonValue.cpp.

References isString(), QJsonValue::ValueType::s, and value_.

Referenced by QJsonDocument::toJson(), and QJsonValueRef::toString().

QVariant QJsonValue::toVariant ( ) const
QJsonValue::Type QJsonValue::type ( ) const

Definition at line 238 of file QJsonValue.cpp.

References type_.

Referenced by QJsonDocument::toJson(), and QJsonValueRef::type().

Member Data Documentation

Type QJsonValue::type_
private
ValueType QJsonValue::value_
private

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