<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qndefmessage.cpp --> <title>QNdefMessage Class | Qt NFC 5.11</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td ><a href="../qtdoc/index.html">Qt 5.11</a></td><td ><a href="qtnfc-index.html">Qt NFC</a></td><td ><a href="qtnfc-module.html">C++ Classes</a></td><td >QNdefMessage</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.11.2 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QNdefMessage Class</h1> <!-- $$$QNdefMessage-brief --> <p>The <a href="qndefmessage.html">QNdefMessage</a> class provides an NFC NDEF message. <a href="#details">More...</a></p> <!-- @@@QNdefMessage --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QNdefMessage></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += nfc</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.2</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qlist.html">QList</a></td></tr></table></div><ul> <li><a href="qndefmessage-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qndefmessage.html#QNdefMessage">QNdefMessage</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qndefmessage.html#QNdefMessage-1">QNdefMessage</a></b>(const QNdefRecord &<i>record</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qndefmessage.html#QNdefMessage-2">QNdefMessage</a></b>(const QNdefMessage &<i>message</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qndefmessage.html#QNdefMessage-3">QNdefMessage</a></b>(const QList<QNdefRecord> &<i>records</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qndefmessage.html#toByteArray">toByteArray</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qndefmessage.html#operator-eq-eq">operator==</a></b>(const QNdefMessage &<i>other</i>) const</td></tr> </table></div> <ul> <li class="fn">78 public functions inherited from <a href="../qtcore/qlist.html#public-functions">QList</a></li> </ul> <a name="static-public-members"></a> <h2 id="static-public-members">Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QNdefMessage </td><td class="memItemRight bottomAlign"><b><a href="qndefmessage.html#fromByteArray">fromByteArray</a></b>(const QByteArray &<i>message</i>)</td></tr> </table></div> <ul> <li class="fn">3 static public members inherited from <a href="../qtcore/qlist.html#static-public-members">QList</a></li> </ul> <a name="details"></a> <!-- $$$QNdefMessage-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qndefmessage.html">QNdefMessage</a> class provides an NFC NDEF message.</p> <p>A <a href="qndefmessage.html">QNdefMessage</a> is a collection of 0 or more QNdefRecords. <a href="qndefmessage.html">QNdefMessage</a> inherits from <a href="../qtcore/qlist.html">QList</a><<a href="qndefrecord.html">QNdefRecord</a>> and therefore the standard <a href="../qtcore/qlist.html">QList</a> functions can be used to manipulate the NDEF records in the message.</p> <p>NDEF messages can be parsed from a byte array conforming to the NFC Data Exchange Format technical specification by using the <a href="qndefmessage.html#fromByteArray">fromByteArray</a>() static function. Conversely QNdefMessages can be converted into a byte array with the <a href="qndefmessage.html#toByteArray">toByteArray</a>() function.</p> </div> <!-- @@@QNdefMessage --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QNdefMessage[overload1]$$$QNdefMessage --> <h3 class="fn" id="QNdefMessage"><a name="QNdefMessage"></a>QNdefMessage::<span class="name">QNdefMessage</span>()</h3> <p>Constructs a new empty NDEF message.</p> <!-- @@@QNdefMessage --> <!-- $$$QNdefMessage$$$QNdefMessageconstQNdefRecord& --> <h3 class="fn" id="QNdefMessage-1"><a name="QNdefMessage-1"></a>QNdefMessage::<span class="name">QNdefMessage</span>(const <span class="type"><a href="qndefrecord.html">QNdefRecord</a></span> &<i>record</i>)</h3> <p>Constructs a new NDEF message containing a single record <i>record</i>.</p> <!-- @@@QNdefMessage --> <!-- $$$QNdefMessage$$$QNdefMessageconstQNdefMessage& --> <h3 class="fn" id="QNdefMessage-2"><a name="QNdefMessage-2"></a>QNdefMessage::<span class="name">QNdefMessage</span>(const <span class="type"><a href="qndefmessage.html#QNdefMessage">QNdefMessage</a></span> &<i>message</i>)</h3> <p>Constructs a new NDEF message that is a copy of <i>message</i>.</p> <!-- @@@QNdefMessage --> <!-- $$$QNdefMessage$$$QNdefMessageconstQList<QNdefRecord>& --> <h3 class="fn" id="QNdefMessage-3"><a name="QNdefMessage-3"></a>QNdefMessage::<span class="name">QNdefMessage</span>(const <span class="type"><a href="../qtcore/qlist.html#QList">QList</a></span><<span class="type"><a href="qndefrecord.html">QNdefRecord</a></span>> &<i>records</i>)</h3> <p>Constructs a new NDEF message that contains all of the records in <i>records</i>.</p> <!-- @@@QNdefMessage --> <!-- $$$fromByteArray[overload1]$$$fromByteArrayconstQByteArray& --> <h3 class="fn" id="fromByteArray"><a name="fromByteArray"></a><code>[static] </code><span class="type"><a href="qndefmessage.html#QNdefMessage">QNdefMessage</a></span> QNdefMessage::<span class="name">fromByteArray</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &<i>message</i>)</h3> <p>Returns an NDEF message parsed from the contents of <i>message</i>.</p> <p>The <i>message</i> parameter is interpreted as the raw message format defined in the NFC Data Exchange Format technical specification.</p> <p>If a parse error occurs an empty NDEF message is returned.</p> <!-- @@@fromByteArray --> <!-- $$$toByteArray[overload1]$$$toByteArray --> <h3 class="fn" id="toByteArray"><a name="toByteArray"></a><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QNdefMessage::<span class="name">toByteArray</span>() const</h3> <p>Returns the NDEF message as a byte array.</p> <p>The return value of this function conforms to the format defined in the NFC Data Exchange Format technical specification.</p> <!-- @@@toByteArray --> <!-- $$$operator==[overload1]$$$operator==constQNdefMessage& --> <h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QNdefMessage::<span class="name">operator==</span>(const <span class="type"><a href="qndefmessage.html#QNdefMessage">QNdefMessage</a></span> &<i>other</i>) const</h3> <p>Returns true if this NDEF message is equivalent to <i>other</i>; otherwise returns false.</p> <p>An empty message (i.e. <a href="../qtcore/qlist.html#isEmpty">isEmpty</a>() returns true) is equivalent to a NDEF message containing a single record of type <a href="qndefrecord.html#TypeNameFormat-enum">QNdefRecord::Empty</a>.</p> <!-- @@@operator== --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>