Signals | Public Member Functions
QMJsonArray Class Reference

#include <qmjsonarray.h>

Inheritance diagram for QMJsonArray:

Signals

void itemAdded (int32_t index, const QMPointer< QMJsonValue > &value)
 
void itemRemoved (int32_t index, const QMPointer< QMJsonValue > &value)
 

Public Member Functions

 QMJsonArray ()
 
 QMJsonArray (const QList< QMPointer< QMJsonValue > > &list)
 
virtual ~QMJsonArray ()
 
virtual void reserve (int32_t alloc)
 
virtual void clear (void)
 
virtual int32_t count (void) const
 
virtual int32_t length (void) const
 
virtual int32_t size (void) const
 
virtual bool isEmpty (void) const
 
virtual bool empty (void) const
 
virtual bool contains (const QMPointer< QMJsonValue > &value) const
 
virtual int32_t indexOf (const QMPointer< QMJsonValue > &value) const
 
virtual int32_t lastIndexOf (const QMPointer< QMJsonValue > &value, int32_t from=-1) const
 
virtual bool endsWith (const QMPointer< QMJsonValue > &value) const
 
virtual bool startsWith (const QMPointer< QMJsonValue > &value) const
 
virtual void prepend (const QMPointer< QMJsonValue > &value)
 
virtual void append (const QMPointer< QMJsonValue > &value)
 
virtual void insert (int32_t index, const QMPointer< QMJsonValue > &value)
 
template<class T >
void prepend (const T &value)
 
template<class T >
void append (const T &value)
 
template<class T >
void insert (int32_t index, const T &value)
 
virtual void unite (const QMPointer< QMJsonArray > &array, QMJsonArrayUnitePolicy policy=QMJsonArrayUnitePolicy_Append)
 
virtual void removeAll (const QMPointer< QMJsonValue > &value)
 
virtual void removeOne (const QMPointer< QMJsonValue > &value)
 
virtual void removeAt (int32_t index)
 
virtual void removeFirst (void)
 
virtual void removeLast (void)
 
virtual QMPointer< QMJsonValuetakeFirst (void)
 
virtual QMPointer< QMJsonValuetakeLast (void)
 
virtual QMPointer< QMJsonValuetakeAt (int32_t index)
 
virtual QMPointer< QMJsonValuetakeAt (int32_t index, const QMPointer< QMJsonValue > &defaultValue)
 
template<class T >
QMPointer< QMJsonValuetakeAt (int32_t index, const T &defaultValue)
 
virtual const QMPointer< QMJsonValue > & front (void) const
 
virtual const QMPointer< QMJsonValue > & back (void) const
 
virtual const QMPointer< QMJsonValue > & value (int32_t index) const
 
virtual const QMPointer< QMJsonValue > & value (int32_t index, const QMPointer< QMJsonValue > &defaultValue) const
 
template<class T >
QMPointer< QMJsonValuevalue (int32_t index, const T &defaultValue) const
 
virtual QList< QMPointer< QMJsonValue > > values (void) const
 
virtual QList< QMPointer< QMJsonValue > > mid (int32_t pos, int32_t length=-1) const
 
virtual void move (int32_t from, int32_t to)
 
virtual void replace (int32_t index, const QMPointer< QMJsonValue > &value)
 
template<class T >
void replace (int32_t index, const T &value)
 
virtual bool isNull (int32_t index) const
 
virtual bool isBool (int32_t index) const
 
virtual bool isDouble (int32_t index) const
 
virtual bool isString (int32_t index) const
 
virtual bool isArray (int32_t index) const
 
virtual bool isObject (int32_t index) const
 
template<class T >
bool is (int32_t index) const
 
virtual bool toBool (int32_t index) const
 
virtual double toDouble (int32_t index) const
 
virtual QString toString (int32_t index) const
 
virtual const QMPointer< QMJsonArray > & toArray (int32_t index) const
 
virtual const QMPointer< QMJsonObject > & toObject (int32_t index) const
 
virtual bool toBool (int32_t index, bool defaultValue) const
 
virtual double toDouble (int32_t index, double defaultValue) const
 
virtual const QString & toString (int32_t index, const QString &defaultValue) const
 
virtual const QMPointer< QMJsonArray > & toArray (int32_t index, const QMPointer< QMJsonArray > &defaultValue) const
 
virtual const QMPointer< QMJsonObject > & toObject (int32_t index, const QMPointer< QMJsonObject > &defaultValue) const
 
template<class T >
const T & to (int32_t index, const T &defaultValue) const
 
virtual bool fromBool (int32_t index, bool value)
 
virtual bool fromDouble (int32_t index, double value)
 
virtual bool fromString (int32_t index, const QString &value)
 
virtual bool fromArray (int32_t index, const QMPointer< QMJsonArray > &value)
 
virtual bool fromObject (int32_t index, const QMPointer< QMJsonObject > &value)
 
virtual bool from (int32_t index, const QMPointer< QMJsonValue > &value)
 
template<class T >
bool from (int32_t index, const T &value)
 

Detailed Description

Definition at line 35 of file qmjsonarray.h.

Constructor & Destructor Documentation

QMJsonArray::QMJsonArray ( )

Default constructor, creates an empty QMJsonArray

Definition at line 33 of file qmjsonarray.cpp.

QMJsonArray::QMJsonArray ( const QList< QMPointer< QMJsonValue > > &  list)
explicit

Overloaded constructor, create a QMJsonArray and fills it with the QMJsonValues provided in list

Definition at line 37 of file qmjsonarray.cpp.

QMJsonArray::~QMJsonArray ( )
virtual

Definition at line 42 of file qmjsonarray.cpp.

Member Function Documentation

void QMJsonArray::reserve ( int32_t  alloc)
virtual

Definition at line 46 of file qmjsonarray.cpp.

void QMJsonArray::clear ( void  )
virtual

Clears the QMJsonArray

Definition at line 51 of file qmjsonarray.cpp.

int32_t QMJsonArray::count ( void  ) const
virtual

Returns the number of QMJsonValues in the QMJsonArray

Definition at line 72 of file qmjsonarray.cpp.

int32_t QMJsonArray::length ( void  ) const
virtual

Returns the number of QMJsonValues in the QMJsonArray

Definition at line 77 of file qmjsonarray.cpp.

int32_t QMJsonArray::size ( void  ) const
virtual

Returns the number of QMJsonValues in the QMJsonArray

Definition at line 82 of file qmjsonarray.cpp.

bool QMJsonArray::isEmpty ( void  ) const
virtual

Returns true if the QMJsonArray is empty

Definition at line 87 of file qmjsonarray.cpp.

bool QMJsonArray::empty ( void  ) const
virtual

Returns true if the QMJsonArray is empty

Definition at line 92 of file qmjsonarray.cpp.

bool QMJsonArray::contains ( const QMPointer< QMJsonValue > &  value) const
virtual

Returns true is the QMJsonArray contains value.

Note
This function is doing a pointer comparison. It is not comparing the value contained within the QMJsonValue with other QMJsonValues in the array. Currently this library does not provide such comparisons.

Definition at line 97 of file qmjsonarray.cpp.

int32_t QMJsonArray::indexOf ( const QMPointer< QMJsonValue > &  value) const
virtual

Returns the index of if the QMJsonArray contains value, otherwise returns -1

Note
This function is doing a pointer comparison. It is not comparing the value contained within the QMJsonValue with other QMJsonValues in the array. Currently this library does not provide such comparisons.

Definition at line 102 of file qmjsonarray.cpp.

int32_t QMJsonArray::lastIndexOf ( const QMPointer< QMJsonValue > &  value,
int32_t  from = -1 
) const
virtual

Returns the last index of if the QMJsonArray contains value, otherwise returns -1

Note
This function is doing a pointer comparison. It is not comparing the value contained within the QMJsonValue with other QMJsonValues in the array. Currently this library does not provide such comparisons.

Definition at line 107 of file qmjsonarray.cpp.

bool QMJsonArray::endsWith ( const QMPointer< QMJsonValue > &  value) const
virtual

Returns true is the QMJsonArray ends with value.

Note
This function is doing a pointer comparison. It is not comparing the value contained within the QMJsonValue with other QMJsonValues in the array. Currently this library does not provide such comparisons.

Definition at line 112 of file qmjsonarray.cpp.

bool QMJsonArray::startsWith ( const QMPointer< QMJsonValue > &  value) const
virtual

Returns true is the QMJsonArray starts with value.

Note
This function is doing a pointer comparison. It is not comparing the value contained within the QMJsonValue with other QMJsonValues in the array. Currently this library does not provide such comparisons.

Definition at line 117 of file qmjsonarray.cpp.

void QMJsonArray::prepend ( const QMPointer< QMJsonValue > &  value)
virtual

Prepends value to the front of the QMJsonArray. If value is NULL, this operation is ignored

Definition at line 122 of file qmjsonarray.cpp.

void QMJsonArray::append ( const QMPointer< QMJsonValue > &  value)
virtual

Appends value to the end of the QMJsonArray. If value is NULL, this operation is ignored

Definition at line 127 of file qmjsonarray.cpp.

void QMJsonArray::insert ( int32_t  index,
const QMPointer< QMJsonValue > &  value 
)
virtual

Inserts value into the QMJsonArray. If index is less then 0, value is prepended to the front of QMJsonArray. If index is greater than or equal to the size of the QMJsonArray, value is appended to the end of QMJsonArray. If value is NULL, this operation is ignored

Definition at line 132 of file qmjsonarray.cpp.

template<class T >
template< class T > void QMJsonArray::prepend ( const T &  value)

Wraps value in a QMJsonValue and prepends value to the front of the QMJsonArray.

Definition at line 146 of file qmjsonarray.h.

template<class T >
template< class T > void QMJsonArray::append ( const T &  value)

Wraps value in a QMJsonValue and appends value to the end of the QMJsonArray

Definition at line 152 of file qmjsonarray.h.

template<class T >
template< class T > void QMJsonArray::insert ( int32_t  index,
const T &  value 
)

Wraps value in a QMJsonValue and inserts value into the QMJsonArray. If index is less then 0, value is prepended to the front of QMJsonArray. If index is greater than or equal to the size of the QMJsonArray, value is appended to the end of QMJsonArray

Definition at line 158 of file qmjsonarray.h.

void QMJsonArray::unite ( const QMPointer< QMJsonArray > &  array,
QMJsonArrayUnitePolicy  policy = QMJsonArrayUnitePolicy_Append 
)
virtual

Unites this QMJsonArray with array by appending all the QMJsonValues in array to this QMJsonArray. If policy is set to QMJsonArrayUnitePolicy_Prepend, the QMJsonValues in array are prepended to this QMJsonArray. If array is NULL, this operation is ignored.

Definition at line 151 of file qmjsonarray.cpp.

void QMJsonArray::removeAll ( const QMPointer< QMJsonValue > &  value)
virtual

Removes all instances of value from the QMJsonArray.

Definition at line 171 of file qmjsonarray.cpp.

void QMJsonArray::removeOne ( const QMPointer< QMJsonValue > &  value)
virtual

Removes the first instance of value from the QMJsonArray.

Note
This is faster if you know that only one instance of value is in the QMJsonArray

Definition at line 177 of file qmjsonarray.cpp.

void QMJsonArray::removeAt ( int32_t  index)
virtual

Removes the QMJsonValue at index. If index is less then 0, or greater than or equal to the length of the QMJsonArray, this operation is ignored.

Definition at line 182 of file qmjsonarray.cpp.

void QMJsonArray::removeFirst ( void  )
virtual

Removes the first QMJsonValue in the QMJsonArray. If the QMJsonArray is empty, this operation is ignored.

Definition at line 190 of file qmjsonarray.cpp.

void QMJsonArray::removeLast ( void  )
virtual

Removes the last QMJsonValue in the QMJsonArray. If the QMJsonArray is empty, this operation is ignored.

Definition at line 195 of file qmjsonarray.cpp.

QMPointer< QMJsonValue > QMJsonArray::takeFirst ( void  )
virtual

Removes the first QMJsonValue in the QMJsonArray and returns the removed QMJsonValue. If the QMJsonArray is empty, this operation returns a newly constructed, default QMJsonValue

Definition at line 200 of file qmjsonarray.cpp.

QMPointer< QMJsonValue > QMJsonArray::takeLast ( void  )
virtual

Removes the last QMJsonValue in the QMJsonArray and returns the removed QMJsonValue. If the QMJsonArray is empty, this operation returns a newly constructed, default QMJsonValue

Definition at line 205 of file qmjsonarray.cpp.

QMPointer< QMJsonValue > QMJsonArray::takeAt ( int32_t  index)
virtual

Removes the QMJsonValue at index and returns the removed QMJsonValue. If index is less than 0 or greater than or equal to the length of this QMJsonArray, this operation returns a newly constructed, default QMJsonValue

Definition at line 210 of file qmjsonarray.cpp.

QMPointer< QMJsonValue > QMJsonArray::takeAt ( int32_t  index,
const QMPointer< QMJsonValue > &  defaultValue 
)
virtual

Removes the QMJsonValue at index and returns the removed QMJsonValue. If index is less than 0 or greater than or equal to the length of this QMJsonArray, this operation returns defaultValue

Definition at line 221 of file qmjsonarray.cpp.

template<class T >
template< class T > QMPointer< QMJsonValue > QMJsonArray::takeAt ( int32_t  index,
const T &  defaultValue 
)

Removes the QMJsonValue at index and returns the removed QMJsonValue. If index is less than 0 or greater than or equal to the length of this QMJsonArray, this operation returns defaultValue wrapped in a QMJsonValue

Definition at line 164 of file qmjsonarray.h.

const QMPointer< QMJsonValue > & QMJsonArray::front ( void  ) const
virtual

Returns the first QMJsonValue in the QMJsonArray. If the QMJsonArray is empty, a default constructed QMJsonValue is returned.

Definition at line 232 of file qmjsonarray.cpp.

const QMPointer< QMJsonValue > & QMJsonArray::back ( void  ) const
virtual

Returns the last QMJsonValue in the QMJsonArray. If the QMJsonArray is empty, a default constructed QMJsonValue is returned.

Definition at line 242 of file qmjsonarray.cpp.

const QMPointer< QMJsonValue > & QMJsonArray::value ( int32_t  index) const
virtual

Returns the QMJsonValue from the QMJsonArray at index. If index is less than 0 or greater than or equal to the QMJsonArray's length, a default constructed QMJsonValue is returned.

Definition at line 252 of file qmjsonarray.cpp.

const QMPointer< QMJsonValue > & QMJsonArray::value ( int32_t  index,
const QMPointer< QMJsonValue > &  defaultValue 
) const
virtual

Returns the QMJsonValue from the QMJsonArray at index. If index is less than 0 or greater than or equal to the QMJsonArray's length, defaultValue is returned.

Definition at line 262 of file qmjsonarray.cpp.

template<class T >
template< class T > QMPointer< QMJsonValue > QMJsonArray::value ( int32_t  index,
const T &  defaultValue 
) const

Returns the QMJsonValue from the QMJsonArray at index. If index is less than 0 or greater than or equal to the QMJsonArray's length, defaultValue is wrapped in a QMJsonValue and then returned.

Definition at line 176 of file qmjsonarray.h.

QList< QMPointer< QMJsonValue > > QMJsonArray::values ( void  ) const
virtual

Returns the internal QList of QMJsonValues.

Definition at line 270 of file qmjsonarray.cpp.

QList< QMPointer< QMJsonValue > > QMJsonArray::mid ( int32_t  pos,
int32_t  length = -1 
) const
virtual

Returns a section of the internal QList of QMJsonValues. If the interal list is empty, an empty QList is returned. If pos is greater than or equal to the length of the internal QList, an empty QList is returned. If the pos is less than 0, pos is set to 0. If the length + pos is greater than the total number of QMJsonValues in the QList, the rest of the QList starting at pos is returned.

Definition at line 275 of file qmjsonarray.cpp.

void QMJsonArray::move ( int32_t  from,
int32_t  to 
)
virtual

Moves one element from index from, to index to. If the internal QList is empty, this operation is ignored. If the from or to is less than 0, or greater than or equal to the length of the QMJsonArray, the operation is ignored. If to is equal to from, the operation is ignored.

Definition at line 288 of file qmjsonarray.cpp.

void QMJsonArray::replace ( int32_t  index,
const QMPointer< QMJsonValue > &  value 
)
virtual

Replaced the QMJsonValue at index with value. If index is less than 0 or greater than or equal to the QMJsonArray's length, the opration is ignored. If value is NULL a default constructed QMJsonValue is used instead.

Note
This function first emits itemRemoved for the QMJsonValue currently in the QMJsonArray, and then emits itemAdded for value. These signals are emitted after value has already replaced the previous QMJsonValue. Querying the QMJsonArray during the itemRemoved signal wil result in value showing up in it's place.

Replaced the QMJsonValue at index with value wrapped in a QMJsonValue. If index is less than 0 or greater than or equal to the QMJsonArray's length, the opration is ignored. If value is NULL a default constructed QMJsonValue is used instead.

Note
This function first emits itemRemoved for the QMJsonValue currently in the QMJsonArray, and then emits itemAdded for value. These signals are emitted after value has already replaced the previous QMJsonValue. Querying the QMJsonArray during the itemRemoved signal wil result in value showing up in it's place.

Definition at line 300 of file qmjsonarray.cpp.

template<class T >
void QMJsonArray::replace ( int32_t  index,
const T &  value 
)

Definition at line 185 of file qmjsonarray.h.

bool QMJsonArray::isNull ( int32_t  index) const
virtual

Returns true if the wrapped JSON value at index is a "null".

Note
Internally, "null" QMJsonValues have no internal type pointer.

Definition at line 319 of file qmjsonarray.cpp.

bool QMJsonArray::isBool ( int32_t  index) const
virtual

Returns true if the wrapped JSON value at index is a boolean

Definition at line 327 of file qmjsonarray.cpp.

bool QMJsonArray::isDouble ( int32_t  index) const
virtual

Returns true if the wrapped JSON value at index is a double.

Note
All numbers are stored as doubles, including integer types.

Definition at line 335 of file qmjsonarray.cpp.

bool QMJsonArray::isString ( int32_t  index) const
virtual

Returns true if the wrapped JSON value at index is a string.

Note
QtMark JSON stores all strings internally as QStrings.

Definition at line 343 of file qmjsonarray.cpp.

bool QMJsonArray::isArray ( int32_t  index) const
virtual

Returns true if the wrapped JSON value at index is a JSON array

Definition at line 351 of file qmjsonarray.cpp.

bool QMJsonArray::isObject ( int32_t  index) const
virtual

Returns true if the wrapped JSON value at index is a JSON object

Definition at line 359 of file qmjsonarray.cpp.

template<class T >
bool QMJsonArray::is ( int32_t  index) const

Returns true if the wrapped JSON value at index is of type T. This function is ment to be used with custom, complex types as show below:

auto value = QMPointer<QMJsonValue>(new QMJsonValue(QSize()));
qDebug() << value->is<QSize>(); // true

Definition at line 191 of file qmjsonarray.h.

bool QMJsonArray::toBool ( int32_t  index) const
virtual

Unwraps the JSON value at index and returns the interanl type. Depending on what type the JSON value is, will dictate what is returned:

  • null: false
  • bool: true / falue (native)
  • double: false if the value is 0, true otherwise
  • string: true if the value is "true", false otherwise
  • else: false

Definition at line 367 of file qmjsonarray.cpp.

double QMJsonArray::toDouble ( int32_t  index) const
virtual

Unwraps the JSON value at index and returns the interanl type. Depending on what type the JSON value is, will dictate what is returned:

  • null: 0
  • bool: false = 0, true = 1
  • double: double (native)
  • string: string converted to double, 0 if conversion fails.
  • else: 0

Definition at line 372 of file qmjsonarray.cpp.

QString QMJsonArray::toString ( int32_t  index) const
virtual

Unwraps the JSON value at index and returns the interanl type. Depending on what type the JSON value is, will dictate what is returned:

  • null: "null"
  • bool: "true" if true, "false" if false
  • double: double converted to string
  • string: string (native)
  • else: 0

Definition at line 377 of file qmjsonarray.cpp.

const QMPointer< QMJsonArray > & QMJsonArray::toArray ( int32_t  index) const
virtual

Unwraps the JSON value at index and returns a QMJsonArray. If the internal type is not a QMJsonArray, an empty QMJsonArray is returned.

Definition at line 382 of file qmjsonarray.cpp.

const QMPointer< QMJsonObject > & QMJsonArray::toObject ( int32_t  index) const
virtual

Unwraps the JSON value at index and returns a QMJsonObject. If the internal type is not a QMJsonObject, an empty QMJsonObject is returned.

Definition at line 387 of file qmjsonarray.cpp.

bool QMJsonArray::toBool ( int32_t  index,
bool  defaultValue 
) const
virtual

Unwraps the JSON value at index and returns the interanl type. If the interal type is not a boolean, the default value is returned instead.

Definition at line 392 of file qmjsonarray.cpp.

double QMJsonArray::toDouble ( int32_t  index,
double  defaultValue 
) const
virtual

Unwraps the JSON value at index and returns the interanl type. If the interal type is not a double, the default value is returned instead.

Definition at line 397 of file qmjsonarray.cpp.

const QString & QMJsonArray::toString ( int32_t  index,
const QString &  defaultValue 
) const
virtual

Unwraps the JSON value at index and returns the interanl type. If the interal type is not a string, the default value is returned instead.

Definition at line 402 of file qmjsonarray.cpp.

const QMPointer< QMJsonArray > & QMJsonArray::toArray ( int32_t  index,
const QMPointer< QMJsonArray > &  defaultValue 
) const
virtual

Unwraps the JSON value at index and returns the interanl type. If the interal type is not an array, the default value is returned instead.

Definition at line 407 of file qmjsonarray.cpp.

const QMPointer< QMJsonObject > & QMJsonArray::toObject ( int32_t  index,
const QMPointer< QMJsonObject > &  defaultValue 
) const
virtual

Unwraps the JSON value at index and returns the interanl type. If the interal type is not an object, the default value is returned instead.

Definition at line 412 of file qmjsonarray.cpp.

template<class T >
const T & QMJsonArray::to ( int32_t  index,
const T &  defaultValue 
) const

Unwraps the JSON value at index and returns the interanl type. If the interal type is not of type T, the default value is returned instead. This function is ment to be used with custom, complex types as show below:

auto value1 = QMPointer<QMJsonValue>(new QMJsonValue(false));
auto value2 = QMPointer<QMJsonValue>(new QMJsonValue(QSize(4, 8)));
qDebug() << value1->to<QSize>(15, 16); // QSize(15, 16)
qDebug() << value2->to<QSize>(15, 16); // QSize(4, 8)

Definition at line 200 of file qmjsonarray.h.

bool QMJsonArray::fromBool ( int32_t  index,
bool  value 
)
virtual

Unwraps the JSON value at index and sets the interanl type. Depending on what type the JSON value is, will dictate what the internal type is set to:

  • null: (ignored, returns false)
  • bool: true / falue (native)
  • double: 0 if false, 1 if true
  • string: "false" if false, "true" if true
  • else: (ignored, returns false)

Definition at line 417 of file qmjsonarray.cpp.

bool QMJsonArray::fromDouble ( int32_t  index,
double  value 
)
virtual

Unwraps the JSON value at index and sets the interanl type. Depending on what type the JSON value is, will dictate what the internal type is set to:

  • null: (ignored, returns false)
  • bool: false if 0, true otherwise
  • double: double (native)
  • string: double converted to string
  • else: (ignored, returns false)

Definition at line 422 of file qmjsonarray.cpp.

bool QMJsonArray::fromString ( int32_t  index,
const QString &  value 
)
virtual

Unwraps the JSON value at index and sets the interanl type. Depending on what type the JSON value is, will dictate what the internal type is set to:

  • null: (ignored, returns false)
  • bool: true if "true", false otherwise
  • double: string converted to double. 0 if conversion fails.
  • string: string (native)
  • else: (ignored, returns false)

Definition at line 427 of file qmjsonarray.cpp.

bool QMJsonArray::fromArray ( int32_t  index,
const QMPointer< QMJsonArray > &  value 
)
virtual

Unwraps the JSON value at index and sets the internal type to a QMJsonArray. If the internal type is not a QMJsonArray, the request is ignored

Definition at line 432 of file qmjsonarray.cpp.

bool QMJsonArray::fromObject ( int32_t  index,
const QMPointer< QMJsonObject > &  value 
)
virtual

Unwraps the JSON value at index and sets the internal type to a QMJsonObject. If the internal type is not a QMJsonObject, the request is ignored

Definition at line 437 of file qmjsonarray.cpp.

bool QMJsonArray::from ( int32_t  index,
const QMPointer< QMJsonValue > &  value 
)
virtual

Unwraps the JSON value at index and sets the interanl type. Depending on what type the JSON value is, will dictate what the internal type is set to:

Definition at line 442 of file qmjsonarray.cpp.

template<class T >
bool QMJsonArray::from ( int32_t  index,
const T &  value 
)

Unwraps the JSON value at index and sets the interanl type. If the interal type is not of type T, the request is ignored. This function is ment to be used with custom, complex types as show below:

auto value1 = QMPointer<QMJsonValue>(new QMJsonValue(false));
auto value2 = QMPointer<QMJsonValue>(new QMJsonValue(QSize(4, 8)));
qDebug() << value1->from<QSize>(15, 16); // false
qDebug() << value2->from<QSize>(15, 16); // true

Definition at line 206 of file qmjsonarray.h.

void QMJsonArray::itemAdded ( int32_t  index,
const QMPointer< QMJsonValue > &  value 
)
signal
void QMJsonArray::itemRemoved ( int32_t  index,
const QMPointer< QMJsonValue > &  value 
)
signal

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