Struct qt_core::QCborArray
source · #[repr(C)]pub struct QCborArray { /* private fields */ }
Expand description
The QCborArray class is used to hold an array of CBOR elements.
C++ class: QCborArray
.
The QCborArray class is used to hold an array of CBOR elements.
This class can be used to hold one sequential container in CBOR (an array). CBOR is the Concise Binary Object Representation, a very compact form of binary data encoding that is a superset of JSON. It was created by the IETF Constrained RESTful Environments (CoRE) WG, which has used it in many new RFCs. It is meant to be used alongside the CoAP protocol.
QCborArray is very similar to QVariantList and QJsonArray and its API is almost identical to those two classes. It can also be converted to and from those two, though there may be loss of information in some conversions.
Implementations§
source§impl QCborArray
impl QCborArray
sourcepub unsafe fn add_assign(
&self,
v: impl CastInto<Ref<QCborValue>>
) -> Ref<QCborArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn add_assign( &self, v: impl CastInto<Ref<QCborValue>> ) -> Ref<QCborArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Appends v to this array and returns a reference to this array.
Calls C++ function: QCborArray& QCborArray::operator+=(const QCborValue& v)
.
Appends v to this array and returns a reference to this array.
See also append(), insert(), operator+(), and operator<<().
sourcepub unsafe fn append(&self, value: impl CastInto<Ref<QCborValue>>)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn append(&self, value: impl CastInto<Ref<QCborValue>>)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: void QCborArray::append(const QCborValue& value)
.
sourcepub unsafe fn at(&self, i: c_longlong) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn at(&self, i: c_longlong) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns the QCborValue element at position i in the array.
Calls C++ function: QCborValue QCborArray::at(long long i) const
.
Returns the QCborValue element at position i in the array.
If the array is smaller than i elements, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array starts with an undefined value.
See also operator[](), first(), last(), insert(), prepend(), append(), removeAt(), and takeAt().
sourcepub unsafe fn begin_mut(&self) -> CppBox<Iterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn begin_mut(&self) -> CppBox<Iterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
Calls C++ function: QCborArray::Iterator QCborArray::begin()
.
Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
See also constBegin() and end().
sourcepub unsafe fn begin(&self) -> CppBox<ConstIterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn begin(&self) -> CppBox<ConstIterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
Calls C++ function: QCborArray::ConstIterator QCborArray::begin() const
.
Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
See also constBegin() and constEnd().
sourcepub unsafe fn cbegin(&self) -> CppBox<ConstIterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn cbegin(&self) -> CppBox<ConstIterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
Calls C++ function: QCborArray::ConstIterator QCborArray::cbegin() const
.
Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
See also constBegin() and constEnd().
sourcepub unsafe fn cend(&self) -> CppBox<ConstIterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn cend(&self) -> CppBox<ConstIterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to just after the last element in this array.
Calls C++ function: QCborArray::ConstIterator QCborArray::cend() const
.
Returns an array iterator pointing to just after the last element in this array.
See also constBegin() and constEnd().
sourcepub unsafe fn clear(&self)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn clear(&self)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Empties this array.
Calls C++ function: void QCborArray::clear()
.
Empties this array.
See also isEmpty().
sourcepub unsafe fn compare(&self, other: impl CastInto<Ref<QCborArray>>) -> c_int
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn compare(&self, other: impl CastInto<Ref<QCborArray>>) -> c_int
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Compares this array and other, comparing each element in sequence, and returns an integer that indicates whether this array should be sorted before (if the result is negative) or after other (if the result is positive). If this function returns 0, the two arrays are equal and contain the same elements.
Calls C++ function: int QCborArray::compare(const QCborArray& other) const
.
Compares this array and other, comparing each element in sequence, and returns an integer that indicates whether this array should be sorted before (if the result is negative) or after other (if the result is positive). If this function returns 0, the two arrays are equal and contain the same elements.
For more information on CBOR sorting order, see QCborValue::compare().
See also QCborValue::compare(), QCborMap::compare(), and operator==().
sourcepub unsafe fn const_begin(&self) -> CppBox<ConstIterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn const_begin(&self) -> CppBox<ConstIterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
Calls C++ function: QCborArray::ConstIterator QCborArray::constBegin() const
.
sourcepub unsafe fn const_end(&self) -> CppBox<ConstIterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn const_end(&self) -> CppBox<ConstIterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to just after the last element in this array.
Calls C++ function: QCborArray::ConstIterator QCborArray::constEnd() const
.
Returns an array iterator pointing to just after the last element in this array.
See also constBegin() and end().
sourcepub unsafe fn contains(&self, value: impl CastInto<Ref<QCborValue>>) -> bool
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn contains(&self, value: impl CastInto<Ref<QCborValue>>) -> bool
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns true if this array contains an element that is equal to value.
Calls C++ function: bool QCborArray::contains(const QCborValue& value) const
.
Returns true if this array contains an element that is equal to value.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QCborArray>>
) -> Ref<QCborArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QCborArray>> ) -> Ref<QCborArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Replaces the contents of this array with that found in other, then returns a reference to this object.
Calls C++ function: QCborArray& QCborArray::operator=(const QCborArray& other)
.
Replaces the contents of this array with that found in other, then returns a reference to this object.
sourcepub unsafe fn empty(&self) -> bool
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn empty(&self) -> bool
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Synonym for isEmpty(). This function is provided for compatibility with generic code that uses the Standard Library API.
Calls C++ function: bool QCborArray::empty() const
.
sourcepub unsafe fn end_mut(&self) -> CppBox<Iterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn end_mut(&self) -> CppBox<Iterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to just after the last element in this array.
Calls C++ function: QCborArray::Iterator QCborArray::end()
.
sourcepub unsafe fn end(&self) -> CppBox<ConstIterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn end(&self) -> CppBox<ConstIterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns an array iterator pointing to just after the last element in this array.
Calls C++ function: QCborArray::ConstIterator QCborArray::end() const
.
Returns an array iterator pointing to just after the last element in this array.
See also constBegin() and constEnd().
sourcepub unsafe fn erase_iterator(
&self,
it: impl CastInto<Ref<Iterator>>
) -> CppBox<Iterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn erase_iterator( &self, it: impl CastInto<Ref<Iterator>> ) -> CppBox<Iterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: QCborArray::Iterator QCborArray::erase(QCborArray::Iterator it)
.
sourcepub unsafe fn erase_const_iterator(
&self,
it: impl CastInto<Ref<ConstIterator>>
) -> CppBox<Iterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn erase_const_iterator( &self, it: impl CastInto<Ref<ConstIterator>> ) -> CppBox<Iterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: QCborArray::Iterator QCborArray::erase(QCborArray::ConstIterator it)
.
sourcepub unsafe fn extract_const_iterator(
&self,
it: impl CastInto<Ref<ConstIterator>>
) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn extract_const_iterator( &self, it: impl CastInto<Ref<ConstIterator>> ) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: QCborValue QCborArray::extract(QCborArray::ConstIterator it)
.
sourcepub unsafe fn extract_iterator(
&self,
it: impl CastInto<Ref<Iterator>>
) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn extract_iterator( &self, it: impl CastInto<Ref<Iterator>> ) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: QCborValue QCborArray::extract(QCborArray::Iterator it)
.
sourcepub unsafe fn first(&self) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn first(&self) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns the first QCborValue of this array.
Calls C++ function: QCborValue QCborArray::first() const
.
Returns the first QCborValue of this array.
If the array is empty, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array ends with an undefined value.
See also operator[](), at(), last(), insert(), prepend(), append(), removeAt(), and takeAt().
sourcepub unsafe fn first_mut(&self) -> CppBox<QCborValueRef>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn first_mut(&self) -> CppBox<QCborValueRef>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns a reference to the first QCborValue of this array. The array must not be empty.
Calls C++ function: QCborValueRef QCborArray::first()
.
Returns a reference to the first QCborValue of this array. The array must not be empty.
QCborValueRef has the exact same API as QCborValue, with one important difference: if you assign new values to it, this map will be updated with that new value.
See also operator[](), at(), last(), insert(), prepend(), append(), removeAt(), and takeAt().
sourcepub unsafe fn from_json_array(
array: impl CastInto<Ref<QJsonArray>>
) -> CppBox<QCborArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn from_json_array( array: impl CastInto<Ref<QJsonArray>> ) -> CppBox<QCborArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Converts all JSON items found in the array array to CBOR using QCborValue::fromJson(), and returns the CBOR array composed of those elements.
Calls C++ function: static QCborArray QCborArray::fromJsonArray(const QJsonArray& array)
.
Converts all JSON items found in the array array to CBOR using QCborValue::fromJson(), and returns the CBOR array composed of those elements.
This conversion is lossless, as the CBOR type system is a superset of JSON's. Moreover, the array returned by this function can be converted back to the original array by using toJsonArray().
See also toJsonArray(), toVariantList(), QCborValue::fromJsonValue(), and QCborMap::fromJsonObject().
sourcepub unsafe fn from_string_list(
list: impl CastInto<Ref<QStringList>>
) -> CppBox<QCborArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn from_string_list( list: impl CastInto<Ref<QStringList>> ) -> CppBox<QCborArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns a QCborArray containing all the strings found in the list list.
Calls C++ function: static QCborArray QCborArray::fromStringList(const QStringList& list)
.
Returns a QCborArray containing all the strings found in the list list.
See also fromVariantList() and fromJsonArray().
sourcepub unsafe fn from_variant_list(
list: impl CastInto<Ref<QListOfQVariant>>
) -> CppBox<QCborArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn from_variant_list( list: impl CastInto<Ref<QListOfQVariant>> ) -> CppBox<QCborArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Converts all the items in the list to CBOR using QCborValue::fromVariant() and returns the array composed of those elements.
Calls C++ function: static QCborArray QCborArray::fromVariantList(const QList<QVariant>& list)
.
Converts all the items in the list to CBOR using QCborValue::fromVariant() and returns the array composed of those elements.
Conversion from QVariant is not completely lossless. Please see the documentation in QCborValue::fromVariant() for more information.
See also toVariantList(), fromStringList(), fromJsonArray(), and QCborMap::fromVariantMap().
sourcepub unsafe fn index(&self, i: c_longlong) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn index(&self, i: c_longlong) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns the QCborValue element at position i in the array.
Calls C++ function: QCborValue QCborArray::operator[](long long i) const
.
Returns the QCborValue element at position i in the array.
If the array is smaller than i elements, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array contains an undefined value at position i.
See also at(), first(), last(), insert(), prepend(), append(), removeAt(), and takeAt().
sourcepub unsafe fn index_mut(&self, i: c_longlong) -> CppBox<QCborValueRef>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn index_mut(&self, i: c_longlong) -> CppBox<QCborValueRef>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns a reference to the QCborValue element at position i in the array. Indices beyond the end of the array will grow the array, filling with undefined entries, until it has an entry at the specified index.
Calls C++ function: QCborValueRef QCborArray::operator[](long long i)
.
Returns a reference to the QCborValue element at position i in the array. Indices beyond the end of the array will grow the array, filling with undefined entries, until it has an entry at the specified index.
QCborValueRef has the exact same API as QCborValue, with one important difference: if you assign new values to it, this map will be updated with that new value.
See also at(), first(), last(), insert(), prepend(), append(), removeAt(), and takeAt().
sourcepub unsafe fn insert_longlong_q_cbor_value(
&self,
i: c_longlong,
value: impl CastInto<Ref<QCborValue>>
)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn insert_longlong_q_cbor_value( &self, i: c_longlong, value: impl CastInto<Ref<QCborValue>> )
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: void QCborArray::insert(long long i, const QCborValue& value)
.
sourcepub unsafe fn insert_iterator_q_cbor_value(
&self,
before: impl CastInto<Ref<Iterator>>,
value: impl CastInto<Ref<QCborValue>>
) -> CppBox<Iterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn insert_iterator_q_cbor_value( &self, before: impl CastInto<Ref<Iterator>>, value: impl CastInto<Ref<QCborValue>> ) -> CppBox<Iterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: QCborArray::Iterator QCborArray::insert(QCborArray::Iterator before, const QCborValue& value)
.
sourcepub unsafe fn insert_const_iterator_q_cbor_value(
&self,
before: impl CastInto<Ref<ConstIterator>>,
value: impl CastInto<Ref<QCborValue>>
) -> CppBox<Iterator>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn insert_const_iterator_q_cbor_value( &self, before: impl CastInto<Ref<ConstIterator>>, value: impl CastInto<Ref<QCborValue>> ) -> CppBox<Iterator>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: QCborArray::Iterator QCborArray::insert(QCborArray::ConstIterator before, const QCborValue& value)
.
sourcepub unsafe fn is_empty(&self) -> bool
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn is_empty(&self) -> bool
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns true if this QCborArray is empty (that is if size() is 0).
Calls C++ function: bool QCborArray::isEmpty() const
.
Returns true if this QCborArray is empty (that is if size() is 0).
sourcepub unsafe fn last(&self) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn last(&self) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns the last QCborValue of this array.
Calls C++ function: QCborValue QCborArray::last() const
.
Returns the last QCborValue of this array.
If the array is empty, this function returns a QCborValue containing an undefined value. For that reason, it is not possible with this function to tell apart the situation where the array is not large enough from the case where the array ends with an undefined value.
See also operator[](), at(), first(), insert(), prepend(), append(), removeAt(), and takeAt().
sourcepub unsafe fn last_mut(&self) -> CppBox<QCborValueRef>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn last_mut(&self) -> CppBox<QCborValueRef>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns a reference to the last QCborValue of this array. The array must not be empty.
Calls C++ function: QCborValueRef QCborArray::last()
.
Returns a reference to the last QCborValue of this array. The array must not be empty.
QCborValueRef has the exact same API as QCborValue, with one important difference: if you assign new values to it, this map will be updated with that new value.
See also operator[](), at(), first(), insert(), prepend(), append(), removeAt(), and takeAt().
sourcepub unsafe fn new() -> CppBox<QCborArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn new() -> CppBox<QCborArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Constructs an empty QCborArray.
Calls C++ function: [constructor] void QCborArray::QCborArray()
.
Constructs an empty QCborArray.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QCborArray>>
) -> CppBox<QCborArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn new_copy( other: impl CastInto<Ref<QCborArray>> ) -> CppBox<QCborArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Copies the contents of other into this object.
Calls C++ function: [constructor] void QCborArray::QCborArray(const QCborArray& other)
.
Copies the contents of other into this object.
sourcepub unsafe fn pop_back(&self)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn pop_back(&self)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Synonym for removeLast(). This function is provided for compatibility with generic code that uses the Standard Library API.
Calls C++ function: void QCborArray::pop_back()
.
Synonym for removeLast(). This function is provided for compatibility with generic code that uses the Standard Library API.
Removes the last element of this array. The array must not be empty before the removal
See also removeLast(), takeLast(), pop_front(), push_back(), append(), and insert().
sourcepub unsafe fn pop_front(&self)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn pop_front(&self)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Synonym for removeFirst(). This function is provided for compatibility with generic code that uses the Standard Library API.
Calls C++ function: void QCborArray::pop_front()
.
Synonym for removeFirst(). This function is provided for compatibility with generic code that uses the Standard Library API.
Removes the first element of this array. The array must not be empty before the removal
See also removeFirst(), takeFirst(), pop_back(), push_front(), prepend(), and insert().
sourcepub unsafe fn prepend(&self, value: impl CastInto<Ref<QCborValue>>)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn prepend(&self, value: impl CastInto<Ref<QCborValue>>)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Calls C++ function: void QCborArray::prepend(const QCborValue& value)
.
sourcepub unsafe fn push_back(&self, t: impl CastInto<Ref<QCborValue>>)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn push_back(&self, t: impl CastInto<Ref<QCborValue>>)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Synonym for append(). This function is provided for compatibility with generic code that uses the Standard Library API.
Calls C++ function: void QCborArray::push_back(const QCborValue& t)
.
sourcepub unsafe fn push_front(&self, t: impl CastInto<Ref<QCborValue>>)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn push_front(&self, t: impl CastInto<Ref<QCborValue>>)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Synonym for prepend(). This function is provided for compatibility with generic code that uses the Standard Library API.
Calls C++ function: void QCborArray::push_front(const QCborValue& t)
.
sourcepub unsafe fn remove_at(&self, i: c_longlong)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn remove_at(&self, i: c_longlong)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Removes the item at position i from the array. The array must have more than i elements before the removal.
Calls C++ function: void QCborArray::removeAt(long long i)
.
Removes the item at position i from the array. The array must have more than i elements before the removal.
See also takeAt(), removeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().
sourcepub unsafe fn remove_first(&self)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn remove_first(&self)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Removes the first item in the array, making the second element become the first. The array must not be empty before this call.
Calls C++ function: void QCborArray::removeFirst()
.
Removes the first item in the array, making the second element become the first. The array must not be empty before this call.
See also removeAt(), takeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().
sourcepub unsafe fn remove_last(&self)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn remove_last(&self)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Removes the last item in the array. The array must not be empty before this call.
Calls C++ function: void QCborArray::removeLast()
.
Removes the last item in the array. The array must not be empty before this call.
See also removeAt(), takeLast(), removeFirst(), at(), operator[](), insert(), prepend(), and append().
sourcepub unsafe fn size(&self) -> c_longlong
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn size(&self) -> c_longlong
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Returns the size of this array.
Calls C++ function: long long QCborArray::size() const
.
Returns the size of this array.
See also isEmpty().
sourcepub unsafe fn swap(&self, other: impl CastInto<Ref<QCborArray>>)
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn swap(&self, other: impl CastInto<Ref<QCborArray>>)
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Swaps the contents of this object and other.
Calls C++ function: void QCborArray::swap(QCborArray& other)
.
Swaps the contents of this object and other.
sourcepub unsafe fn take_at(&self, i: c_longlong) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn take_at(&self, i: c_longlong) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Removes the item at position i from the array and returns it. The array must have more than i elements before the removal.
Calls C++ function: QCborValue QCborArray::takeAt(long long i)
.
Removes the item at position i from the array and returns it. The array must have more than i elements before the removal.
See also removeAt(), removeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().
sourcepub unsafe fn take_first(&self) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn take_first(&self) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Removes the first item in the array and returns it, making the second element become the first. The array must not be empty before this call.
Calls C++ function: QCborValue QCborArray::takeFirst()
.
Removes the first item in the array and returns it, making the second element become the first. The array must not be empty before this call.
See also takeAt(), removeFirst(), removeLast(), at(), operator[](), insert(), prepend(), and append().
sourcepub unsafe fn take_last(&self) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn take_last(&self) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Removes the last item in the array and returns it. The array must not be empty before this call.
Calls C++ function: QCborValue QCborArray::takeLast()
.
Removes the last item in the array and returns it. The array must not be empty before this call.
See also takeAt(), removeLast(), removeFirst(), at(), operator[](), insert(), prepend(), and append().
sourcepub unsafe fn to_cbor_value(&self) -> CppBox<QCborValue>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn to_cbor_value(&self) -> CppBox<QCborValue>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Explicitly construcuts a QCborValue object that represents this array. This function is usually not necessary since QCborValue has a constructor for QCborArray, so the conversion is implicit.
Calls C++ function: QCborValue QCborArray::toCborValue() const
.
Explicitly construcuts a QCborValue object that represents this array. This function is usually not necessary since QCborValue has a constructor for QCborArray, so the conversion is implicit.
Converting QCborArray to QCborValue allows it to be used in any context where QCborValues can be used, including as items in QCborArrays and as keys and mapped types in QCborMap. Converting an array to QCborValue allows access to QCborValue::toCbor().
See also QCborValue::QCborValue(const QCborArray &).
sourcepub unsafe fn to_json_array(&self) -> CppBox<QJsonArray>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn to_json_array(&self) -> CppBox<QJsonArray>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Recursively converts every QCborValue element in this array to JSON using QCborValue::toJsonValue() and returns the corresponding QJsonArray composed of those elements.
Calls C++ function: QJsonArray QCborArray::toJsonArray() const
.
Recursively converts every QCborValue element in this array to JSON using QCborValue::toJsonValue() and returns the corresponding QJsonArray composed of those elements.
Please note that CBOR contains a richer and wider type set than JSON, so some information may be lost in this conversion. For more details on what conversions are applied, see QCborValue::toJsonValue().
See also fromJsonArray(), QCborValue::toJsonValue(), QCborMap::toJsonObject(), and toVariantList().
sourcepub unsafe fn to_variant_list(&self) -> CppBox<QListOfQVariant>
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
pub unsafe fn to_variant_list(&self) -> CppBox<QListOfQVariant>
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.Recursively converts each QCborValue in this array using QCborValue::toVariant() and returns the QVariantList composed of the converted items.
Calls C++ function: QList<QVariant> QCborArray::toVariantList() const
.
Recursively converts each QCborValue in this array using QCborValue::toVariant() and returns the QVariantList composed of the converted items.
Conversion to QVariant is not completely lossless. Please see the documentation in QCborValue::toVariant() for more information.
See also fromVariantList(), fromStringList(), toJsonArray(), QCborValue::toVariant(), and QCborMap::toVariantMap().
Trait Implementations§
source§impl Add<Ref<QCborValue>> for &QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl Add<Ref<QCborValue>> for &QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§fn add(self, v: Ref<QCborValue>) -> CppBox<QCborArray>
fn add(self, v: Ref<QCborValue>) -> CppBox<QCborArray>
Returns a new QCborArray containing the same elements as this array, plus v appended as the last element.
Calls C++ function: QCborArray QCborArray::operator+(const QCborValue& v) const
.
Returns a new QCborArray containing the same elements as this array, plus v appended as the last element.
See also operator+=(), operator<<(), and append().
§type Output = CppBox<QCborArray>
type Output = CppBox<QCborArray>
+
operator.source§impl Begin for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl Begin for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§unsafe fn begin(&self) -> CppBox<ConstIterator>
unsafe fn begin(&self) -> CppBox<ConstIterator>
Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
Calls C++ function: QCborArray::ConstIterator QCborArray::begin() const
.
Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
See also constBegin() and constEnd().
§type Output = CppBox<ConstIterator>
type Output = CppBox<ConstIterator>
source§impl BeginMut for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl BeginMut for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§unsafe fn begin_mut(&self) -> CppBox<Iterator>
unsafe fn begin_mut(&self) -> CppBox<Iterator>
Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
Calls C++ function: QCborArray::Iterator QCborArray::begin()
.
Returns an array iterator pointing to the first item in this array. If the array is empty, then this function returns the same as end().
See also constBegin() and end().
source§impl CppDeletable for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl CppDeletable for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys this QCborArray and frees any associated resources.
Calls C++ function: [destructor] void QCborArray::~QCborArray()
.
Destroys this QCborArray and frees any associated resources.
source§impl End for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl End for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§unsafe fn end(&self) -> CppBox<ConstIterator>
unsafe fn end(&self) -> CppBox<ConstIterator>
Returns an array iterator pointing to just after the last element in this array.
Calls C++ function: QCborArray::ConstIterator QCborArray::end() const
.
Returns an array iterator pointing to just after the last element in this array.
See also constBegin() and constEnd().
§type Output = CppBox<ConstIterator>
type Output = CppBox<ConstIterator>
source§impl EndMut for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl EndMut for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§impl Lt<Ref<QCborArray>> for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl Lt<Ref<QCborArray>> for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§unsafe fn lt(&self, other: &Ref<QCborArray>) -> bool
unsafe fn lt(&self, other: &Ref<QCborArray>) -> bool
Compares this array and other, comparing each element in sequence, and returns true if this array should be sorted before other, false otherwise.
Calls C++ function: bool QCborArray::operator<(const QCborArray& other) const
.
Compares this array and other, comparing each element in sequence, and returns true if this array should be sorted before other, false otherwise.
For more information on CBOR sorting order, see QCborValue::compare().
See also compare(), QCborValue::operator==(), QCborMap::operator==(), operator==(), and operator!=().
source§impl PartialEq<Ref<QCborArray>> for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl PartialEq<Ref<QCborArray>> for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§fn eq(&self, other: &Ref<QCborArray>) -> bool
fn eq(&self, other: &Ref<QCborArray>) -> bool
Compares this array and other, comparing each element in sequence, and returns true if both arrays contains the same elements, false otherwise.
Calls C++ function: bool QCborArray::operator==(const QCborArray& other) const
.
Compares this array and other, comparing each element in sequence, and returns true if both arrays contains the same elements, false otherwise.
For more information on CBOR equality in Qt, see, QCborValue::compare().
See also compare(), QCborValue::operator==(), QCborMap::operator==(), operator!=(), and operator<().
source§impl Shl<Ref<QCborValue>> for &QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl Shl<Ref<QCborValue>> for &QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.source§fn shl(self, v: Ref<QCborValue>) -> Ref<QCborArray>
fn shl(self, v: Ref<QCborValue>) -> Ref<QCborArray>
Appends v to this array and returns a reference to this array.
Calls C++ function: QCborArray& QCborArray::operator<<(const QCborValue& v)
.
Appends v to this array and returns a reference to this array.
See also append(), insert(), operator+(), and operator+=().
§type Output = Ref<QCborArray>
type Output = Ref<QCborArray>
<<
operator.source§impl Size for QCborArray
Available on cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.
impl Size for QCborArray
cpp_lib_version="5.12.2"
or cpp_lib_version="5.13.0"
or cpp_lib_version="5.14.0"
only.