summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlatin1stringview.qdoc
blob: 711057767b171dc243e5e1a5b9e9d8e59d572d2d (plain)
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
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2022 Intel Corporation.
// Copyright (C) 2019 Mail.ru Group.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*! \class QLatin1StringView
    \inmodule QtCore
    \brief The QLatin1StringView class provides a thin wrapper around
    a US-ASCII/Latin-1 encoded string literal.

    \ingroup string-processing
    \reentrant

    \compares strong
    \compareswith strong char16_t QChar QStringView QUtf8StringView QString \
                  {const char16_t *}
    \endcompareswith
    \compareswith strong {const char *} QByteArray QByteArrayView
    The byte array data is interpreted as utf-8.
    \endcompareswith

    Many of QString's member functions are overloaded to accept
    \c{const char *} instead of QString. This includes the copy
    constructor, the assignment operator, the comparison operators,
    and various other functions such as \l{QString::insert()}{insert()},
    \l{QString::append()}{append()}, and \l{QString::prepend()}{prepend()}.
    Some of these functions are optimized to avoid constructing a
    QString object for the \c{const char *} data. For example,
    assuming \c str is a QString,

    \snippet code/src_corelib_text_qstring.cpp 3

    is much faster than

    \snippet code/src_corelib_text_qstring.cpp 4

    because it doesn't construct four temporary QString objects and
    make a deep copy of the character data.

    However, that is not true for all QString member functions that take
    \c{const char *} and therefore applications should assume a temporary will
    be created, such as in

    \snippet code/src_corelib_text_qstring.cpp 4bis

    Applications that define \l QT_NO_CAST_FROM_ASCII (as explained
    in the QString documentation) don't have access to QString's
    \c{const char *} API. To provide an efficient way of specifying
    constant Latin-1 strings, Qt provides the QLatin1StringView, which is
    just a very thin wrapper around a \c{const char *}. Using
    QLatin1StringView, the example code above becomes

    \snippet code/src_corelib_text_qstring.cpp 5

    This is a bit longer to type, but it provides exactly the same
    benefits as the first version of the code, and is faster than
    converting the Latin-1 strings using QString::fromLatin1().

    Thanks to the QString(QLatin1StringView) constructor,
    QLatin1StringView can be used everywhere a QString is expected. For
    example:

    \snippet code/src_corelib_text_qstring.cpp 6

    \note If the function you're calling with a QLatin1StringView
    argument isn't actually overloaded to take QLatin1StringView, the
    implicit conversion to QString will trigger a memory allocation,
    which is usually what you want to avoid by using QLatin1StringView
    in the first place. In those cases, using QStringLiteral may be
    the better option.

    \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral},
    QT_NO_CAST_FROM_ASCII
*/

/*!
    \class QLatin1String
    \inmodule QtCore
    \brief QLatin1String is the same as QLatin1StringView.

    QLatin1String is a view to a Latin-1 string. It's the same as
    QLatin1StringView and is kept for compatibility reasons. It is
    recommended to use QLatin1StringView instead.

    Please see the QLatin1StringView documentation for details.
*/

/*!
    \typedef QLatin1StringView::value_type
    \since 5.10

    Alias for \c{const char}. Provided for compatibility with the STL.
*/

/*!
    \typedef QLatin1StringView::difference_type
    \since 5.10

    Alias for \c{qsizetype}. Provided for compatibility with the STL.
*/

/*!
    \typedef QLatin1StringView::size_type
    \since 5.10

    Alias for \c{qsizetype}. Provided for compatibility with the STL.

    \note In version prior to Qt 6, this was an alias for \c{int},
    restricting the amount of data that could be held in a QLatin1StringView
    on 64-bit architectures.
*/

/*!
    \typedef QLatin1StringView::pointer
    \typedef QLatin1StringView::const_pointer
    \since 6.7

    Alias for \c{value_type *}. Provided for compatibility with the STL.
*/

/*!
    \typedef QLatin1StringView::reference
    \since 5.10

    Alias for \c{value_type &}. Provided for compatibility with the STL.
*/

/*!
    \typedef QLatin1StringView::const_reference
    \since 5.11

    Alias for \c{reference}. Provided for compatibility with the STL.
*/

/*!
    \typedef QLatin1StringView::iterator
    \since 5.10

    QLatin1StringView does not support mutable iterators, so this is the same
    as const_iterator.

    \sa const_iterator, reverse_iterator
*/

/*!
    \typedef QLatin1StringView::const_iterator
    \since 5.10

    \sa iterator, const_reverse_iterator
*/

/*!
    \typedef QLatin1StringView::reverse_iterator
    \since 5.10

    QLatin1StringView does not support mutable reverse iterators, so this is the
    same as const_reverse_iterator.

    \sa const_reverse_iterator, iterator
*/

/*!
    \typedef QLatin1StringView::const_reverse_iterator
    \since 5.10

    \sa reverse_iterator, const_iterator
*/

/*! \fn QLatin1StringView::QLatin1StringView()
    \since 5.6

    Constructs a QLatin1StringView object that stores a \nullptr.

    \sa data(), isEmpty(), isNull(), {Distinction Between Null and Empty Strings}
*/

/*! \fn QLatin1StringView::QLatin1StringView(std::nullptr_t)
    \since 6.4

    Constructs a QLatin1StringView object that stores a \nullptr.

    \sa data(), isEmpty(), isNull(), {Distinction Between Null and Empty Strings}
*/

/*! \fn QLatin1StringView::QLatin1StringView(const char *str)

    Constructs a QLatin1StringView object that stores \a str.

    The string data is \e not copied. The caller must be able to
    guarantee that \a str will not be deleted or modified as long as
    the QLatin1StringView object exists.

    \sa latin1()
*/

/*! \fn QLatin1StringView::QLatin1StringView(const char *str, qsizetype size)

    Constructs a QLatin1StringView object that stores \a str with \a size.

    The string data is \e not copied. The caller must be able to
    guarantee that \a str will not be deleted or modified as long as
    the QLatin1StringView object exists.

    \note: any null ('\\0') bytes in the byte array will be included in this
    string, which will be converted to Unicode null characters (U+0000) if this
    string is used by QString. This behavior is different from Qt 5.x.

    \sa latin1()
*/

/*!
    \fn QLatin1StringView::QLatin1StringView(const char *first, const char *last)
    \since 5.10

    Constructs a QLatin1StringView object that stores \a first with length
    (\a last - \a first).

    The range \c{[first,last)} must remain valid for the lifetime of
    this Latin-1 string object.

    Passing \nullptr as \a first is safe if \a last is \nullptr,
    too, and results in a null Latin-1 string.

    The behavior is undefined if \a last precedes \a first, \a first
    is \nullptr and \a last is not, or if \c{last - first >
    INT_MAX}.
*/

/*! \fn QLatin1StringView::QLatin1StringView(const QByteArray &str)

    Constructs a QLatin1StringView object as a view on \a str.

    The string data is \e not copied. The caller must be able to
    guarantee that \a str will not be deleted or modified as long as
    the QLatin1StringView object exists.

    \sa latin1()
*/

/*! \fn QLatin1StringView::QLatin1StringView(QByteArrayView str)
    \since 6.3

    Constructs a QLatin1StringView object as a view on \a str.

    The string data is \e not copied. The caller must be able to
    guarantee that the data which \a str is pointing to will not
    be deleted or modified as long as the QLatin1StringView object
    exists. The size is obtained from \a str as-is, without checking
    for a null-terminator.

    \note: any null ('\\0') bytes in the byte array will be included in this
    string, which will be converted to Unicode null characters (U+0000) if this
    string is used by QString.

    \sa latin1()
*/

/*!
    \fn QString QLatin1StringView::toString() const
    \since 6.0

    Converts this Latin-1 string into a QString. Equivalent to
    \code
    return QString(*this);
    \endcode
*/

/*! \fn const char *QLatin1StringView::latin1() const

    Returns the start of the Latin-1 string referenced by this object.
*/

/*! \fn const char *QLatin1StringView::data() const

    Returns the start of the Latin-1 string referenced by this object.
*/

/*! \fn const char *QLatin1StringView::constData() const
    \since 6.4

    Returns the start of the Latin-1 string referenced by this object.

    This function is provided for compatibility with other Qt containers.

    \sa data()
*/

/*! \fn qsizetype QLatin1StringView::size() const

    Returns the size of the Latin-1 string referenced by this object.

    \note In version prior to Qt 6, this function returned \c{int},
    restricting the amount of data that could be held in a QLatin1StringView
    on 64-bit architectures.
*/

/*! \fn qsizetype QLatin1StringView::length() const
    \since 6.4

    Same as size().

    This function is provided for compatibility with other Qt containers.
*/

/*! \fn bool QLatin1StringView::isNull() const
    \since 5.10

    Returns whether the Latin-1 string referenced by this object is null
    (\c{data() == nullptr}) or not.

    \sa isEmpty(), data()
*/

/*! \fn bool QLatin1StringView::isEmpty() const
    \since 5.10

    Returns whether the Latin-1 string referenced by this object is empty
    (\c{size() == 0}) or not.

    \sa isNull(), size()
*/

/*! \fn bool QLatin1StringView::empty() const
    \since 6.4

    Returns whether the Latin-1 string referenced by this object is empty
    (\c{size() == 0}) or not.

    This function is provided for STL compatibility.

    \sa isEmpty(), isNull(), size()
*/

/*! \fn QLatin1Char QLatin1StringView::at(qsizetype pos) const
    \since 5.8

    Returns the character at position \a pos in this object.

    \note This function performs no error checking.
    The behavior is undefined when \a pos < 0 or \a pos >= size().

    \sa operator[]()
*/

/*! \fn QLatin1Char QLatin1StringView::operator[](qsizetype pos) const
    \since 5.8

    Returns the character at position \a pos in this object.

    \note This function performs no error checking.
    The behavior is undefined when \a pos < 0 or \a pos >= size().

    \sa at()
*/

/*!
    \fn QLatin1Char QLatin1StringView::front() const
    \since 5.10

    Returns the first character in the string.
    Same as \c{at(0)}.

    This function is provided for STL compatibility.

    \warning Calling this function on an empty string constitutes
    undefined behavior.

    \sa back(), at(), operator[]()
*/

/*!
    \fn QLatin1Char QLatin1StringView::first() const
    \since 6.4

    Returns the first character in the string.
    Same as \c{at(0)} or front().

    This function is provided for compatibility with other Qt containers.

    \warning Calling this function on an empty string constitutes
    undefined behavior.

    \sa last(), front(), back()
*/

/*!
    \fn QLatin1Char QLatin1StringView::back() const
    \since 5.10

    Returns the last character in the string.
    Same as \c{at(size() - 1)}.

    This function is provided for STL compatibility.

    \warning Calling this function on an empty string constitutes
    undefined behavior.

    \sa front(), at(), operator[]()
*/

/*!
    \fn QLatin1Char QLatin1StringView::last() const
    \since 6.4

    Returns the last character in the string.
    Same as \c{at(size() - 1)} or back().

    This function is provided for compatibility with other Qt containers.

    \warning Calling this function on an empty string constitutes
    undefined behavior.

    \sa first(), back(), front()
*/

/*!
    \fn int QLatin1StringView::compare(QStringView str, Qt::CaseSensitivity cs) const
    \fn int QLatin1StringView::compare(QLatin1StringView l1, Qt::CaseSensitivity cs) const
    \fn int QLatin1StringView::compare(QChar ch) const
    \fn int QLatin1StringView::compare(QChar ch, Qt::CaseSensitivity cs) const
    \since 5.14

    Compares this string view with UTF-16 string view \a str, Latin-1 string view \a l1,
    or the character \a ch, respectively. Returns a negative integer if this
    string is less than \a str, \a l1 or \a ch, returns a positive integer if it
    is greater than \a str, \a l1 or \a ch, and zero if they are equal.

    \include qstring.qdocinc {search-comparison-case-sensitivity} {search}

    \sa operator==(), operator<(), operator>()
*/

/*!
    \fn int QLatin1StringView::compare(QUtf8StringView str, Qt::CaseSensitivity cs) const
    \since 6.5

    Compares this string view with \a str and returns a negative integer if
    this string view is less than \a str, a positive integer if it is greater than
    \a str, and zero if they are equal.

    \include qstring.qdocinc {search-comparison-case-sensitivity} {comparison}

    \sa operator==(), operator<(), operator>()
*/


/*!
    \fn bool QLatin1StringView::startsWith(QStringView str, Qt::CaseSensitivity cs) const
    \since 5.10
    \fn bool QLatin1StringView::startsWith(QLatin1StringView l1, Qt::CaseSensitivity cs) const
    \since 5.10
    \fn bool QLatin1StringView::startsWith(QChar ch) const
    \since 5.10
    \fn bool QLatin1StringView::startsWith(QChar ch, Qt::CaseSensitivity cs) const
    \since 5.10

    Returns \c true if this Latin-1 string view starts with the UTF-16
    string viewed by \a str, the Latin-1 string viewed by \a l1, or the
    character \a ch, respectively; otherwise returns \c false.

   \include qstring.qdocinc {search-comparison-case-sensitivity} {search}

    \sa endsWith()
*/

/*!
    \fn bool QLatin1StringView::endsWith(QStringView str, Qt::CaseSensitivity cs) const
    \since 5.10
    \fn bool QLatin1StringView::endsWith(QLatin1StringView l1, Qt::CaseSensitivity cs) const
    \since 5.10
    \fn bool QLatin1StringView::endsWith(QChar ch) const
    \since 5.10
    \fn bool QLatin1StringView::endsWith(QChar ch, Qt::CaseSensitivity cs) const
    \since 5.10

    Returns \c true if this Latin-1 string view ends with the UTF-16 string
    viewed \a str, the Latin-1 string viewed by \a l1, or the character \a ch,
    respectively; otherwise returns \c false.

    \include qstring.qdocinc {search-comparison-case-sensitivity} {search}

    \sa startsWith()
*/

/*!
    \fn qsizetype QLatin1StringView::indexOf(QStringView str, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
    \fn qsizetype QLatin1StringView::indexOf(QLatin1StringView l1, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
    \fn qsizetype QLatin1StringView::indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
    \since 5.14

    Returns the index position in this Latin-1 string view of the first
    occurrence of the UTF-16 string viewed by \a str, the Latin-1 string
    viewed by \a l1, or the character \a ch, respectively, searching forward
    from index position \a from. Returns -1 if \a str, \a l1 or \a c is not
    found, respectively.

    \include qstring.qdocinc {search-comparison-case-sensitivity} {search}

    \include qstring.qdocinc negative-index-start-search-from-end

    \sa QString::indexOf()
*/

/*!
    \fn bool QLatin1StringView::contains(QStringView str, Qt::CaseSensitivity cs) const
    \fn bool QLatin1StringView::contains(QLatin1StringView l1, Qt::CaseSensitivity cs) const
    \fn bool QLatin1StringView::contains(QChar c, Qt::CaseSensitivity cs) const
    \since 5.14

    Returns \c true if this Latin-1 string view contains an occurrence of the
    UTF-16 string viewed by \a str, the Latin-1 string viewed by \a l1, or the
    character \a ch, respectively; otherwise returns \c false.

    \include qstring.qdocinc {search-comparison-case-sensitivity} {search}

    \sa indexOf(), QStringView::contains(), QStringView::indexOf(),
    QString::indexOf()
*/

/*!
    \fn qsizetype QLatin1StringView::lastIndexOf(QStringView str, qsizetype from, Qt::CaseSensitivity cs) const
    \fn qsizetype QLatin1StringView::lastIndexOf(QLatin1StringView l1, qsizetype from, Qt::CaseSensitivity cs) const
    \fn qsizetype QLatin1StringView::lastIndexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs) const
    \since 5.14

    Returns the index position in this Latin-1 string view of the last
    occurrence of the UTF-16 string viewed by \a str, the Latin-1 string
    viewed by \a l1, or the character \a ch, respectively, searching backward
    from index position \a from; returns -1 if \a str, \a l1 or \a ch is not
    found, respectively.

    \include qstring.qdocinc negative-index-start-search-from-end

    \include qstring.qdocinc {search-comparison-case-sensitivity} {search}

    \note When searching for a 0-length \a str or \a l1, the match at
    the end of the data is excluded from the search by a negative \a
    from, even though \c{-1} is normally thought of as searching from
    the end of the string: the match at the end is \e after the last
    character, so it is excluded. To include such a final empty match,
    either give a positive value for \a from or omit the \a from
    parameter entirely.

    \sa indexOf(), QStringView::lastIndexOf(), QStringView::indexOf(),
    QString::indexOf()
*/

/*!
    \fn qsizetype QLatin1StringView::lastIndexOf(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
    \fn qsizetype QLatin1StringView::lastIndexOf(QLatin1StringView l1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
    \since 6.2
    \overload lastIndexOf()

    Returns the index position in this Latin-1 string view of the last
    occurrence of the UTF-16 string viewed by \a str or the Latin-1 string
    viewed by \a l1, respectively. Returns -1 if \a str or \a l1 is not found,
    respectively.

    \include qstring.qdocinc {search-comparison-case-sensitivity} {search}
*/

/*!
    \fn qsizetype QLatin1StringView::lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const
    \since 6.3
    \overload
*/

/*!
    \fn qsizetype QLatin1StringView::count(QStringView str, Qt::CaseSensitivity cs) const
    \fn qsizetype QLatin1StringView::count(QLatin1StringView l1, Qt::CaseSensitivity cs) const
    \fn qsizetype QLatin1StringView::count(QChar ch, Qt::CaseSensitivity cs) const
    \since 6.4

    Returns the number of (potentially overlapping) occurrences of the
    UTF-16 string viewed by \a str, the Latin-1 string viewed by \a l1,
    or the character \a ch, respectively, in this string view.

    \include qstring.qdocinc {search-comparison-case-sensitivity} {search}

    \sa contains(), indexOf()
*/

/*!
    \fn QLatin1StringView::const_iterator QLatin1StringView::begin() const
    \since 5.10

    Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the
    first character in the string.

    This function is provided for STL compatibility.

    \sa end(), cbegin(), rbegin(), data()
*/

/*!
    \fn QLatin1StringView::const_iterator QLatin1StringView::cbegin() const
    \since 5.10

    Same as begin().

    This function is provided for STL compatibility.

    \sa cend(), begin(), crbegin(), data()
*/

/*!
    \fn QLatin1StringView::const_iterator QLatin1StringView::constBegin() const
    \since 6.4

    Same as begin().

    This function is provided for compatibility with other Qt containers.

    \sa constEnd(), begin(), cbegin(), data()
*/

/*!
    \fn QLatin1StringView::const_iterator QLatin1StringView::end() const
    \since 5.10

    Returns a const \l{STL-style iterators}{STL-style iterator} pointing just
    after the last character in the string.

    This function is provided for STL compatibility.

    \sa begin(), cend(), rend()
*/

/*! \fn QLatin1StringView::const_iterator QLatin1StringView::cend() const
    \since 5.10

    Same as end().

    This function is provided for STL compatibility.

    \sa cbegin(), end(), crend()
*/

/*! \fn QLatin1StringView::const_iterator QLatin1StringView::constEnd() const
    \since 6.4

    Same as end().

    This function is provided for compatibility with other Qt containers.

    \sa constBegin(), end(), cend(), crend()
*/

/*!
    \fn QLatin1StringView::const_reverse_iterator QLatin1StringView::rbegin() const
    \since 5.10

    Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing
    to the first character in the string, in reverse order.

    This function is provided for STL compatibility.

    \sa rend(), crbegin(), begin()
*/

/*!
    \fn QLatin1StringView::const_reverse_iterator QLatin1StringView::crbegin() const
    \since 5.10

    Same as rbegin().

    This function is provided for STL compatibility.

    \sa crend(), rbegin(), cbegin()
*/

/*!
    \fn QLatin1StringView::const_reverse_iterator QLatin1StringView::rend() const
    \since 5.10

    Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing just
    after the last character in the string, in reverse order.

    This function is provided for STL compatibility.

    \sa rbegin(), crend(), end()
*/

/*!
    \fn QLatin1StringView::const_reverse_iterator QLatin1StringView::crend() const
    \since 5.10

    Same as rend().

    This function is provided for STL compatibility.

    \sa crbegin(), rend(), cend()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::mid(qsizetype start, qsizetype length) const
    \since 5.8

    Returns the substring of length \a length starting at position
    \a start in this Latin-1 string view.

    If you know that \a start and \a length cannot be out of bounds, use
    sliced() instead in new code, because it is faster.

    Returns an empty Latin-1 string view if \a start exceeds the length
    of this string view. If there are less than \a length characters available
    in this string view starting at \a start, or if \a length is negative
    (default), the function returns all characters that are available from
    \a start.

    \sa first(), last(), sliced(), chopped(), chop(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::left(qsizetype length) const
    \since 5.8

    If you know that \a length cannot be out of bounds, use first() instead in
    new code, because it is faster.

    Returns the substring of length \a length starting at position
    0 in this Latin-1 string view.

    The entire Latin-1 string view is returned if \a length is greater
    than or equal to size(), or less than zero.

    \sa first(), last(), sliced(), startsWith(), chopped(), chop(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::right(qsizetype length) const
    \since 5.8

    If you know that \a length cannot be out of bounds, use last() instead in
    new code, because it is faster.

    Returns the substring of length \a length starting at position
    size() - \a length in this Latin-1 string view.

    The entire Latin-1 string view is returned if \a length is greater
    than or equal to size(), or less than zero.

    \sa first(), last(), sliced(), endsWith(), chopped(), chop(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::first(qsizetype n) const
    \since 6.0

    Returns a Latin-1 string view that contains the first \a n characters
    of this string view.

    \note The behavior is undefined when \a n < 0 or \a n > size().

    \sa last(), startsWith(), chopped(), chop(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::last(qsizetype n) const
    \since 6.0

    Returns a Latin-1 string view that contains the last \a n characters
    of this string view.

    \note The behavior is undefined when \a n < 0 or \a n > size().

    \sa first(), endsWith(), chopped(), chop(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::sliced(qsizetype pos, qsizetype n) const
    \since 6.0

    Returns a Latin-1 string view that points to \a n characters of this
    string view, starting at position \a pos.

//! [UB-sliced-index-length]
    \note The behavior is undefined when \a pos < 0, \a n < 0,
    or \c{pos + n > size()}.
//! [UB-sliced-index-length]

    \sa first(), last(), chopped(), chop(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::sliced(qsizetype pos) const
    \since 6.0

    Returns a Latin-1 string view starting at position \a pos in this
    string view, and extending to its end.

//! [UB-sliced-index-only]
    \note The behavior is undefined when \a pos < 0 or \a pos > size().
//! [UB-sliced-index-only]

    \sa first(), last(), chopped(), chop(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::chopped(qsizetype length) const
    \since 5.10

    Returns the substring of length size() - \a length starting at the
    beginning of this object.

    Same as \c{left(size() - length)}.

    \note The behavior is undefined when \a length < 0 or \a length > size().

    \sa sliced(), first(), last(), chop(), truncate()
*/

/*!
    \fn void QLatin1StringView::truncate(qsizetype length)
    \since 5.10

    Truncates this string to length \a length.

    Same as \c{*this = left(length)}.

    \note The behavior is undefined when \a length < 0 or \a length > size().

    \sa sliced(), first(), last(), chopped(), chop()
*/

/*!
    \fn void QLatin1StringView::chop(qsizetype length)
    \since 5.10

    Truncates this string by \a length characters.

    Same as \c{*this = left(size() - length)}.

    \note The behavior is undefined when \a length < 0 or \a length > size().

    \sa sliced(), first(), last(), chopped(), truncate()
*/

/*!
    \fn QLatin1StringView QLatin1StringView::trimmed() const
    \since 5.10

    Strips leading and trailing whitespace and returns the result.

    Whitespace means any character for which QChar::isSpace() returns
    \c true. This includes the ASCII characters '\\t', '\\n', '\\v',
    '\\f', '\\r', and ' '.
*/

/*!
    \fn bool QLatin1StringView::operator==(const QLatin1StringView &lhs, const char * const &rhs)
    \since 4.3

    Returns \c true if the string \a lhs is equal to const char pointer \a rhs;
    otherwise returns \c false.

    The \a rhs const char pointer is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.

    \sa {Comparing Strings}
*/

/*!
    \fn bool QLatin1StringView::operator==(const QLatin1StringView &lhs, const QByteArray &rhs)
    \since 5.0
    \overload

    The \a rhs byte array is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.
*/

/*!
    \fn bool QLatin1StringView::operator!=(const QLatin1StringView &lhs, const char * const &rhs)
    \since 4.3

    Returns \c true if the string \a lhs is not equal to const char pointer \a rhs;
    otherwise returns \c false.

    The \a rhs const char pointer is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.

    \sa {Comparing Strings}
*/

/*!
    \fn bool QLatin1StringView::operator!=(const QLatin1StringView &lhs, const QByteArray &rhs)
    \since 5.0
    \overload operator!=()

    The \a rhs byte array is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.
*/

/*!
    \fn bool QLatin1StringView::operator>(const QLatin1StringView &lhs, const char * const &rhs)
    \since 4.3

    Returns \c true if the string \a lhs is lexically greater than const char pointer
    \a rhs; otherwise returns \c false.

    The \a rhs const char pointer is converted to a QUtf8StringView.

    You can disable this operator by defining \l QT_NO_CAST_FROM_ASCII
    when you compile your applications. This can be useful if you want
    to ensure that all user-visible strings go through QObject::tr(),
    for example.

    \sa {Comparing Strings}
*/

/*!
    \fn bool QLatin1StringView::operator>(const QLatin1StringView &lhs, const QByteArray &rhs)
    \since 5.0
    \overload

    The \a rhs byte array is converted to a QUtf8StringView.

    You can disable this operator by defining \l QT_NO_CAST_FROM_ASCII
    when you compile your applications. This can be useful if you want
    to ensure that all user-visible strings go through QObject::tr(),
    for example.
*/

/*!
    \fn bool QLatin1StringView::operator<(const QLatin1StringView &lhs, const char * const &rhs)
    \since 4.3

    Returns \c true if the string \a lhs is lexically less than const char pointer
    \a rhs; otherwise returns \c false.

    The \a rhs const char pointer is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.

    \sa {Comparing Strings}
*/

/*!
    \fn bool QLatin1StringView::operator<(const QLatin1StringView &lhs, const QByteArray &rhs)
    \since 5.0
    \overload

    The \a rhs byte array is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.
*/

/*!
    \fn bool QLatin1StringView::operator>=(const QLatin1StringView &lhs, const char * const &rhs)
    \since 4.3

    Returns \c true if the string \a lhs is lexically greater than or equal to
    const char pointer \a rhs; otherwise returns \c false.

    The \a rhs const char pointer is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.

    \sa {Comparing Strings}
*/

/*!
    \fn bool QLatin1StringView::operator>=(const QLatin1StringView &lhs, const QByteArray &rhs)
    \since 5.0
    \overload

    The \a rhs byte array is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.
*/

/*!
    \fn bool QLatin1StringView::operator<=(const QLatin1StringView &lhs, const char * const &rhs)
    \since 4.3

    Returns \c true if the string \a lhs is lexically less than or equal to
    const char pointer \a rhs; otherwise returns \c false.

    The \a rhs const char pointer is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.

    \sa {Comparing Strings}
*/

/*!
    \fn bool QLatin1StringView::operator<=(const QLatin1StringView &lhs, const QByteArray &rhs)
    \since 5.0
    \overload

    The \a rhs byte array is converted to a QUtf8StringView.

    You can disable this operator by defining
    \l QT_NO_CAST_FROM_ASCII when you compile your applications. This
    can be useful if you want to ensure that all user-visible strings
    go through QObject::tr(), for example.
*/

/*! \fn bool QLatin1StringView::operator==(const QLatin1StringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string \a lhs is lexically equal to string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator!=(const QLatin1StringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string \a lhs is lexically not equal to string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<(const QLatin1StringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string \a lhs is lexically less than string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<=(const QLatin1StringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string \a lhs is lexically less than or equal to
    string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>(const QLatin1StringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string \a lhs is lexically greater than string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>=(const QLatin1StringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string \a lhs is lexically greater than or equal
    to string \a rhs; otherwise returns \c false.
*/

/*! \fn bool QLatin1StringView::operator==(const QChar &lhs, const QLatin1StringView &rhs)

    Returns \c true if char \a lhs is lexically equal to string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<(const QChar &lhs, const QLatin1StringView &rhs)

    Returns \c true if char \a lhs is lexically less than string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>(const QChar &lhs, const QLatin1StringView &rhs)
    Returns \c true if char \a lhs is lexically greater than string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator!=(const QChar &lhs, const QLatin1StringView &rhs)

    Returns \c true if char \a lhs is lexically not equal to string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<=(const QChar &lhs, const QLatin1StringView &rhs)

    Returns \c true if char \a lhs is lexically less than or equal to
    string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>=(const QChar &lhs, const QLatin1StringView &rhs)

    Returns \c true if char \a lhs is lexically greater than or equal to
    string \a rhs; otherwise returns \c false.
*/

/*! \fn bool QLatin1StringView::operator==(const QLatin1StringView &lhs, const QChar &rhs)

    Returns \c true if string \a lhs is lexically equal to char \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<(const QLatin1StringView &lhs, const QChar &rhs)

    Returns \c true if string \a lhs is lexically less than char \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>(const QLatin1StringView &lhs, const QChar &rhs)

    Returns \c true if string \a lhs is lexically greater than char \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator!=(const QLatin1StringView &lhs, const QChar &rhs)

    Returns \c true if string \a lhs is lexically not equal to char \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<=(const QLatin1StringView &lhs, const QChar &rhs)

    Returns \c true if string \a lhs is lexically less than or equal to
    char \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>=(const QLatin1StringView &lhs, const QChar &rhs)

    Returns \c true if string \a lhs is lexically greater than or equal to
    char \a rhs; otherwise returns \c false.
*/

/*! \fn bool QLatin1StringView::operator==(const QStringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string view \a lhs is lexically equal to string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<(const QStringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string view \a lhs is lexically less than string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>(const QStringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string view \a lhs is lexically greater than string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator!=(const QStringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string view \a lhs is lexically not equal to string \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<=(const QStringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string view \a lhs is lexically less than or equal to
    string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>=(const QStringView &lhs, const QLatin1StringView &rhs)

    Returns \c true if string view \a lhs is lexically greater than or equal to
    string \a rhs; otherwise returns \c false.
*/

/*! \fn bool QLatin1StringView::operator==(const QLatin1StringView &lhs, const QStringView &rhs)

    Returns \c true if string \a lhs is lexically equal to string view \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<(const QLatin1StringView &lhs, const QStringView &rhs)

    Returns \c true if string \a lhs is lexically less than string view \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>(const QLatin1StringView &lhs, const QStringView &rhs)

    Returns \c true if string \a lhs is lexically greater than string view \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator!=(const QLatin1StringView &lhs, const QStringView &rhs)

    Returns \c true if string \a lhs is lexically not equal to string view \a rhs;
    otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<=(const QLatin1StringView &lhs, const QStringView &rhs)

    Returns \c true if string \a lhs is lexically less than or equal to
    string view \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>=(const QLatin1StringView &lhs, const QStringView &rhs)

    Returns \c true if string \a lhs is lexically greater than or equal to
    string view \a rhs; otherwise returns \c false.
*/

/*! \fn bool QLatin1StringView::operator==(const char * const &lhs, const QLatin1StringView &rhs)

    Returns \c true if const char pointer \a lhs is lexically equal to
    string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<(const char * const &lhs, const QLatin1StringView &rhs)

    Returns \c true if const char pointer \a lhs is lexically less than
    string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>(const char * const &lhs, const QLatin1StringView &rhs)

    Returns \c true if const char pointer \a lhs is lexically greater than
    string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator!=(const char * const &lhs, const QLatin1StringView &rhs)

    Returns \c true if const char pointer \a lhs is lexically not equal to
    string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator<=(const char * const &lhs, const QLatin1StringView &rhs)

    Returns \c true if const char pointer \a lhs is lexically less than or
    equal to string \a rhs; otherwise returns \c false.
*/
/*! \fn bool QLatin1StringView::operator>=(const char * const &lhs, const QLatin1StringView &rhs)

    Returns \c true if const char pointer \a lhs is lexically greater than or
    equal to string \a rhs; otherwise returns \c false.
*/

/*!
    \fn qlonglong QLatin1StringView::toLongLong(bool *ok, int base) const
    \fn qulonglong QLatin1StringView::toULongLong(bool *ok, int base) const
    \fn int QLatin1StringView::toInt(bool *ok, int base) const
    \fn uint QLatin1StringView::toUInt(bool *ok, int base) const
    \fn long QLatin1StringView::toLong(bool *ok, int base) const
    \fn ulong QLatin1StringView::toULong(bool *ok, int base) const
    \fn short QLatin1StringView::toShort(bool *ok, int base) const
    \fn ushort QLatin1StringView::toUShort(bool *ok, int base) const

    \since 6.4

    Returns this QLatin1StringView converted to a corresponding numeric value using
    base \a base, which is ten by default. Bases 0 and 2 through 36 are supported,
    using letters for digits beyond 9; A is ten, B is eleven and so on.

    If \a base is 0, the base is determined automatically using the following
    rules (in this order), if the Latin-1 string view begins with:

    \list
        \li \c "0x", the rest of it is read as hexadecimal (base 16)
        \li \c "0b", the rest of it is read as binary (base 2)
        \li \c "0", the rest of it is read as octal (base 8)
        \li otherwise it is read as decimal
    \endlist

    Returns 0 if the conversion fails.

    If \a ok is not \nullptr, failure is reported by setting *\a{ok}
    to \c false, and success by setting *\a{ok} to \c true.

//! [latin1-numeric-conversion-note]
    \note The conversion of the number is performed in the default C locale,
    regardless of the user's locale. Use QLocale to perform locale-aware
    conversions between numbers and strings.

    This function ignores leading and trailing spacing characters.
//! [latin1-numeric-conversion-note]

    \note Support for the "0b" prefix was added in Qt 6.4.
*/

/*!
    \fn double QLatin1StringView::toDouble(bool *ok) const
    \fn float QLatin1StringView::toFloat(bool *ok) const
    \since 6.4

    Returns this QLatin1StringView converted to a corresponding floating-point value.

    Returns an infinity if the conversion overflows or 0.0 if the
    conversion fails for other reasons (e.g. underflow).

    If \a ok is not \nullptr, failure is reported by setting *\a{ok}
    to \c false, and success by setting *\a{ok} to \c true.

    \warning The QLatin1StringView content may only contain valid numerical
    characters which includes the plus/minus sign, the character e used in
    scientific notation, and the decimal point. Including the unit or additional
    characters leads to a conversion error.

    \include qlatin1stringview.qdoc latin1-numeric-conversion-note
*/

/*!
    \fn Qt::Literals::StringLiterals::operator""_L1(const char *str, size_t size)

    \relates QLatin1StringView
    \since 6.4

    Literal operator that creates a QLatin1StringView out of the first \a size
    characters in the char string literal \a str.

    The following code creates a QLatin1StringView:
    \code
    using namespace Qt::Literals::StringLiterals;

    auto str = "hello"_L1;
    \endcode

    \sa Qt::Literals::StringLiterals
*/