This file is indexed.

/usr/share/qt5/doc/qtversit/qversitwriter.html is in qtpim5-doc-html 5.0~git20140515~29475884-0ubuntu24~7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qversitwriter.cpp -->
  <title>QVersitWriter Class | Qt 5.0</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.0</td><td >QVersitWriter</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.0.0 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-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</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">QVersitWriter Class</h1>
<!-- $$$QVersitWriter-brief -->
<p>The <a href="qversitwriter.html">QVersitWriter</a> class writes Versit documents such as vCards to a device. <a href="#details">More...</a></p>
<!-- @@@QVersitWriter -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QVersitWriter&gt;</span>
</td></tr></table></div><ul>
<li><a href="qversitwriter-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#Error-enum">Error</a></b> { NoError, UnspecifiedError, IOError, OutOfMemoryError, NotReadyError }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#State-enum">State</a></b> { InactiveState, ActiveState, CanceledState, FinishedState }</td></tr>
</table></div>
<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="qversitwriter.html#QVersitWriter">QVersitWriter</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#QVersitWriter-1">QVersitWriter</a></b>(QIODevice *<i>outputDevice</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#QVersitWriter-2">QVersitWriter</a></b>(QByteArray *<i>outputBytes</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#dtor.QVersitWriter">~QVersitWriter</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCodec *</td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#defaultCodec">defaultCodec</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIODevice *</td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#device">device</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Error </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#error">error</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#setDefaultCodec">setDefaultCodec</a></b>(QTextCodec *<i>codec</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#setDevice">setDevice</a></b>(QIODevice *<i>device</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> State </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#state">state</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#waitForFinished">waitForFinished</a></b>(int <i>msec</i> = -1)</td></tr>
</table></div>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#cancel">cancel</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#startWriting">startWriting</a></b>(const QList&lt;QVersitDocument&gt; &amp;<i>input</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#startWriting-1">startWriting</a></b>(const QList&lt;QVersitDocument&gt; &amp;<i>input</i>, QVersitDocument::VersitType <i>type</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#startWriting-2">startWriting</a></b>(const QVersitDocument &amp;<i>input</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#startWriting-3">startWriting</a></b>(const QVersitDocument &amp;<i>input</i>, QVersitDocument::VersitType <i>type</i>)</td></tr>
</table></div>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qversitwriter.html#stateChanged">stateChanged</a></b>(QVersitWriter::State <i>state</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QVersitWriter-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qversitwriter.html">QVersitWriter</a> class writes Versit documents such as vCards to a device.</p>
<p><a href="qversitwriter.html">QVersitWriter</a> converts a <a href="qversitdocument.html">QVersitDocument</a> into its textual representation. <a href="qversitwriter.html">QVersitWriter</a> supports writing to an abstract I/O device which can be for example a file or a memory buffer. The writing can be done asynchronously and the <a href="qversitwriter.html#waitForFinished">waitForFinished</a>() function can be used to implement a blocking write.</p>
<p>The serialization of the document is done in accordance with the type of the <a href="qversitdocument.html">QVersitDocument</a> being written. The value of each <a href="qversitproperty.html">QVersitProperty</a> is encoded according to the type of object:</p>
<ul>
<li>QStrings are serialized verbatim, unless the default codec of the writer cannot encode the string: in this case, UTF-8 is used to encode it (and the CHARSET parameter added to the property, as per the vCard 2.1 specification). If the document type is vCard 2.1, quoted-printable encoding may also be performed.</li>
<li>QByteArrays are assumed to be binary data and are serialized as base-64 encoded values.</li>
<li><a href="qversitdocument.html">QVersitDocuments</a> are serialized as a nested document (eg. as per the AGENT property in vCard).</li>
</ul>
</div>
<p><b>See also </b><a href="qversitdocument.html">QVersitDocument</a> and <a href="qversitproperty.html">QVersitProperty</a>.</p>
<!-- @@@QVersitWriter -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Error$$$NoError$$$UnspecifiedError$$$IOError$$$OutOfMemoryError$$$NotReadyError -->
<h3 class="fn" id="Error-enum"><a name="Error-enum"></a>enum QVersitWriter::<span class="name">Error</span></h3>
<p>This enum specifies an error that occurred during the most recent operation:</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>QVersitWriter::NoError</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The most recent operation was successful</td></tr>
<tr><td class="topAlign"><code>QVersitWriter::UnspecifiedError</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The most recent operation failed for an undocumented reason</td></tr>
<tr><td class="topAlign"><code>QVersitWriter::IOError</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The most recent operation failed because of a problem with the device</td></tr>
<tr><td class="topAlign"><code>QVersitWriter::OutOfMemoryError</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The most recent operation failed due to running out of memory</td></tr>
<tr><td class="topAlign"><code>QVersitWriter::NotReadyError</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">The most recent operation failed because there is an operation in progress</td></tr>
</table></div>
<!-- @@@Error -->
<!-- $$$State$$$InactiveState$$$ActiveState$$$CanceledState$$$FinishedState -->
<h3 class="fn" id="State-enum"><a name="State-enum"></a>enum QVersitWriter::<span class="name">State</span></h3>
<p>Enumerates the various states that a reader may be in at any given time</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>QVersitWriter::InactiveState</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Write operation not yet started</td></tr>
<tr><td class="topAlign"><code>QVersitWriter::ActiveState</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Write operation started, not yet finished</td></tr>
<tr><td class="topAlign"><code>QVersitWriter::CanceledState</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Write operation is finished due to cancelation</td></tr>
<tr><td class="topAlign"><code>QVersitWriter::FinishedState</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Write operation successfully completed</td></tr>
</table></div>
<!-- @@@State -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QVersitWriter[overload1]$$$QVersitWriter -->
<h3 class="fn" id="QVersitWriter"><a name="QVersitWriter"></a>QVersitWriter::<span class="name">QVersitWriter</span>()</h3>
<p>Constructs a new writer.</p>
<!-- @@@QVersitWriter -->
<!-- $$$QVersitWriter$$$QVersitWriterQIODevice* -->
<h3 class="fn" id="QVersitWriter-1"><a name="QVersitWriter-1"></a>QVersitWriter::<span class="name">QVersitWriter</span>(<span class="type">QIODevice</span> *<i>outputDevice</i>)</h3>
<p>Constructs a new writer that writes to <i>outputDevice</i>.</p>
<!-- @@@QVersitWriter -->
<!-- $$$QVersitWriter$$$QVersitWriterQByteArray* -->
<h3 class="fn" id="QVersitWriter-2"><a name="QVersitWriter-2"></a>QVersitWriter::<span class="name">QVersitWriter</span>(<span class="type">QByteArray</span> *<i>outputBytes</i>)</h3>
<p>Constructs a new writer that appends to <i>outputBytes</i>.</p>
<!-- @@@QVersitWriter -->
<!-- $$$~QVersitWriter[overload1]$$$~QVersitWriter -->
<h3 class="fn" id="dtor.QVersitWriter"><a name="dtor.QVersitWriter"></a>QVersitWriter::<span class="name">~QVersitWriter</span>()</h3>
<p>Frees the memory used by the writer. Waits until a pending asynchronous writing has been completed.</p>
<!-- @@@~QVersitWriter -->
<!-- $$$cancel[overload1]$$$cancel -->
<h3 class="fn" id="cancel"><a name="cancel"></a><code>[slot] </code><span class="type">void</span> QVersitWriter::<span class="name">cancel</span>()</h3>
<p>Attempts to asynchronously cancel the write request.</p>
<!-- @@@cancel -->
<!-- $$$defaultCodec[overload1]$$$defaultCodec -->
<h3 class="fn" id="defaultCodec"><a name="defaultCodec"></a><span class="type">QTextCodec</span> *QVersitWriter::<span class="name">defaultCodec</span>() const</h3>
<p>Returns the document's codec.</p>
<p><b>See also </b><a href="qversitwriter.html#setDefaultCodec">setDefaultCodec</a>().</p>
<!-- @@@defaultCodec -->
<!-- $$$device[overload1]$$$device -->
<h3 class="fn" id="device"><a name="device"></a><span class="type">QIODevice</span> *QVersitWriter::<span class="name">device</span>() const</h3>
<p>Returns the device used for writing, or 0 if no device has been set.</p>
<p><b>See also </b><a href="qversitwriter.html#setDevice">setDevice</a>().</p>
<!-- @@@device -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn" id="error"><a name="error"></a><span class="type"><a href="qversitwriter.html#Error-enum">Error</a></span> QVersitWriter::<span class="name">error</span>() const</h3>
<p>Returns the error encountered by the last operation.</p>
<!-- @@@error -->
<!-- $$$setDefaultCodec[overload1]$$$setDefaultCodecQTextCodec* -->
<h3 class="fn" id="setDefaultCodec"><a name="setDefaultCodec"></a><span class="type">void</span> QVersitWriter::<span class="name">setDefaultCodec</span>(<span class="type">QTextCodec</span> *<i>codec</i>)</h3>
<p>Sets the default codec for the writer to use for writing the entire output.</p>
<p>If <i>codec</i> is NULL, the writer uses the codec according to the specification prescribed default. (for vCard 2.1, ASCII; for vCard 3.0, UTF-8).</p>
<p><b>See also </b><a href="qversitwriter.html#defaultCodec">defaultCodec</a>().</p>
<!-- @@@setDefaultCodec -->
<!-- $$$setDevice[overload1]$$$setDeviceQIODevice* -->
<h3 class="fn" id="setDevice"><a name="setDevice"></a><span class="type">void</span> QVersitWriter::<span class="name">setDevice</span>(<span class="type">QIODevice</span> *<i>device</i>)</h3>
<p>Sets the device used for writing to <i>device</i>. Does not take ownership of the device.</p>
<p><b>See also </b><a href="qversitwriter.html#device">device</a>().</p>
<!-- @@@setDevice -->
<!-- $$$startWriting[overload1]$$$startWritingconstQList<QVersitDocument>& -->
<h3 class="fn" id="startWriting"><a name="startWriting"></a><code>[slot] </code><span class="type">bool</span> QVersitWriter::<span class="name">startWriting</span>(const <span class="type">QList</span>&lt;<span class="type"><a href="qversitdocument.html">QVersitDocument</a></span>&gt; &amp;<i>input</i>)</h3>
<p>Starts writing <i>input</i> to <a href="qversitwriter.html#device">device</a>() asynchronously. The serialization format is determined based on the contents of the input documents.</p>
<p>Returns false if the output device has not been set or opened or if there is another asynchronous write operation already pending. Signal <a href="qversitwriter.html#stateChanged">stateChanged</a>() is emitted with parameter <a href="qversitwriter.html#State-enum">FinishedState</a> when the writing has finished.</p>
<p>The device must be already open. The client is responsible for closing it when finished.</p>
<!-- @@@startWriting -->
<!-- $$$startWriting$$$startWritingconstQList<QVersitDocument>&QVersitDocument::VersitType -->
<h3 class="fn" id="startWriting-1"><a name="startWriting-1"></a><code>[slot] </code><span class="type">bool</span> QVersitWriter::<span class="name">startWriting</span>(const <span class="type">QList</span>&lt;<span class="type"><a href="qversitdocument.html">QVersitDocument</a></span>&gt; &amp;<i>input</i>, <span class="type"><a href="qversitdocument.html#VersitType-enum">QVersitDocument::VersitType</a></span> <i>type</i>)</h3>
<p>Starts writing <i>input</i> to <a href="qversitwriter.html#device">device</a>() asynchronously using the serialization format specified by <i>type</i>. If <i>type</i> is <a href="qversitdocument.html#VersitType-enum">QVersitDocument::InvalidType</a>, the format will be determined based on the contents of the input documents.</p>
<p>Returns false if the output device has not been set or opened or if there is another asynchronous write operation already pending. Signal <a href="qversitwriter.html#stateChanged">stateChanged</a>() is emitted with parameter <a href="qversitwriter.html#State-enum">FinishedState</a> when the writing has finished.</p>
<p>The device must be already open. The client is responsible for closing it when finished.</p>
<!-- @@@startWriting -->
<!-- $$$startWriting$$$startWritingconstQVersitDocument& -->
<h3 class="fn" id="startWriting-2"><a name="startWriting-2"></a><code>[slot] </code><span class="type">bool</span> QVersitWriter::<span class="name">startWriting</span>(const <span class="type"><a href="qversitdocument.html">QVersitDocument</a></span> &amp;<i>input</i>)</h3>
<p>Starts writing <i>input</i> to <a href="qversitwriter.html#device">device</a>() asynchronously. The serialization format is determined based on the contents of the input documents.</p>
<p>Returns false if the output device has not been set or opened or if there is another asynchronous write operation already pending. Signal <a href="qversitwriter.html#stateChanged">stateChanged</a>() is emitted with parameter <a href="qversitwriter.html#State-enum">FinishedState</a> when the writing has finished.</p>
<p>The device must be already open. The client is responsible for closing it when finished.</p>
<!-- @@@startWriting -->
<!-- $$$startWriting$$$startWritingconstQVersitDocument&QVersitDocument::VersitType -->
<h3 class="fn" id="startWriting-3"><a name="startWriting-3"></a><code>[slot] </code><span class="type">bool</span> QVersitWriter::<span class="name">startWriting</span>(const <span class="type"><a href="qversitdocument.html">QVersitDocument</a></span> &amp;<i>input</i>, <span class="type"><a href="qversitdocument.html#VersitType-enum">QVersitDocument::VersitType</a></span> <i>type</i>)</h3>
<p>Starts writing <i>input</i> to <a href="qversitwriter.html#device">device</a>() asynchronously using the serialization format specified by <i>type</i>. If <i>type</i> is <a href="qversitdocument.html#VersitType-enum">QVersitDocument::InvalidType</a>, the format will be determined based on the contents of the input documents.</p>
<p>Returns false if the output device has not been set or opened or if there is another asynchronous write operation already pending. Signal <a href="qversitwriter.html#stateChanged">stateChanged</a>() is emitted with parameter <a href="qversitwriter.html#State-enum">FinishedState</a> when the writing has finished.</p>
<p>The device must be already open. The client is responsible for closing it when finished.</p>
<!-- @@@startWriting -->
<!-- $$$state[overload1]$$$state -->
<h3 class="fn" id="state"><a name="state"></a><span class="type"><a href="qversitwriter.html#State-enum">State</a></span> QVersitWriter::<span class="name">state</span>() const</h3>
<p>Returns the state of the writer.</p>
<!-- @@@state -->
<!-- $$$stateChanged[overload1]$$$stateChangedQVersitWriter::State -->
<h3 class="fn" id="stateChanged"><a name="stateChanged"></a><code>[signal] </code><span class="type">void</span> QVersitWriter::<span class="name">stateChanged</span>(<span class="type"><a href="qversitwriter.html#State-enum">QVersitWriter::State</a></span> <i>state</i>)</h3>
<p>The signal is emitted by the writer when its state has changed (eg. when it has finished writing to the device). <i>state</i> is the new state of the writer.</p>
<!-- @@@stateChanged -->
<!-- $$$waitForFinished[overload1]$$$waitForFinishedint -->
<h3 class="fn" id="waitForFinished"><a name="waitForFinished"></a><span class="type">bool</span> QVersitWriter::<span class="name">waitForFinished</span>(<span class="type">int</span> <i>msec</i> = -1)</h3>
<p>If the state is <a href="qversitwriter.html#State-enum">ActiveState</a>, blocks until the writer has finished writing or <i>msec</i> milliseconds has elapsed, returning true if it successfully finishes or is cancelled by the user. If <i>msec</i> is negative or zero, the function blocks until the writer has finished, regardless of how long it takes. If the state is <a href="qversitwriter.html#State-enum">FinishedState</a>, returns true immediately. Otherwise, returns false immediately.</p>
<!-- @@@waitForFinished -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 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>