Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 783

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qcborstream.cpp -->
  <title>&lt;QtCborCommon&gt; | Qt Core 5.12.6</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 >Qt 5.12</td><td ><a href="qtcore-index.html">Qt Core</a></td><td >&lt;QtCborCommon&gt;</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtcore-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">&lt;QtCborCommon&gt;</h1>
<span class="subtitle"></span>
<!-- $$$<QtCborCommon>-brief -->
<p>The &lt;QtCborCommon&gt; header contains definitions common to both the streaming classes (<a href="qcborstreamreader.html">QCborStreamReader</a> and <a href="qcborstreamwriter.html">QCborStreamWriter</a>) and to <a href="qcborvalue.html">QCborValue</a>. <a href="#details">More...</a></p>
<!-- @@@<QtCborCommon> -->
<ul>
</ul>
<a name="Classes"></a>
<h2 id="Classes">Classes</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qtcborcommon.html">QCborError</a></b></td></tr>
</table></div>
<a name="Types"></a>
<h2 id="Types">Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtcborcommon.html#QCborKnownTags-enum">QCborKnownTags</a></b> { DateTimeString, UnixTime_t, PositiveBignum, NegativeBignum, ..., Signature }</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtcborcommon.html#QCborSimpleType-enum">QCborSimpleType</a></b> { False, True, Null, Undefined }</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qtcborcommon.html#QCborTag-enum">QCborTag</a></b> { }</td></tr>
</table></div>
<!-- $$$<QtCborCommon>-description -->
<div class="descr"> <a name="details"></a>
</div>
<!-- @@@<QtCborCommon> -->
<h2>Classes</h2>
<!-- $$$QCborError -->
<h3 class="fn" id=""><a name=""></a>class <span class="name">QCborError</span></h3>
<p>The <a href="qtcborcommon.html">QCborError</a> class holds the error condition found while parsing or validating a CBOR stream.</p>
<p><b>Note:</b> All functions in this class are reentrant.</p>
<p>This class was introduced in  Qt 5.12.</p>
<p><b>See also </b><a href="qcborstreamreader.html">QCborStreamReader</a>, <a href="qcborvalue.html">QCborValue</a>, and <a href="qcborparsererror.html">QCborParserError</a>.</p>
<!-- @@@QCborError -->
<h2>Type Documentation</h2>
<!-- $$$QCborKnownTags$$$DateTimeString$$$UnixTime_t$$$PositiveBignum$$$NegativeBignum$$$Decimal$$$Bigfloat$$$COSE_Encrypt0$$$COSE_Mac0$$$COSE_Sign1$$$ExpectedBase64url$$$ExpectedBase64$$$ExpectedBase16$$$EncodedCbor$$$Url$$$Base64url$$$Base64$$$RegularExpression$$$MimeMessage$$$Uuid$$$COSE_Encrypt$$$COSE_Mac$$$COSE_Sign$$$Signature -->
<h3 class="fn" id="QCborKnownTags-enum"><a name="QCborKnownTags-enum"></a>enum <span class="name">QCborKnownTags</span></h3>
<p>This enum contains a list of CBOR tags, known at the time of the Qt implementation. This list is not meant to be complete and contains only tags that are either backed by an RFC or specifically used by the Qt implementation.</p>
<p>The authoritative list is maintained by IANA in the <a href="https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml">CBOR tag registry</a>.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>DateTimeString</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">A date and time string, formatted according to RFC 3339, as refined by RFC 4287. It is the same format as <a href="qt.html#DateFormat-enum">Qt::ISODate</a> and <a href="qt.html#DateFormat-enum">Qt::ISODateWithMs</a>.</td></tr>
<tr><td class="topAlign"><code>UnixTime_t</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">A numerical representation of seconds elapsed since 1970-01-01T00:00Z.</td></tr>
<tr><td class="topAlign"><code>PositiveBignum</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">A positive number of arbitrary length, encoded as a byte array in network byte order. For example, the number 2<sup>64</sup> is represented by a byte array containing the byte value 0x01 followed by 8 zero bytes.</td></tr>
<tr><td class="topAlign"><code>NegativeBignum</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">A negative number of arbirary length, encoded as the absolute value of that number, minus one. For example, a byte array containing byte value 0x02 followed by 8 zero bytes represents the number -2<sup>65</sup> - 1.</td></tr>
<tr><td class="topAlign"><code>Decimal</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">A decimal fraction, encoded as an array of two integers: the first is the exponent of the power of 10, the second the integral mantissa. The value 273.15 would be encoded as array <code>[-2, 27315]</code>.</td></tr>
<tr><td class="topAlign"><code>Bigfloat</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">Similar to Decimal, but the exponent is a power of 2 instead.</td></tr>
<tr><td class="topAlign"><code>COSE_Encrypt0</code></td><td class="topAlign tblval"><code>16</code></td><td class="topAlign">An <code>Encrypt0</code> map as specified by <a href="https://tools.ietf.org/html/rfc8152">RFC 8152</a> (CBOR Object Signing and Encryption).</td></tr>
<tr><td class="topAlign"><code>COSE_Mac0</code></td><td class="topAlign tblval"><code>17</code></td><td class="topAlign">A <code>Mac0</code> map as specified by <a href="https://tools.ietf.org/html/rfc8152">RFC 8152</a> (CBOR Object Signing and Encryption).</td></tr>
<tr><td class="topAlign"><code>COSE_Sign1</code></td><td class="topAlign tblval"><code>18</code></td><td class="topAlign">A <code>Sign1</code> map as specified by <a href="https://tools.ietf.org/html/rfc8152">RFC 8152</a> (CBOR Object Signing and Encryption).</td></tr>
<tr><td class="topAlign"><code>ExpectedBase64url</code></td><td class="topAlign tblval"><code>21</code></td><td class="topAlign">Indicates that the byte array should be encoded using Base64url if the stream is converted to JSON.</td></tr>
<tr><td class="topAlign"><code>ExpectedBase64</code></td><td class="topAlign tblval"><code>22</code></td><td class="topAlign">Indicates that the byte array should be encoded using Base64 if the stream is converted to JSON.</td></tr>
<tr><td class="topAlign"><code>ExpectedBase16</code></td><td class="topAlign tblval"><code>23</code></td><td class="topAlign">Indicates that the byte array should be encoded using Base16 (hex) if the stream is converted to JSON.</td></tr>
<tr><td class="topAlign"><code>EncodedCbor</code></td><td class="topAlign tblval"><code>24</code></td><td class="topAlign">Indicates that the byte array contains a CBOR stream.</td></tr>
<tr><td class="topAlign"><code>Url</code></td><td class="topAlign tblval"><code>32</code></td><td class="topAlign">Indicates that the string contains a URL.</td></tr>
<tr><td class="topAlign"><code>Base64url</code></td><td class="topAlign tblval"><code>33</code></td><td class="topAlign">Indicates that the string contains data encoded using Base64url.</td></tr>
<tr><td class="topAlign"><code>Base64</code></td><td class="topAlign tblval"><code>34</code></td><td class="topAlign">Indicates that the string contains data encoded using Base64.</td></tr>
<tr><td class="topAlign"><code>RegularExpression</code></td><td class="topAlign tblval"><code>35</code></td><td class="topAlign">Indicates that the string contains a Perl-Compatible Regular Expression pattern.</td></tr>
<tr><td class="topAlign"><code>MimeMessage</code></td><td class="topAlign tblval"><code>36</code></td><td class="topAlign">Indicates that the string contains a MIME message (according to <a href="https://tools.ietf.org/html/rfc2045">https://tools.ietf.org/html/rfc2045</a>){RFC 2045}.</td></tr>
<tr><td class="topAlign"><code>Uuid</code></td><td class="topAlign tblval"><code>37</code></td><td class="topAlign">Indicates that the byte array contains a UUID.</td></tr>
<tr><td class="topAlign"><code>COSE_Encrypt</code></td><td class="topAlign tblval"><code>96</code></td><td class="topAlign">An <code>Encrypt</code> map as specified by <a href="https://tools.ietf.org/html/rfc8152">RFC 8152</a> (CBOR Object Signing and Encryption).</td></tr>
<tr><td class="topAlign"><code>COSE_Mac</code></td><td class="topAlign tblval"><code>97</code></td><td class="topAlign">A <code>Mac</code> map as specified by <a href="https://tools.ietf.org/html/rfc8152">RFC 8152</a> (CBOR Object Signing and Encryption).</td></tr>
<tr><td class="topAlign"><code>COSE_Sign</code></td><td class="topAlign tblval"><code>98</code></td><td class="topAlign">A <code>Sign</code> map as specified by <a href="https://tools.ietf.org/html/rfc8152">RFC 8152</a> (CBOR Object Signing and Encryption).</td></tr>
<tr><td class="topAlign"><code>Signature</code></td><td class="topAlign tblval"><code>55799</code></td><td class="topAlign">No change in interpretation; this tag can be used as the outermost tag in a CBOR stream as the file header.</td></tr>
</table></div>
<p>The following tags are interpreted by <a href="qcborvalue.html">QCborValue</a> during decoding and will produce objects with extended Qt types, and it will use those tags when encoding the same extended types.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>DateTimeString</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign"><a href="qdatetime.html">QDateTime</a></td></tr>
<tr><td class="topAlign"><code>UnixTime_t</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign"><a href="qdatetime.html">QDateTime</a> (only in decoding)</td></tr>
<tr><td class="topAlign"><code>Url</code></td><td class="topAlign tblval"><code>32</code></td><td class="topAlign"><a href="qurl.html">QUrl</a></td></tr>
<tr><td class="topAlign"><code>Uuid</code></td><td class="topAlign tblval"><code>37</code></td><td class="topAlign"><a href="quuid.html">QUuid</a></td></tr>
</table></div>
<p>Additionally, if a <a href="qcborvalue.html">QCborValue</a> containing a <a href="qbytearray.html">QByteArray</a> is tagged using one of <code>ExpectedBase64url</code>, <code>ExpectedBase64</code> or <code>ExpectedBase16</code>, <a href="qcborvalue.html">QCborValue</a> will use the expected encoding when converting to JSON (see <a href="qcborvalue.html#toJsonValue">QCborValue::toJsonValue</a>).</p>
<p><b>See also </b><a href="qtcborcommon.html#QCborTag-enum">QCborTag</a>, <a href="qcborstreamwriter.html#append-6">QCborStreamWriter::append</a>(QCborTag), <a href="qcborstreamreader.html#isTag">QCborStreamReader::isTag</a>(), <a href="qcborstreamreader.html#toTag">QCborStreamReader::toTag</a>(), <a href="qcborvalue.html#isTag">QCborValue::isTag</a>(), and <a href="qcborvalue.html#tag">QCborValue::tag</a>().</p>
<!-- @@@QCborKnownTags -->
<!-- $$$QCborSimpleType -->
<h3 class="fn" id="QCborSimpleType-enum"><a name="QCborSimpleType-enum"></a>enum <span class="name">QCborSimpleType</span></h3>
<p>This enum contains the possible &quot;Simple Types&quot; for CBOR. Simple Types range from 0 to 255 and are types that carry no further value.</p>
<p>The following values are currently known:</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>False</code></td><td class="topAlign tblval">?</td><td class="topAlign">A &quot;false&quot; boolean.</td></tr>
<tr><td class="topAlign"><code>True</code></td><td class="topAlign tblval">?</td><td class="topAlign">A &quot;true&quot; boolean.</td></tr>
<tr><td class="topAlign"><code>Null</code></td><td class="topAlign tblval">?</td><td class="topAlign">Absence of value (null).</td></tr>
<tr><td class="topAlign"><code>Undefined</code></td><td class="topAlign tblval">?</td><td class="topAlign">Missing or deleted value, usually an error.</td></tr>
</table></div>
<p>Qt CBOR API supports encoding and decoding any Simple Type, whether one of those above or any other value.</p>
<p>Applications should only use further values if a corresponding specification has been published, otherwise interpretation and validation by the remote may fail. Values 24 to 31 are reserved and must not be used.</p>
<p>The current authoritative list is maintained by IANA in the <a href="https://www.iana.org/assignments/cbor-simple-values/cbor-simple-values.xml">Simple Values registry</a>.</p>
<p><b>See also </b><a href="qcborstreamwriter.html#append-8">QCborStreamWriter::append</a>(QCborSimpleType), <a href="qcborstreamreader.html#isSimpleType">QCborStreamReader::isSimpleType</a>(), <a href="qcborstreamreader.html#toSimpleType">QCborStreamReader::toSimpleType</a>(), <a href="qcborvalue.html#isSimpleType">QCborValue::isSimpleType</a>(), and <a href="qcborvalue.html#toSimpleType">QCborValue::toSimpleType</a>().</p>
<!-- @@@QCborSimpleType -->
<!-- $$$QCborTag -->
<h3 class="fn" id="QCborTag-enum"><a name="QCborTag-enum"></a>enum <span class="name">QCborTag</span></h3>
<p>This enum contains no enumeration and is used only to provide type-safe access to a CBOR tag.</p>
<p>CBOR tags are 64-bit numbers that are attached to generic CBOR types to provide further semantic meaning. QCborTag may be constructed from an enumeration found in <a href="qtcborcommon.html#QCborKnownTags-enum">QCborKnownTags</a> or directly by providing the numeric representation.</p>
<p>For example, the following creates a <a href="qcborvalue.html">QCborValue</a> containing a byte array tagged with a tag 2.</p>
<pre class="cpp">

     <span class="type"><a href="qcborvalue.html">QCborValue</a></span>(<span class="type">QCborTag</span>(<span class="number">2</span>)<span class="operator">,</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;\x01\0\0\0\0\0\0\0\0&quot;</span><span class="operator">,</span> <span class="number">9</span>));

</pre>
<p><b>See also </b><a href="qtcborcommon.html#QCborKnownTags-enum">QCborKnownTags</a>, <a href="qcborstreamwriter.html#append-6">QCborStreamWriter::append</a>(QCborTag), <a href="qcborstreamreader.html#isTag">QCborStreamReader::isTag</a>(), <a href="qcborstreamreader.html#toTag">QCborStreamReader::toTag</a>(), <a href="qcborvalue.html#isTag">QCborValue::isTag</a>(), and <a href="qcborvalue.html#tag">QCborValue::tag</a>().</p>
<!-- @@@QCborTag -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>