#include <qmjsonarray.h>
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< QMJsonValue > | takeFirst (void) |
virtual QMPointer< QMJsonValue > | takeLast (void) |
virtual QMPointer< QMJsonValue > | takeAt (int32_t index) |
virtual QMPointer< QMJsonValue > | takeAt (int32_t index, const QMPointer< QMJsonValue > &defaultValue) |
template<class T > | |
QMPointer< QMJsonValue > | takeAt (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< QMJsonValue > | value (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) |
Definition at line 35 of file qmjsonarray.h.
QMJsonArray::QMJsonArray | ( | ) |
Default constructor, creates an empty QMJsonArray
Definition at line 33 of file qmjsonarray.cpp.
|
explicit |
Overloaded constructor, create a QMJsonArray and fills it with the QMJsonValues provided in list
Definition at line 37 of file qmjsonarray.cpp.
|
virtual |
Definition at line 42 of file qmjsonarray.cpp.
|
virtual |
Definition at line 46 of file qmjsonarray.cpp.
|
virtual |
Clears the QMJsonArray
Definition at line 51 of file qmjsonarray.cpp.
|
virtual |
Returns the number of QMJsonValues in the QMJsonArray
Definition at line 72 of file qmjsonarray.cpp.
|
virtual |
Returns the number of QMJsonValues in the QMJsonArray
Definition at line 77 of file qmjsonarray.cpp.
|
virtual |
Returns the number of QMJsonValues in the QMJsonArray
Definition at line 82 of file qmjsonarray.cpp.
|
virtual |
Returns true if the QMJsonArray is empty
Definition at line 87 of file qmjsonarray.cpp.
|
virtual |
Returns true if the QMJsonArray is empty
Definition at line 92 of file qmjsonarray.cpp.
|
virtual |
Returns true is the QMJsonArray contains value.
Definition at line 97 of file qmjsonarray.cpp.
|
virtual |
Returns the index of if the QMJsonArray contains value, otherwise returns -1
Definition at line 102 of file qmjsonarray.cpp.
|
virtual |
Returns the last index of if the QMJsonArray contains value, otherwise returns -1
Definition at line 107 of file qmjsonarray.cpp.
|
virtual |
Returns true is the QMJsonArray ends with value.
Definition at line 112 of file qmjsonarray.cpp.
|
virtual |
Returns true is the QMJsonArray starts with value.
Definition at line 117 of file qmjsonarray.cpp.
|
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.
|
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.
|
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 > 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 > 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 > 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.
|
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.
|
virtual |
Removes all instances of value from the QMJsonArray.
Definition at line 171 of file qmjsonarray.cpp.
|
virtual |
Removes the first instance of value from the QMJsonArray.
Definition at line 177 of file qmjsonarray.cpp.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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 > 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.
|
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.
|
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.
|
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.
|
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 > 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.
|
virtual |
Returns the internal QList of QMJsonValues.
Definition at line 270 of file qmjsonarray.cpp.
|
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.
|
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.
|
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.
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.
Definition at line 300 of file qmjsonarray.cpp.
void QMJsonArray::replace | ( | int32_t | index, |
const T & | value | ||
) |
Definition at line 185 of file qmjsonarray.h.
|
virtual |
Returns true if the wrapped JSON value at index is a "null".
Definition at line 319 of file qmjsonarray.cpp.
|
virtual |
Returns true if the wrapped JSON value at index is a boolean
Definition at line 327 of file qmjsonarray.cpp.
|
virtual |
Returns true if the wrapped JSON value at index is a double.
Definition at line 335 of file qmjsonarray.cpp.
|
virtual |
Returns true if the wrapped JSON value at index is a string.
Definition at line 343 of file qmjsonarray.cpp.
|
virtual |
Returns true if the wrapped JSON value at index is a JSON array
Definition at line 351 of file qmjsonarray.cpp.
|
virtual |
Returns true if the wrapped JSON value at index is a JSON object
Definition at line 359 of file qmjsonarray.cpp.
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:
Definition at line 191 of file qmjsonarray.h.
|
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:
Definition at line 367 of file qmjsonarray.cpp.
|
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:
Definition at line 372 of file qmjsonarray.cpp.
|
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:
Definition at line 377 of file qmjsonarray.cpp.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
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:
Definition at line 200 of file qmjsonarray.h.
|
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 417 of file qmjsonarray.cpp.
|
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 422 of file qmjsonarray.cpp.
|
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 427 of file qmjsonarray.cpp.
|
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.
|
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.
|
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.
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:
Definition at line 206 of file qmjsonarray.h.
|
signal |
|
signal |