![]() |
Qt 6.x
The Qt SDK
|
The QNdefMessage class provides an NFC NDEF message. More...
#include <qndefmessage.h>
Public Member Functions | |
Q_NFC_EXPORT_COMPAT | QNdefMessage ()=default |
Constructs a new empty NDEF message. | |
Q_NFC_EXPORT_COMPAT | QNdefMessage (const QNdefRecord &record) |
Constructs a new NDEF message containing a single record record. | |
Q_NFC_EXPORT_COMPAT | QNdefMessage (const QNdefMessage &message)=default |
Constructs a new NDEF message that is a copy of message. | |
Q_NFC_EXPORT_COMPAT | QNdefMessage (const QList< QNdefRecord > &records) |
Constructs a new NDEF message that contains all of the records in records. | |
Q_NFC_EXPORT_COMPAT QNdefMessage & | operator= (const QNdefMessage &other)=default |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Q_NFC_EXPORT_COMPAT QNdefMessage & | operator= (QNdefMessage &&other) noexcept=default |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Q_NFC_EXPORT bool | operator== (const QNdefMessage &other) const |
Returns true if this NDEF message is equivalent to other; otherwise returns false . | |
Q_NFC_EXPORT QByteArray | toByteArray () const |
Returns the NDEF message as a byte array. | |
![]() | |
QList (DataPointer dd) noexcept | |
QList ()=default | |
QList (qsizetype size) | |
QList (qsizetype size, parameter_type t) | |
QList (std::initializer_list< QNdefRecord > args) | |
QList (InputIterator i1, InputIterator i2) | |
QList (const String &str) | |
QList< QNdefRecord > & | operator= (std::initializer_list< QNdefRecord > args) |
void | swap (QList &other) noexcept |
QTypeTraits::compare_eq_result_container< QList, U > | operator== (const QList &other) const |
QTypeTraits::compare_eq_result_container< QList, U > | operator!= (const QList &other) const |
QTypeTraits::compare_lt_result_container< QList, U > | operator< (const QList &other) const noexcept(noexcept(std::lexicographical_compare< typename QList< U >::const_iterator, typename QList::const_iterator >(std::declval< QList< U > >().begin(), std::declval< QList< U > >().end(), other.begin(), other.end()))) |
QTypeTraits::compare_lt_result_container< QList, U > | operator> (const QList &other) const noexcept(noexcept(other< std::declval< QList< U > >())) |
QTypeTraits::compare_lt_result_container< QList, U > | operator<= (const QList &other) const noexcept(noexcept(other< std::declval< QList< U > >())) |
QTypeTraits::compare_lt_result_container< QList, U > | operator>= (const QList &other) const noexcept(noexcept(std::declval< QList< U > >()< other)) |
qsizetype | size () const noexcept |
qsizetype | count () const noexcept |
qsizetype | count (const AT &t) const noexcept |
qsizetype | length () const noexcept |
bool | isEmpty () const noexcept |
void | resize (qsizetype size) |
void | resize (qsizetype size, parameter_type c) |
qsizetype | capacity () const |
void | reserve (qsizetype size) |
void | squeeze () |
void | detach () |
bool | isDetached () const noexcept |
bool | isSharedWith (const QList< QNdefRecord > &other) const |
pointer | data () |
const_pointer | data () const noexcept |
const_pointer | constData () const noexcept |
void | clear () |
const_reference | at (qsizetype i) const noexcept |
reference | operator[] (qsizetype i) |
const_reference | operator[] (qsizetype i) const noexcept |
void | append (parameter_type t) |
void | append (const_iterator i1, const_iterator i2) |
void | append (rvalue_ref t) |
void | append (const QList< QNdefRecord > &l) |
void | append (QList< QNdefRecord > &&l) |
void | prepend (rvalue_ref t) |
void | prepend (parameter_type t) |
reference | emplaceBack (Args &&... args) |
reference | emplaceFront (Args &&... args) |
iterator | insert (qsizetype i, parameter_type t) |
iterator | insert (qsizetype i, qsizetype n, parameter_type t) |
iterator | insert (const_iterator before, parameter_type t) |
iterator | insert (const_iterator before, qsizetype n, parameter_type t) |
iterator | insert (const_iterator before, rvalue_ref t) |
iterator | insert (qsizetype i, rvalue_ref t) |
QList & | assign (qsizetype n, parameter_type t) |
QList & | assign (InputIterator first, InputIterator last) |
QList & | assign (std::initializer_list< QNdefRecord > l) |
iterator | emplace (const_iterator before, Args &&... args) |
iterator | emplace (qsizetype i, Args &&... args) |
void | replace (qsizetype i, parameter_type t) |
void | replace (qsizetype i, rvalue_ref t) |
void | remove (qsizetype i, qsizetype n=1) |
void | removeFirst () noexcept |
void | removeLast () noexcept |
value_type | takeFirst () |
value_type | takeLast () |
QList< QNdefRecord > & | fill (parameter_type t, qsizetype size=-1) |
void | removeAt (qsizetype i) |
qsizetype | removeAll (const AT &t) |
bool | removeOne (const AT &t) |
qsizetype | removeIf (Predicate pred) |
QNdefRecord | takeAt (qsizetype i) |
void | move (qsizetype from, qsizetype to) |
iterator | begin () |
const_iterator | begin () const noexcept |
iterator | end () |
const_iterator | end () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
const_iterator | constBegin () const noexcept |
const_iterator | constEnd () const noexcept |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const noexcept |
reverse_iterator | rend () |
const_reverse_iterator | rend () const noexcept |
const_reverse_iterator | crbegin () const noexcept |
const_reverse_iterator | crend () const noexcept |
iterator | erase (const_iterator begin, const_iterator end) |
iterator | erase (const_iterator pos) |
QNdefRecord & | first () |
const QNdefRecord & | first () const noexcept |
QList< QNdefRecord > | first (qsizetype n) const |
const QNdefRecord & | constFirst () const noexcept |
QNdefRecord & | last () |
const QNdefRecord & | last () const noexcept |
QList< QNdefRecord > | last (qsizetype n) const |
const QNdefRecord & | constLast () const noexcept |
bool | startsWith (parameter_type t) const |
bool | endsWith (parameter_type t) const |
QList< QNdefRecord > | mid (qsizetype pos, qsizetype len=-1) const |
QList< QNdefRecord > | sliced (qsizetype pos) const |
QList< QNdefRecord > | sliced (qsizetype pos, qsizetype n) const |
QNdefRecord | value (qsizetype i) const |
QNdefRecord | value (qsizetype i, parameter_type defaultValue) const |
void | swapItemsAt (qsizetype i, qsizetype j) |
void | push_back (parameter_type t) |
void | push_back (rvalue_ref t) |
void | push_front (rvalue_ref t) |
void | push_front (parameter_type t) |
void | pop_back () noexcept |
void | pop_front () noexcept |
reference | emplace_back (Args &&... args) |
bool | empty () const noexcept |
reference | front () |
const_reference | front () const noexcept |
reference | back () |
const_reference | back () const noexcept |
void | shrink_to_fit () |
QList< QNdefRecord > & | operator+= (const QList< QNdefRecord > &l) |
QList< QNdefRecord > & | operator+= (QList< QNdefRecord > &&l) |
QList< QNdefRecord > & | operator+= (parameter_type t) |
QList< QNdefRecord > & | operator+= (rvalue_ref t) |
QList< QNdefRecord > | operator+ (const QList< QNdefRecord > &l) const & |
QList< QNdefRecord > | operator+ (const QList< QNdefRecord > &l) && |
QList< QNdefRecord > | operator+ (QList< QNdefRecord > &&l) const & |
QList< QNdefRecord > | operator+ (QList< QNdefRecord > &&l) && |
QList< QNdefRecord > & | operator<< (parameter_type t) |
QList< QNdefRecord > & | operator<< (const QList< QNdefRecord > &l) |
QList< QNdefRecord > & | operator<< (QList< QNdefRecord > &&l) |
QList< QNdefRecord > & | operator<< (rvalue_ref t) |
QList< QNdefRecord > | toList () const noexcept |
QList< QNdefRecord > | toVector () const noexcept |
![]() | |
template<typename AT = T> | |
qsizetype | indexOf (const AT &t, qsizetype from=0) const noexcept |
template<typename AT = T> | |
qsizetype | lastIndexOf (const AT &t, qsizetype from=-1) const noexcept |
template<typename AT = T> | |
bool | contains (const AT &t) const noexcept |
Static Public Member Functions | |
static Q_NFC_EXPORT QNdefMessage | fromByteArray (const QByteArray &message) |
Returns an NDEF message parsed from the contents of message. | |
![]() | |
static QList< QNdefRecord > | fromList (const QList< QNdefRecord > &list) noexcept |
static QList< QNdefRecord > | fromVector (const QList< QNdefRecord > &vector) noexcept |
static QList< QNdefRecord > | fromReadOnlyData (const QNdefRecord(&t)[N]) noexcept |
Additional Inherited Members | |
![]() | |
using | Type = QNdefRecord |
using | value_type = QNdefRecord |
using | pointer = QNdefRecord * |
using | const_pointer = const QNdefRecord * |
using | reference = QNdefRecord & |
using | const_reference = const QNdefRecord & |
using | size_type = qsizetype |
using | difference_type = qptrdiff |
using | parameter_type = typename DataPointer::parameter_type |
using | rvalue_ref = typename std::conditional< DataPointer::pass_parameter_by_value, DisableRValueRefs, QNdefRecord && >::type |
using | Iterator = iterator |
using | ConstIterator = const_iterator |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
![]() | |
using | Self = QList< T > |
![]() | |
~QListSpecialMethods ()=default | |
![]() | |
~QListSpecialMethodsBase ()=default | |
Self * | self () |
const Self * | self () const |
The QNdefMessage class provides an NFC NDEF message.
\inmodule QtNfc
A QNdefMessage is a collection of 0 or more QNdefRecords. QNdefMessage inherits from QList<QNdefRecord> and therefore the standard QList functions can be used to manipulate the NDEF records in the message.
NDEF messages can be parsed from a byte array conforming to the NFC Data Exchange Format technical specification by using the fromByteArray() static function. Conversely QNdefMessages can be converted into a byte array with the toByteArray() function.
Definition at line 22 of file qndefmessage.h.
|
default |
Constructs a new empty NDEF message.
Referenced by toByteArray().
|
inlineexplicit |
Constructs a new NDEF message containing a single record record.
Definition at line 28 of file qndefmessage.h.
References QList< QNdefRecord >::append(), and record().
|
default |
Constructs a new NDEF message that is a copy of message.
|
inline |
Constructs a new NDEF message that contains all of the records in records.
Definition at line 32 of file qndefmessage.h.
|
static |
Returns an NDEF message parsed from the contents of message.
The message parameter is interpreted as the raw message format defined in the NFC Data Exchange Format technical specification.
If a parse error occurs an empty NDEF message is returned.
Definition at line 60 of file qndefmessage.cpp.
References QByteArray::append(), QByteArray::clear(), QByteArray::isEmpty(), qWarning, and record().
Referenced by QNfcTagType4NdefFsm::getMessage(), QNearFieldTargetPrivateImpl::readNdefMessages(), and QNdefNfcSmartPosterRecord::setPayload().
|
default |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Copy assignment operator from QList<QNdefRecord>. Assigns the other list of NDEF records to this NDEF record list.
After the operation, other and *this
will be equal.
|
defaultnoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Move assignment operator from QList<QNdefRecord>. Moves the other list of NDEF records to this NDEF record list.
After the operation, other will be empty.
bool QNdefMessage::operator== | ( | const QNdefMessage & | other | ) | const |
Returns true
if this NDEF message is equivalent to other; otherwise returns false
.
An empty message (i.e. isEmpty() returns true
) is equivalent to a NDEF message containing a single record of type \l QNdefRecord::Empty.
Definition at line 241 of file qndefmessage.cpp.
References at, QNdefRecord::Empty, QList< QNdefRecord >::first(), i, QList< QNdefRecord >::isEmpty(), other(), and QList< QNdefRecord >::size().
QByteArray QNdefMessage::toByteArray | ( | ) | const |
Returns the NDEF message as a byte array.
The return value of this function conforms to the format defined in the NFC Data Exchange Format technical specification.
Definition at line 270 of file qndefmessage.cpp.
References QNdefMessage(), at, i, QList< QNdefRecord >::isEmpty(), record(), and QList< QNdefRecord >::size().