qlocale_icu.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qlocale_icu.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6typedef int32_t (*Ptr_u_strToCase)(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, UErrorCode *pErrorCode);-
7-
8-
9static bool qt_u_strToCase(const QString &str, QString *out, const char *localeID, Ptr_u_strToCase caseFunc)-
10{-
11 ((!(out)) ? qt_assert("out",__FILE__,56) : qt_noop());-
12-
13 int32_t size = str.size();-
14 size += size >> 2;-
15 QString result(size, Qt::Uninitialized);-
16-
17 UErrorCode status = U_ZERO_ERROR;-
18-
19 size = caseFunc(reinterpret_cast<UChar *>(result.data()), result.size(),-
20 reinterpret_cast<const UChar *>(str.constData()), str.size(),-
21 localeID, &status);-
22-
23 if (U_FAILURE(status)
U_FAILURE(status)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QString
&& status != U_BUFFER_OVERFLOW_ERROR
status != U_BU...OVERFLOW_ERRORDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-8
24 return
never executed: return false;
false;
never executed: return false;
0
25-
26 if (size < result.size()
size < result.size()Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QString
) {
0-8
27 result.resize(size);-
28 }
never executed: end of block
else if (size > result.size()
size > result.size()Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QString
) {
0-8
29-
30 result.resize(size);-
31-
32 status = U_ZERO_ERROR;-
33 size = caseFunc(reinterpret_cast<UChar *>(result.data()), result.size(),-
34 reinterpret_cast<const UChar *>(str.constData()), str.size(),-
35 localeID, &status);-
36-
37 if (U_FAILURE(status)
U_FAILURE(status)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
38 return
never executed: return false;
false;
never executed: return false;
0
39-
40-
41 if (size != result.size()
size != result.size()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
42 return
never executed: return false;
false;
never executed: return false;
0
43 }
never executed: end of block
0
44-
45 *out = result;-
46 return
executed 8 times by 1 test: return true;
Executed by:
  • tst_QString
true;
executed 8 times by 1 test: return true;
Executed by:
  • tst_QString
8
47}-
48-
49QString QIcu::toUpper(const QByteArray &localeID, const QString &str, bool *ok)-
50{-
51 QString out;-
52 bool err = qt_u_strToCase(str, &out, localeID, u_strToUpper_52);-
53 if (ok
okDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QString
FALSEnever evaluated
)
0-3
54 *
executed 3 times by 1 test: *ok = err;
Executed by:
  • tst_QString
ok = err;
executed 3 times by 1 test: *ok = err;
Executed by:
  • tst_QString
3
55 return
executed 3 times by 1 test: return out;
Executed by:
  • tst_QString
out;
executed 3 times by 1 test: return out;
Executed by:
  • tst_QString
3
56}-
57-
58QString QIcu::toLower(const QByteArray &localeID, const QString &str, bool *ok)-
59{-
60 QString out;-
61 bool err = qt_u_strToCase(str, &out, localeID, u_strToLower_52);-
62 if (ok
okDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QString
FALSEnever evaluated
)
0-5
63 *
executed 5 times by 1 test: *ok = err;
Executed by:
  • tst_QString
ok = err;
executed 5 times by 1 test: *ok = err;
Executed by:
  • tst_QString
5
64 return
executed 5 times by 1 test: return out;
Executed by:
  • tst_QString
out;
executed 5 times by 1 test: return out;
Executed by:
  • tst_QString
5
65}-
66-
67-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9