Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qstringalgorithms_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 Intel Corporation.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:critical reason:data-parser
4
5#ifndef QSTRINGALGORITHMS_P_H
6#define QSTRINGALGORITHMS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of internal files. This header file may change from version to version
14// without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qnamespace.h>
20#include "qspan.h"
21#include "qstring.h"
22#include "qlocale_p.h" // for ascii_isspace
23
25
26template <typename StringType> struct QStringAlgorithms
27{
28 typedef typename StringType::value_type Char;
29 typedef typename StringType::size_type size_type;
30 typedef typename std::remove_cv<StringType>::type NakedStringType;
31 using ViewType =
32 std::conditional_t<std::is_same_v<StringType, QString>, QStringView, QByteArrayView>;
33 using ViewChar = typename ViewType::storage_type;
34 static const bool isConst = std::is_const<StringType>::value;
35
36 static NakedStringType aligned(const StringType &txt, qsizetype width, Char fill,
37 Qt::AlignmentFlag align, bool truncate)
38 {
39 const auto len = txt.size();
40
41 if (len == width) // nothing to do, keep sharing
42 return txt;
43
44 if (len > width) { // too long
45 if (truncate)
46 return txt.left(width);
47 else
48 return txt;
49 }
50
51 // too short, so truncate doesn't matter
52
53 return [&] {
54 NakedStringType result;
55 result.reserve(width);
56 switch (align){
57 case Qt::AlignLeft:
58 result += txt;
59 result.resize(width, fill);
60 break;
61 case Qt::AlignRight:
62 result.resize(width - len, fill);
63 result += txt;
64 break;
65 case Qt::AlignHCenter:
66 case Qt::AlignJustify:
67 case Qt::AlignAbsolute:
68 case Qt::AlignHorizontal_Mask:
69 case Qt::AlignTop:
70 case Qt::AlignBottom:
71 case Qt::AlignVCenter:
72 case Qt::AlignBaseline:
73 case Qt::AlignVertical_Mask:
74 case Qt::AlignCenter:
75 Q_UNREACHABLE();
76 };
77 return result;
78 }();
79 }
80
81 static inline bool isSpace(char ch) { return ascii_isspace(ch); }
82 static inline bool isSpace(QChar ch) { return ch.isSpace(); }
83
84 // Surrogate pairs are not handled in either of the functions below. That is
85 // not a problem because there are no space characters (Zs, Zl, Zp) outside the
86 // Basic Multilingual Plane.
87
88 static inline StringType trimmed_helper_inplace(NakedStringType &str, const Char *begin, const Char *end)
89 {
90 // in-place trimming:
91 Char *data = const_cast<Char *>(str.cbegin());
92 if (begin != data)
93 memmove(data, begin, (end - begin) * sizeof(Char));
94 str.resize(end - begin);
95 return std::move(str);
96 }
97
98 static inline StringType trimmed_helper_inplace(const NakedStringType &, const Char *, const Char *)
99 {
100 // can't happen
101 Q_UNREACHABLE_RETURN(StringType());
102 }
103
104 struct TrimPositions {
105 const Char *begin;
106 const Char *end;
107 };
108 // Returns {begin, end} where:
109 // - "begin" refers to the first non-space character
110 // - if there is a sequence of one or more space chacaters at the end,
111 // "end" refers to the first character in that sequence, otherwise
112 // "end" is str.cend()
113 [[nodiscard]] static TrimPositions trimmed_helper_positions(const StringType &str)
114 {
115 const Char *begin = str.cbegin();
116 const Char *end = str.cend();
117 // skip white space from end
118 while (begin < end && isSpace(end[-1]))
119 --end;
120 // skip white space from start
121 while (begin < end && isSpace(*begin))
122 begin++;
123 return {begin, end};
124 }
125
126 static inline StringType trimmed_helper(StringType &str)
127 {
128 const auto [begin, end] = trimmed_helper_positions(str);
129 if (begin == str.cbegin() && end == str.cend())
130 return str;
131 if (!isConst && str.isDetached())
132 return trimmed_helper_inplace(str, begin, end);
133 return StringType(begin, end - begin);
134 }
135
136 static inline StringType simplified_helper(StringType &str)
137 {
138 if (str.isEmpty())
139 return str;
140 const Char *src = str.cbegin();
141 const Char *end = str.cend();
142 NakedStringType result = isConst || !str.isDetached() ?
143 StringType(str.size(), Qt::Uninitialized) :
144 std::move(str);
145
146 Char *dst = const_cast<Char *>(result.cbegin());
147 Char *ptr = dst;
148 bool unmodified = true;
149 while (true) {
150 while (src != end && isSpace(*src))
151 ++src;
152 while (src != end && !isSpace(*src))
153 *ptr++ = *src++;
154 if (src == end)
155 break;
156 if (*src != QChar::Space)
157 unmodified = false;
158 *ptr++ = QChar::Space;
159 }
160 if (ptr != dst && ptr[-1] == QChar::Space)
161 --ptr;
162
163 qsizetype newlen = ptr - dst;
164 if (isConst && newlen == str.size() && unmodified) {
165 // nothing happened, return the original
166 return str;
167 }
168 result.resize(newlen);
169 return result;
170 }
171
172 static inline bool needsReallocate(const StringType &str, qsizetype newSize) noexcept
173 {
174 const auto capacityAtEnd = str.capacity() - str.data_ptr().freeSpaceAtBegin();
175 return newSize > capacityAtEnd;
176 }
177
178 static inline const ViewChar *asUnicodeChar(ViewType v)
179 {
180 if constexpr (sizeof(ViewChar) == sizeof(QChar))
181 return v.utf16();
182 else
183 return v.data();
184 }
185
186 static inline qsizetype newSize(StringType &src, qsizetype bsize,
187 ViewType after, QSpan<const qsizetype> indices)
188 {
189 if (bsize == after.size())
190 return src.size();
191 else if (bsize > after.size()) // shrink
192 return src.size() - indices.size() * (bsize - after.size());
193
194 // bsize < after.size()
195 const qsizetype adjust = indices.size() * (after.size() - bsize);
196 return src.size() + adjust;
197 }
198
199 // {QString,QByteArray}::resize() but without the extra checks
200 static inline void setSize(StringType &src, qsizetype newSize)
201 {
202 Q_ASSERT(src.isDetached());
203 Q_ASSERT(newSize <= src.capacity());
204
205 auto &d = src.data_ptr();
206 d.size = newSize;
207 d.data()[newSize] = '\0';
208 }
209
210 // Instead of detaching, i.e. copying the whole data array then performing the
211 // replacement, create a new buffer, copy `src` and `after` to it and swap it
212 // with `src`.
213 static inline void replace_into_copy(StringType &src, qsizetype bsize,
214 ViewType after, QSpan<const qsizetype> indices,
215 qsizetype newlen)
216 {
217 StringType tmp{newlen, Qt::Uninitialized};
218 auto *to = tmp.data_ptr().data();
219 const auto *a = asUnicodeChar(after);
220 auto *const begin = src.data_ptr().data();
221 auto *first = begin;
222
223 for (auto i : indices) {
224 to = std::copy(first, begin + i, to);
225 to = std::copy(a, a + after.size(), to);
226 first = begin + i + bsize;
227 }
228 std::copy(first, src.data_ptr().end(), to); // remainder
229 src.swap(tmp);
230 }
231
232 static inline void replace_equal_len(StringType &src, [[maybe_unused]] qsizetype bsize,
233 ViewType after, QSpan<const qsizetype> indices)
234 {
235 Q_ASSERT(bsize == after.size());
236 Q_ASSERT(!src.data_ptr().needsDetach());
237
238 const auto *a = asUnicodeChar(after);
239 auto *const begin = src.data_ptr().data();
240 // before and after have the same length, so no reallocation
241 for (auto i : indices)
242 std::copy(a, a + after.size(), begin + i);
243 }
244
245 static inline void replace_shrink(StringType &src, qsizetype bsize, ViewType after,
246 QSpan<const qsizetype> indices)
247 {
248 Q_ASSERT(bsize > after.size());
249 Q_ASSERT(!src.data_ptr().needsDetach());
250
251 const auto *a = asUnicodeChar(after);
252 auto *const begin = src.data_ptr().data(); // data(), without the detach() check
253 auto *const end = begin + src.size();
254 Q_ASSERT(!indices.isEmpty());
255 auto *to = std::copy(a, a + after.size(), begin + indices.front());
256 auto *first = begin + indices.front() + bsize;
257 for (qsizetype i = 1; i < indices.size(); ++i) {
258 auto *last = begin + indices[i];
259 to = std::copy(first, last, to);
260 qsizetype adjust = i * (bsize - after.size());
261 to = std::copy(a, a + after.size(), last - adjust);
262 first = begin + indices[i] + bsize;
263 }
264 to = std::copy(first, end, to);
265 setSize(src,to - begin);
266 }
267
268 static inline void replace_grow(StringType &src, qsizetype bsize, ViewType after,
269 QSpan<const qsizetype> indices, qsizetype newlen)
270 {
271 Q_ASSERT(after.size() > bsize);
272 Q_ASSERT(!src.data_ptr().needsDetach());
273
274 // replace in-place, after is longer than before, so replace from the back
275 const qsizetype oldlen = src.size();
276 const auto *a = asUnicodeChar(after);
277 setSize(src, newlen);
278 auto *const begin = src.data_ptr().data(); // data(), without the detach() check
279 auto *last = begin + oldlen;
280 auto *to = src.data_ptr().end();
281 for (auto i = indices.size() - 1; i >= 0; --i) {
282 auto *first = begin + indices[i] + bsize;
283 to = std::copy_backward(first, last, to);
284 to = std::copy_backward(a, a + after.size(), to);
285 last = begin + indices[i];
286 }
287 }
288
289 static inline void replace_helper(StringType &src, qsizetype bsize, ViewType after,
290 QSpan<const qsizetype> indices)
291 {
292 if (indices.isEmpty())
293 return;
294
295 const qsizetype newlen = newSize(src, bsize, after, indices);
296 if (src.data_ptr().needsDetach()
297 || (bsize < after.size() && needsReallocate(src, newlen))) {
298 // Instead of detaching (which would copy the whole data array) then
299 // performing the replacement, allocate a new string and copy the data
300 // over from `src` and `after` as needed.
301 replace_into_copy(src, bsize, after, indices, newlen);
302 return;
303 }
304
305 // No detaching or reallocation -> change in-place
306 if (bsize == after.size())
307 replace_equal_len(src, bsize, after, indices);
308 else if (bsize > after.size())
309 replace_shrink(src, bsize, after, indices);
310 else // bsize < after.size()
311 replace_grow(src, bsize, after, indices, newlen);
312 }
313};
314
315QT_END_NAMESPACE
316
317#endif // QSTRINGALGORITHMS_P_H
\inmodule QtCore
QDataStream & operator>>(QDataStream &in, QByteArray &ba)
Reads a byte array into ba from the stream in and returns a reference to the stream.
quint16 qChecksum(QByteArrayView data, Qt::ChecksumType standard)
Definition qlist.h:82
static QLatin1StringView scriptToCode(QLocale::Script script)
Definition qlocale.cpp:262
QString toUpper(const QString &str, bool *ok) const
static const QLocalePrivate * get(const QLocale &l)
Definition qlocale_p.h:695
QString toLower(const QString &str, bool *ok) const
quint16 languageId() const
Definition qlocale_p.h:680
static QLocale::Language codeToLanguage(QStringView code, QLocale::LanguageCodeTypes codeTypes=QLocale::AnyLanguageCode) noexcept
Definition qlocale.cpp:112
const QLocaleData *const m_data
Definition qlocale_p.h:713
QLatin1StringView scriptCode() const
Definition qlocale_p.h:690
QLocale::MeasurementSystem measurementSystem() const
Definition qlocale.cpp:3531
quint16 territoryId() const
Definition qlocale_p.h:681
static QLatin1StringView territoryToCode(QLocale::Territory territory)
Definition qlocale.cpp:270
qsizetype m_index
Definition qlocale_p.h:715
static QLocale::Territory codeToTerritory(QStringView code) noexcept
Definition qlocale.cpp:218
static std::array< char, 4 > languageToCode(QLocale::Language language, QLocale::LanguageCodeTypes codeTypes=QLocale::AnyLanguageCode)
Definition qlocale.cpp:237
static QLocale::Script codeToScript(QStringView code) noexcept
Definition qlocale.cpp:212
QLocale::NumberOptions m_numberOptions
Definition qlocale_p.h:716
QLatin1StringView territoryCode() const
Definition qlocale_p.h:692
constexpr QLocalePrivate(const QLocaleData *data, qsizetype index, QLocale::NumberOptions numberOptions=QLocale::DefaultNumberOptions, int refs=0)
Definition qlocale_p.h:674
std::array< char, 4 > languageCode(QLocale::LanguageCodeTypes codeTypes=QLocale::AnyLanguageCode) const
Definition qlocale_p.h:686
static QBasicAtomicInt s_generation
Definition qlocale_p.h:718
QByteArray bcp47Name(char separator='-') const
Definition qlocale.cpp:498
QBasicAtomicInt ref
Definition qlocale_p.h:714
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:177
qsizetype fallbackLocaleIndex() const
Definition qlocale_p.h:722
@ StringToAlternateQuotation
Definition qlocale_p.h:181
@ DateTimeToStringShort
Definition qlocale_p.h:169
@ StandaloneMonthNameLong
Definition qlocale_p.h:187
@ ListToSeparatedString
Definition qlocale_p.h:183
@ StandaloneDayNameNarrow
Definition qlocale_p.h:192
@ StandaloneMonthNameNarrow
Definition qlocale_p.h:189
@ StringToStandardQuotation
Definition qlocale_p.h:180
@ StandaloneDayNameShort
Definition qlocale_p.h:191
@ StandaloneDayNameLong
Definition qlocale_p.h:190
@ StandaloneMonthNameShort
Definition qlocale_p.h:188
virtual QLocale fallbackLocale() const
virtual QVariant query(QueryType type, QVariant &&in=QVariant()) const
Combined button and popup list for selecting options.
constexpr char ascii_space_chars[]
Definition qlocale_p.h:91
constexpr auto makeCharacterSetMatch() noexcept
Definition qlocale_p.h:100
static constexpr bool isLowerCaseAscii(char c)
static const quint16 crc_tbl[16]
QByteArray qCompress(const uchar *data, qsizetype nbytes, int compressionLevel)
ZLibOp
@ Decompression
static Q_DECL_COLD_FUNCTION const char * zlibOpAsString(ZLibOp op)
static QByteArray toCase(const QByteArray &input, QByteArray *rvalue, uchar(*lookup)(uchar))
static qsizetype q_fromPercentEncoding(QByteArrayView src, char percent, QSpan< char > buffer)
static qsizetype lastIndexOfHelper(const char *haystack, qsizetype l, const char *needle, qsizetype ol, qsizetype from)
static constexpr bool isUpperCaseAscii(char c)
static QByteArray xxflate(ZLibOp op, QArrayDataPointer< char > out, QByteArrayView input, qxp::function_ref< int(z_stream *) const > init, qxp::function_ref< int(z_stream *, size_t) const > processChunk, qxp::function_ref< void(z_stream *) const > deinit)
static constexpr uchar asciiLower(uchar c)
static qsizetype countCharHelper(QByteArrayView haystack, char needle) noexcept
static S b64_to_decoded_size(S n)
static constexpr uchar asciiUpper(uchar c)
Q_CORE_EXPORT char * qstrncpy(char *dst, const char *src, size_t len)
Q_CORE_EXPORT int qstricmp(const char *, const char *)
Q_CORE_EXPORT char * qstrdup(const char *)
Q_CORE_EXPORT char * qstrcpy(char *dst, const char *src)
Q_DECL_PURE_FUNCTION Q_CORE_EXPORT const void * qmemrchr(const void *s, int needle, size_t n) noexcept
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
#define __has_include(x)
#define __has_feature(x)
bool qt_splitLocaleName(QStringView name, QStringView *lang=nullptr, QStringView *script=nullptr, QStringView *cntry=nullptr) noexcept
Definition qlocale.cpp:666
Q_DECLARE_TYPEINFO(QLocaleId, Q_PRIMITIVE_TYPE)
constexpr bool ascii_isspace(uchar c) noexcept
Definition qlocale_p.h:740
#define ForEachQLocaleRange(X)
Definition qlocale_p.h:624
QString qt_readEscapedFormatString(QStringView format, qsizetype *idx)
Definition qlocale.cpp:729
StrayCharacterMode
@ TrailingJunkAllowed
@ TrailingJunkProhibited
constexpr qsizetype qt_repeatCount(QStringView s) noexcept
Q_CORE_EXPORT double qstrntod(const char *s00, qsizetype len, char const **se, bool *ok)
double qstrtod(const char *s00, char const **se, bool *ok)
QSimpleParsedNumber< double > qt_asciiToDouble(const char *num, qsizetype numLen, StrayCharacterMode strayCharMode=TrailingJunkProhibited)
QByteArray qdtoAscii(double d, QLocaleData::DoubleForm form, int precision, bool uppercase)
char * qulltoa2(char *p, qulonglong n, int base)
QString qdtoBasicLatin(double d, QLocaleData::DoubleForm form, int precision, bool uppercase)
QString qulltoa(qulonglong l, int base, const QStringView zero)
QSimpleParsedNumber< qulonglong > qstrntoull(const char *nptr, qsizetype size, int base)
void qt_doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *buf, qsizetype bufSize, bool &sign, int &length, int &decpt)
constexpr UcsInt unicodeForDigit(uint digit, UcsInt zero)
constexpr int wholePartSpace(double d)
QString qulltoBasicLatin(qulonglong l, int base, bool negative)
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition qsize.h:192
qregisteruint mask[Extent]
Definition qlocale_p.h:52
static constexpr int WordBits
Definition qlocale_p.h:50
static constexpr int MaxRange
Definition qlocale_p.h:51
constexpr auto maskLocation(uchar c) const noexcept
Definition qlocale_p.h:78
constexpr QCharacterSetMatch(std::string_view set) noexcept
Definition qlocale_p.h:54
constexpr bool matches(uchar c) const noexcept
Definition qlocale_p.h:63
QStringView viewListEntry(const char16_t *table, qsizetype index) const
Definition qlocale_p.h:582
char32_t ucsFirst(const char16_t *table) const
Definition qlocale_p.h:586
QString getData(const char16_t *table) const
Definition qlocale_p.h:568
QString getListEntry(const char16_t *table, qsizetype index) const
Definition qlocale_p.h:578
QStringView viewData(const char16_t *table) const
Definition qlocale_p.h:574
Descriptor for a digit sequence within a text.
Definition qlocale_p.h:453
qsizetype size() const
Returns the number of ASCII characters describing the digit sequence.
Definition qlocale_p.h:484
DigitSequence sliced(qsizetype from, qsizetype count) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qlocale_p.h:520
DigitSequence & operator=(const DigitSequence &)=default
QStringView used(const QStringView text) const
Returns the slice of text described by this digit sequence.
Definition qlocale_p.h:526
Q_DECLARE_FLAGS(Options, Option)
bool hasSign() const
Returns true precisely if the digit sequence parsed includes a leading sign.
Definition qlocale_p.h:490
bool isEmpty() const
Returns true precisely if this digit sequence represents nothing.
Definition qlocale_p.h:489
DigitSequence first(qsizetype count) const
Returns a DigitSequence describing a prefix of this.
Definition qlocale_p.h:502
QList< qsizetype > digitBounds
Definition qlocale_p.h:456
void transcribeTo(CharBuff *buff) const
Transcribes the ASCII form of this digit sequence to buff.
Definition qlocale_p.h:492
DigitSequence(DigitSequence &&)=default
DigitSequence & operator=(DigitSequence &&)=default
DigitSequence sliced(qsizetype from) const
Returns a DigitSequence describing a tail of this.
Definition qlocale_p.h:512
QStringView used(const QStringView text, qsizetype from) const
Definition qlocale_p.h:524
DigitSequence last(qsizetype count) const
Returns a DigitSequence describing a tail of this.
Definition qlocale_p.h:510
qsizetype endIndex() const
Definition qlocale_p.h:478
DigitSequence(const DigitSequence &)=default
void setZero(QStringView zero)
Definition qlocale_p.h:377
bool fractionalIsGroup() const
Definition qlocale_p.h:441
qsizetype zeroWidth() const
Definition qlocale_p.h:404
const GroupSizes & groupSizes() const
Definition qlocale_p.h:405
bool isValid(NumberMode mode) const
Definition qlocale_p.h:407
const GroupSizes grouping
Definition qlocale_p.h:371
qint8 digitValue(char32_t digit) const
Definition qlocale_p.h:420
QString positiveSign() const
Definition qlocale.cpp:1097
static float convertDoubleToFloat(double d, bool *ok)
Definition qlocale_p.h:339
QString groupSeparator() const
Definition qlocale.cpp:1056
QSimpleParsedNumber< qint64 > stringToLongLong(QStringView str, int base, QLocale::NumberOptions options) const
Definition qlocale.cpp:5116
Q_AUTOTEST_EXPORT char32_t zeroUcs() const
Definition qlocale.cpp:1076
quint8 m_grouping_least
Definition qlocale_p.h:665
QString zeroDigit() const
Definition qlocale.cpp:1071
bool numberToCLocale(QStringView s, QLocale::NumberOptions number_options, NumberMode mode, CharBuff *result) const
Returns a DigitSequence describing some portion of text starting at from.
Definition qlocale.cpp:4842
quint8 m_grouping_higher
Definition qlocale_p.h:664
QString decimalPoint() const
Definition qlocale.cpp:1051
QString doubleToString(double d, int precision=-1, DoubleForm form=DFSignificantDigits, int width=-1, unsigned flags=NoFlags) const
Definition qlocale.cpp:4052
static Q_AUTOTEST_EXPORT bool allLocaleDataRows(bool(*check)(qsizetype, const QLocaleData &))
Definition qlocale.cpp:528
quint8 m_weekend_start
Definition qlocale_p.h:661
quint8 m_currency_digits
Definition qlocale_p.h:658
QLocaleId id() const
Definition qlocale_p.h:549
QString listSeparator() const
Definition qlocale.cpp:1066
DigitSequence digitSequence(QStringView text, DigitSequence::Options flags=DigitSequence::Option::Default, qsizetype from=0) const
Definition qlocale_p.h:538
static QSimpleParsedNumber< quint64 > bytearrayToUnsLongLong(QByteArrayView num, int base)
Definition qlocale.cpp:5163
QString percentSign() const
Definition qlocale.cpp:1061
@ BlankBeforePositive
Definition qlocale_p.h:270
@ AddTrailingZeroes
Definition qlocale_p.h:267
double stringToDouble(QStringView str, bool *ok, QLocale::NumberOptions options) const
Definition qlocale.cpp:5100
QString longLongToString(qint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const
Definition qlocale.cpp:4295
@ DoubleScientificMode
Definition qlocale_p.h:281
@ DoubleStandardMode
Definition qlocale_p.h:281
@ DFSignificantDigits
Definition qlocale_p.h:261
quint8 m_first_day_of_week
Definition qlocale_p.h:660
quint8 m_weekend_end
Definition qlocale_p.h:662
quint8 m_currency_rounding
Definition qlocale_p.h:659
QString exponentSeparator() const
Definition qlocale.cpp:1102
QString negativeSign() const
Definition qlocale.cpp:1092
QSimpleParsedNumber< quint64 > stringToUnsLongLong(QStringView str, int base, QLocale::NumberOptions options) const
Definition qlocale.cpp:5127
QString unsLongLongToString(quint64 l, int precision=-1, int base=10, int width=-1, unsigned flags=NoFlags) const
Definition qlocale.cpp:4310
quint8 m_grouping_first
Definition qlocale_p.h:663
QLocaleId withLikelySubtagsAdded() const noexcept
Definition qlocale.cpp:330
QLocaleId withLikelySubtagsRemoved() const noexcept
Definition qlocale.cpp:419
ushort script_id
Definition qlocale_p.h:242
bool operator==(QLocaleId other) const noexcept
Definition qlocale_p.h:211
bool matchesAll() const noexcept
Definition qlocale_p.h:220
bool isValid() const noexcept
Definition qlocale_p.h:215
bool operator!=(QLocaleId other) const noexcept
Definition qlocale_p.h:213
bool acceptScriptTerritory(QLocaleId other) const noexcept
Definition qlocale_p.h:231
ushort territory_id
Definition qlocale_p.h:242
bool acceptLanguage(quint16 lang) const noexcept
Definition qlocale_p.h:225
ushort language_id
Definition qlocale_p.h:242
CurrencyToStringArgument(const QVariant &v, const QString &s)
Definition qlocale_p.h:138