File: qstringref.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (581 lines) | stat: -rw-r--r-- 70,436 bytes parent folder | download
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qstring.cpp -->
  <title>Qt 4.8: QStringRef Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QStringRef</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<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="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QStringRef Class Reference</h1>
<!-- $$$QStringRef-brief -->
<p>The QStringRef class provides a thin wrapper around <a href="qstring.html">QString</a> substrings. <a href="#details">More...</a></p>
<!-- @@@QStringRef -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QStringRef&gt;</span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This class was introduced in Qt 4.3.</p>
<ul>
<li><a href="qstringref-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#QStringRef">QStringRef</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#QStringRef-2">QStringRef</a></b> ( const QString * <i>string</i>, int <i>position</i>, int <i>length</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#QStringRef-3">QStringRef</a></b> ( const QString * <i>string</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#QStringRef-4">QStringRef</a></b> ( const QStringRef &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#dtor.QStringRef">~QStringRef</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringRef </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#appendTo">appendTo</a></b> ( QString * <i>string</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#at">at</a></b> ( int <i>position</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-4">compare</a></b> ( const QString &amp; <i>other</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-5">compare</a></b> ( const QStringRef &amp; <i>other</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-6">compare</a></b> ( QLatin1String <i>other</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#constData">constData</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains">contains</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains-2">contains</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains-3">contains</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#contains-4">contains</a></b> ( QLatin1String <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count-2">count</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count-3">count</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#count-4">count</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#data">data</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith">endsWith</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith-2">endsWith</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith-3">endsWith</a></b> ( QLatin1String <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#endsWith-4">endsWith</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf">indexOf</a></b> ( const QString &amp; <i>str</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf-2">indexOf</a></b> ( QLatin1String <i>str</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf-3">indexOf</a></b> ( QChar <i>ch</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#indexOf-4">indexOf</a></b> ( const QStringRef &amp; <i>str</i>, int <i>from</i> = 0, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf">lastIndexOf</a></b> ( const QString &amp; <i>str</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf-2">lastIndexOf</a></b> ( QChar <i>ch</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf-3">lastIndexOf</a></b> ( QLatin1String <i>str</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#lastIndexOf-4">lastIndexOf</a></b> ( const QStringRef &amp; <i>str</i>, int <i>from</i> = -1, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#length">length</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare-3">localeAwareCompare</a></b> ( const QString &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare-4">localeAwareCompare</a></b> ( const QStringRef &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#position">position</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith">startsWith</a></b> ( const QString &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith-2">startsWith</a></b> ( QLatin1String <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith-3">startsWith</a></b> ( const QStringRef &amp; <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#startsWith-4">startsWith</a></b> ( QChar <i>ch</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QString * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#string">string</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toAscii">toAscii</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toLatin1">toLatin1</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toLocal8Bit">toLocal8Bit</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toString">toString</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector&lt;uint&gt; </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toUcs4">toUcs4</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#toUtf8">toUtf8</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QChar * </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#unicode">unicode</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringRef &amp; </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq">operator=</a></b> ( const QStringRef &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringRef &amp; </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-2">operator=</a></b> ( const QString * <i>string</i> )</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare">compare</a></b> ( const QStringRef &amp; <i>s1</i>, const QString &amp; <i>s2</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-2">compare</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#compare-3">compare</a></b> ( const QStringRef &amp; <i>s1</i>, QLatin1String <i>s2</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare">localeAwareCompare</a></b> ( const QStringRef &amp; <i>s1</i>, const QString &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#localeAwareCompare-2">localeAwareCompare</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-lt-12">operator&lt;</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-lt-eq-9">operator&lt;=</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-eq-63">operator==</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-eq-64">operator==</a></b> ( const QString &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-eq-eq-66">operator==</a></b> ( const QLatin1String &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-gt-9">operator&gt;</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringref.html#operator-gt-eq-9">operator&gt;=</a></b> ( const QStringRef &amp; <i>s1</i>, const QStringRef &amp; <i>s2</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QStringRef-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QStringRef class provides a thin wrapper around <a href="qstring.html">QString</a> substrings.</p>
<p>QStringRef provides a read-only subset of the <a href="qstring.html">QString</a> API.</p>
<p>A string reference explicitly references a portion of a <a href="qstringref.html#string">string</a>() with a given <a href="qstringref.html#size">size</a>(), starting at a specific <a href="qstringref.html#position">position</a>(). Calling <a href="qstringref.html#toString">toString</a>() returns a copy of the data as a real <a href="qstring.html">QString</a> instance.</p>
<p>This class is designed to improve the performance of substring handling when manipulating substrings obtained from existing <a href="qstring.html">QString</a> instances. QStringRef avoids the memory allocation and reference counting overhead of a standard <a href="qstring.html">QString</a> by simply referencing a part of the original string. This can prove to be advantageous in low level code, such as that used in a parser, at the expense of potentially more complex code.</p>
<p>For most users, there are no semantic benefits to using QStringRef instead of <a href="qstring.html">QString</a> since QStringRef requires attention to be paid to memory management issues, potentially making code more complex to write and maintain.</p>
<p><b>Warning:</b> A QStringRef is only valid as long as the referenced string exists. If the original string is deleted, the string reference points to an invalid memory location.</p>
<p>We suggest that you only use this class in stable code where profiling has clearly identified that performance improvements can be made by replacing standard string operations with the optimized substring handling provided by this class.</p>
</div>
<p><b>See also </b><a href="shared.html">Implicitly Shared Classes</a>.</p>
<!-- @@@QStringRef -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QStringRef[overload1]$$$QStringRef -->
<h3 class="fn"><a name="QStringRef"></a>QStringRef::<span class="name">QStringRef</span> ()</h3>
<p>Constructs an empty string reference.</p>
<!-- @@@QStringRef -->
<!-- $$$QStringRef$$$QStringRefconstQString*intint -->
<h3 class="fn"><a name="QStringRef-2"></a>QStringRef::<span class="name">QStringRef</span> ( const <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i>, <span class="type">int</span> <i>position</i>, <span class="type">int</span> <i>length</i> )</h3>
<p>Constructs a string reference to the range of characters in the given <i>string</i> specified by the starting <i>position</i> and <i>length</i> in characters.</p>
<p><b>Warning:</b> This function exists to improve performance as much as possible, and performs no bounds checking. For program correctness, <i>position</i> and <i>length</i> must describe a valid substring of <i>string</i>.</p>
<p>This means that the starting <i>position</i> must be positive or 0 and smaller than <i>string</i>'s length, and <i>length</i> must be positive or 0 but smaller than the string's length minus the starting <i>position</i>; i.e, 0 &lt;= position &lt; string-&gt;<a href="qstringref.html#length">length</a>() and 0 &lt;= length &lt;= string-&gt;<a href="qstringref.html#length">length</a>() - position must both be satisfied.</p>
<!-- @@@QStringRef -->
<!-- $$$QStringRef$$$QStringRefconstQString* -->
<h3 class="fn"><a name="QStringRef-3"></a>QStringRef::<span class="name">QStringRef</span> ( const <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i> )</h3>
<p>Constructs a string reference to the given <i>string</i>.</p>
<!-- @@@QStringRef -->
<!-- $$$QStringRef$$$QStringRefconstQStringRef& -->
<h3 class="fn"><a name="QStringRef-4"></a>QStringRef::<span class="name">QStringRef</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of the <i>other</i> string reference.</p>
<!-- @@@QStringRef -->
<!-- $$$~QStringRef[overload1]$$$~QStringRef -->
<h3 class="fn"><a name="dtor.QStringRef"></a>QStringRef::<span class="name">~QStringRef</span> ()</h3>
<p>Destroys the string reference.</p>
<p>Since this class is only used to refer to string data, and does not take ownership of it, no memory is freed when instances are destroyed.</p>
<!-- @@@~QStringRef -->
<!-- $$$appendTo[overload1]$$$appendToQString* -->
<h3 class="fn"><a name="appendTo"></a><span class="type">QStringRef</span> QStringRef::<span class="name">appendTo</span> ( <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i> ) const</h3>
<p>Appends the string reference to <i>string</i>, and returns a new reference to the combined string data.</p>
<!-- @@@appendTo -->
<!-- $$$at[overload1]$$$atint -->
<h3 class="fn"><a name="at"></a>const <span class="type"><a href="qchar.html">QChar</a></span> QStringRef::<span class="name">at</span> ( <span class="type">int</span> <i>position</i> ) const</h3>
<p>Returns the character at the given index <i>position</i> in the string reference.</p>
<p>The <i>position</i> must be a valid index position in the string (i.e&#x2e;, 0 &lt;= <i>position</i> &lt; <a href="qstringref.html#size">size</a>()).</p>
<!-- @@@at -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QStringRef::<span class="name">clear</span> ()</h3>
<p>Clears the contents of the string reference by making it null and empty.</p>
<p><b>See also </b><a href="qstringref.html#isEmpty">isEmpty</a>() and <a href="qstringref.html#isNull">isNull</a>().</p>
<!-- @@@clear -->
<!-- $$$compare[overload1]$$$compareconstQStringRef&constQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>s2</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive )<tt> [static]</tt></h3>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQStringRef&constQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare-2"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQStringRef&QLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="compare-3"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>s2</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare-4"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>other</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstring.html#compare">QString::compare</a>().</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="compare-5"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstring.html#compare">QString::compare</a>().</p>
<!-- @@@compare -->
<!-- $$$compare$$$compareQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="compare-6"></a><span class="type">int</span> QStringRef::<span class="name">compare</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>other</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a>, the comparison is case sensitive; otherwise the comparison is case insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstring.html#compare">QString::compare</a>().</p>
<!-- @@@compare -->
<!-- $$$constData[overload1]$$$constData -->
<h3 class="fn"><a name="constData"></a>const <span class="type"><a href="qchar.html">QChar</a></span> * QStringRef::<span class="name">constData</span> () const</h3>
<p>Same as <a href="qstringref.html#unicode">unicode</a>().</p>
<!-- @@@constData -->
<!-- $$$contains[overload1]$$$containsconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="contains"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns true if this string reference contains an occurrence of the string <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#indexOf">indexOf</a>() and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="contains-2"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string contains an occurrence of the character <i>ch</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="contains-3"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string reference contains an occurrence of the string reference <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#indexOf">indexOf</a>() and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="contains-4"></a><span class="type">bool</span> QStringRef::<span class="name">contains</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string reference contains an occurrence of the string <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4,8.</p>
<p><b>See also </b><a href="qstringref.html#indexOf">indexOf</a>() and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@contains -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type">int</span> QStringRef::<span class="name">count</span> () const</h3>
<p>Returns the number of characters referred to by the string reference. Equivalent to <a href="qstringref.html#size">size</a>() and <a href="qstringref.html#length">length</a>().</p>
<p><b>See also </b><a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$countconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="count-2"></a><span class="type">int</span> QStringRef::<span class="name">count</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the number of (potentially overlapping) occurrences of the string <i>str</i> in this string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#count">QString::count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$countQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="count-3"></a><span class="type">int</span> QStringRef::<span class="name">count</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#count">count</a>().</p>
<p>Returns the number of occurrences of the character <i>ch</i> in the string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#count">QString::count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$countconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="count-4"></a><span class="type">int</span> QStringRef::<span class="name">count</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#count">count</a>().</p>
<p>Returns the number of (potentially overlapping) occurrences of the string reference <i>str</i> in this string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#count">QString::count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$data[overload1]$$$data -->
<h3 class="fn"><a name="data"></a>const <span class="type"><a href="qchar.html">QChar</a></span> * QStringRef::<span class="name">data</span> () const</h3>
<p>Same as <a href="qstringref.html#unicode">unicode</a>().</p>
<!-- @@@data -->
<!-- $$$endsWith[overload1]$$$endsWithconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns true if the string reference ends with <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#startsWith">startsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith-2"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>Returns true if the string reference ends with <i>ch</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith-3"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="endsWith-4"></a><span class="type">bool</span> QStringRef::<span class="name">endsWith</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#endsWith">QString::endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@endsWith -->
<!-- $$$indexOf[overload1]$$$indexOfconstQString&intQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the index position of the first occurrence of the string <i>str</i> in this string reference, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>If <i>from</i> is -1, the search starts at the last character; if it is -2, at the next to last character and so on.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfQLatin1StringintQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf-2"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the index position of the first occurrence of the string <i>str</i> in this string reference, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>If <i>from</i> is -1, the search starts at the last character; if it is -2, at the next to last character and so on.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfQCharintQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf-3"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#indexOf">indexOf</a>().</p>
<p>Returns the index position of the first occurrence of the character <i>ch</i> in the string reference, searching forward from index position <i>from</i>. Returns -1 if <i>ch</i> could not be found.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfconstQStringRef&intQt::CaseSensitivity -->
<h3 class="fn"><a name="indexOf-4"></a><span class="type">int</span> QStringRef::<span class="name">indexOf</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = 0, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#indexOf">indexOf</a>().</p>
<p>Returns the index position of the first occurrence of the string reference <i>str</i> in this string reference, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#indexOf">QString::indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QStringRef::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if the string reference has no characters; otherwise returns false.</p>
<p>A string reference is empty if its size is zero.</p>
<p><b>See also </b><a href="qstringref.html#size">size</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QStringRef::<span class="name">isNull</span> () const</h3>
<p>Returns true if <a href="qstringref.html#string">string</a>() returns a null pointer or a pointer to a null string; otherwise returns true.</p>
<p><b>See also </b><a href="qstringref.html#size">size</a>().</p>
<!-- @@@isNull -->
<!-- $$$lastIndexOf[overload1]$$$lastIndexOfconstQString&intQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns the index position of the last occurrence of the string <i>str</i> in this string reference, searching backward from index position <i>from</i>. If <i>from</i> is -1 (default), the search starts at the last character; if <i>from</i> is -2, at the next to last character and so on. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfQCharintQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf-2"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the character <i>ch</i>, searching backward from position <i>from</i>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfQLatin1StringintQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf-3"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the string <i>str</i> in this string reference, searching backward from index position <i>from</i>. If <i>from</i> is -1 (default), the search starts at the last character; if <i>from</i> is -2, at the next to last character and so on. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfconstQStringRef&intQt::CaseSensitivity -->
<h3 class="fn"><a name="lastIndexOf-4"></a><span class="type">int</span> QStringRef::<span class="name">lastIndexOf</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = -1, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the string reference <i>str</i> in this string reference, searching backward from index position <i>from</i>. If <i>from</i> is -1 (default), the search starts at the last character; if <i>from</i> is -2, at the next to last character and so on. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#lastIndexOf">QString::lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$length[overload1]$$$length -->
<h3 class="fn"><a name="length"></a><span class="type">int</span> QStringRef::<span class="name">length</span> () const</h3>
<p>Returns the number of characters referred to by the string reference. Equivalent to <a href="qstringref.html#size">size</a>() and <a href="qstringref.html#count">count</a>().</p>
<p><b>See also </b><a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@length -->
<!-- $$$localeAwareCompare[overload1]$$$localeAwareCompareconstQStringRef&constQString& -->
<h3 class="fn"><a name="localeAwareCompare"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>s2</i> )<tt> [static]</tt></h3>
<p>Compares <i>s1</i> with <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>On Mac OS X, this function compares according the &quot;Order for sorted lists&quot; setting in the International prefereces panel.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qstringref.html#compare">compare</a>() and <a href="qtextcodec-qt3.html#locale" class="compat">QTextCodec::locale</a>().</p>
<!-- @@@localeAwareCompare -->
<!-- $$$localeAwareCompare$$$localeAwareCompareconstQStringRef&constQStringRef& -->
<h3 class="fn"><a name="localeAwareCompare-2"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Compares <i>s1</i> with <i>s2</i> and returns an integer less than, equal to, or greater than zero if <i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@localeAwareCompare -->
<!-- $$$localeAwareCompare$$$localeAwareCompareconstQString& -->
<h3 class="fn"><a name="localeAwareCompare-3"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>other</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@localeAwareCompare -->
<!-- $$$localeAwareCompare$$$localeAwareCompareconstQStringRef& -->
<h3 class="fn"><a name="localeAwareCompare-4"></a><span class="type">int</span> QStringRef::<span class="name">localeAwareCompare</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an integer less than, equal to, or greater than zero if this string is less than, equal to, or greater than the <i>other</i> string.</p>
<p>The comparison is performed in a locale- and also platform-dependent manner. Use this function to present sorted lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@localeAwareCompare -->
<!-- $$$position[overload1]$$$position -->
<h3 class="fn"><a name="position"></a><span class="type">int</span> QStringRef::<span class="name">position</span> () const</h3>
<p>Returns the starting position in the referenced string that is referred to by the string reference.</p>
<p><b>See also </b><a href="qstringref.html#size">size</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@position -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type">int</span> QStringRef::<span class="name">size</span> () const</h3>
<p>Returns the number of characters referred to by the string reference. Equivalent to <a href="qstringref.html#length">length</a>() and <a href="qstringref.html#count">count</a>().</p>
<p><b>See also </b><a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>
<!-- @@@size -->
<!-- $$$startsWith[overload1]$$$startsWithconstQString&Qt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>Returns true if the string reference starts with <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithQLatin1StringQt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith-2"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithconstQStringRef&Qt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith-3"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( const <span class="type">QStringRef</span> &amp; <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithQCharQt::CaseSensitivity -->
<h3 class="fn"><a name="startsWith-4"></a><span class="type">bool</span> QStringRef::<span class="name">startsWith</span> ( <span class="type"><a href="qchar.html">QChar</a></span> <i>ch</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
<p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>Returns true if the string reference starts with <i>ch</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (default), the search is case sensitive; otherwise the search is case insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstring.html#startsWith">QString::startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>
<!-- @@@startsWith -->
<!-- $$$string[overload1]$$$string -->
<h3 class="fn"><a name="string"></a>const <span class="type"><a href="qstring.html">QString</a></span> * QStringRef::<span class="name">string</span> () const</h3>
<p>Returns a pointer to the string referred to by the string reference, or 0 if it does not reference a string.</p>
<p><b>See also </b><a href="qstringref.html#unicode">unicode</a>().</p>
<!-- @@@string -->
<!-- $$$toAscii[overload1]$$$toAscii -->
<h3 class="fn"><a name="toAscii"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toAscii</span> () const</h3>
<p>Returns an 8-bit representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>If a codec has been set using <a href="qtextcodec.html#setCodecForCStrings">QTextCodec::setCodecForCStrings</a>(), it is used to convert Unicode to 8-bit char; otherwise this function does the same as <a href="qstringref.html#toLatin1">toLatin1</a>().</p>
<p>Note that, despite the name, this function does not necessarily return an US-ASCII (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toAscii -->
<!-- $$$toLatin1[overload1]$$$toLatin1 -->
<h3 class="fn"><a name="toLatin1"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toLatin1</span> () const</h3>
<p>Returns a Latin-1 representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>The returned byte array is undefined if the string contains non-Latin1 characters. Those characters may be suppressed or replaced with a question mark.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toLatin1 -->
<!-- $$$toLocal8Bit[overload1]$$$toLocal8Bit -->
<h3 class="fn"><a name="toLocal8Bit"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toLocal8Bit</span> () const</h3>
<p>Returns the local 8-bit representation of the string as a <a href="qbytearray.html">QByteArray</a>. The returned byte array is undefined if the string contains characters not supported by the local 8-bit encoding.</p>
<p><a href="qtextcodec.html#codecForLocale">QTextCodec::codecForLocale</a>() is used to perform the conversion from Unicode. If the locale encoding could not be determined, this function does the same as <a href="qstringref.html#toLatin1">toLatin1</a>().</p>
<p>If this string contains any characters that cannot be encoded in the locale, the returned byte array is undefined. Those characters may be suppressed or replaced by another.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toLocal8Bit -->
<!-- $$$toString[overload1]$$$toString -->
<h3 class="fn"><a name="toString"></a><span class="type"><a href="qstring.html">QString</a></span> QStringRef::<span class="name">toString</span> () const</h3>
<p>Returns a copy of the string reference as a <a href="qstring.html">QString</a> object.</p>
<p>If the string reference is not a complete reference of the string (meaning that <a href="qstringref.html#position">position</a>() is 0 and <a href="qstringref.html#size">size</a>() equals <a href="qstringref.html#string">string</a>()-&gt;<a href="qstringref.html#size">size</a>()), this function will allocate a new string to return.</p>
<p><b>See also </b><a href="qstringref.html#string">string</a>().</p>
<!-- @@@toString -->
<!-- $$$toUcs4[overload1]$$$toUcs4 -->
<h3 class="fn"><a name="toUcs4"></a><span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span>&gt; QStringRef::<span class="name">toUcs4</span> () const</h3>
<p>Returns a UCS-4/UTF-32 representation of the string as a <a href="qvector.html">QVector</a>&lt;uint&gt;.</p>
<p>UCS-4 is a Unicode codec and is lossless. All characters from this string can be encoded in UCS-4.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toUcs4 -->
<!-- $$$toUtf8[overload1]$$$toUtf8 -->
<h3 class="fn"><a name="toUtf8"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QStringRef::<span class="name">toUtf8</span> () const</h3>
<p>Returns a UTF-8 representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>UTF-8 is a Unicode codec and can represent all characters in a Unicode string like <a href="qstring.html">QString</a>.</p>
<p>However, in the Unicode range, there are certain codepoints that are not considered characters. The Unicode standard reserves the last two codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF, inclusive, as non-characters. If any of those appear in the string, they may be discarded and will not appear in the UTF-8 representation, or they may be replaced by one or more replacement characters.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also </b><a href="qstringref.html#toAscii">toAscii</a>(), <a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>
<!-- @@@toUtf8 -->
<!-- $$$unicode[overload1]$$$unicode -->
<h3 class="fn"><a name="unicode"></a>const <span class="type"><a href="qchar.html">QChar</a></span> * QStringRef::<span class="name">unicode</span> () const</h3>
<p>Returns a Unicode representation of the string reference. Since the data stems directly from the referenced string, it is not null-terminated unless the string reference includes the string's null terminator.</p>
<p><b>See also </b><a href="qstringref.html#string">string</a>().</p>
<!-- @@@unicode -->
<!-- $$$operator=[overload1]$$$operator=constQStringRef& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QStringRef</span> &amp; QStringRef::<span class="name">operator=</span> ( const <span class="type">QStringRef</span> &amp; <i>other</i> )</h3>
<p>Assigns the <i>other</i> string reference to this string reference, and returns the result.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQString* -->
<h3 class="fn"><a name="operator-eq-2"></a><span class="type">QStringRef</span> &amp; QStringRef::<span class="name">operator=</span> ( const <span class="type"><a href="qstring.html">QString</a></span> * <i>string</i> )</h3>
<p>Constructs a string reference to the given <i>string</i> and assigns it to this string reference, returning the result.</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<$$$operator<constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-lt-12"></a><span class="type">bool</span> <span class="name">operator&lt;</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically less than string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator< -->
<!-- $$$operator<=$$$operator<=constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-lt-eq-9"></a><span class="type">bool</span> <span class="name">operator&lt;=</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically less than or equal to string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator<= -->
<!-- $$$operator==$$$operator==constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-eq-eq-63"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically equal to string reference <i>s2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator==$$$operator==constQString&constQStringRef& -->
<h3 class="fn"><a name="operator-eq-eq-64"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string <i>s1</i> is lexically equal to string reference <i>s2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator==$$$operator==constQLatin1String&constQStringRef& -->
<h3 class="fn"><a name="operator-eq-eq-66"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type"><a href="qlatin1string.html">QLatin1String</a></span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string <i>s1</i> is lexically equal to string reference <i>s2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator>$$$operator>constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-gt-9"></a><span class="type">bool</span> <span class="name">operator&gt;</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically greater than string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator> -->
<!-- $$$operator>=$$$operator>=constQStringRef&constQStringRef& -->
<h3 class="fn"><a name="operator-gt-eq-9"></a><span class="type">bool</span> <span class="name">operator&gt;=</span> ( const <span class="type">QStringRef</span> &amp; <i>s1</i>, const <span class="type">QStringRef</span> &amp; <i>s2</i> )</h3>
<p>Returns true if string reference <i>s1</i> is lexically greater than or equal to string reference <i>s2</i>; otherwise returns false.</p>
<p>The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() function.</p>
<!-- @@@operator>= -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>