summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qunicodetables_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qunicodetables_p.h')
-rw-r--r--src/corelib/text/qunicodetables_p.h59
1 files changed, 17 insertions, 42 deletions
diff --git a/src/corelib/text/qunicodetables_p.h b/src/corelib/text/qunicodetables_p.h
index cb7a211cb6..c453ef53e7 100644
--- a/src/corelib/text/qunicodetables_p.h
+++ b/src/corelib/text/qunicodetables_p.h
@@ -63,6 +63,15 @@ QT_BEGIN_NAMESPACE
namespace QUnicodeTables {
+enum Case {
+ LowerCase,
+ UpperCase,
+ TitleCase,
+ CaseFold,
+
+ NumCases
+};
+
struct Properties {
ushort category : 8; /* 5 used */
ushort direction : 8; /* 5 used */
@@ -70,63 +79,29 @@ struct Properties {
ushort joining : 3;
signed short digitValue : 5;
signed short mirrorDiff : 16;
- ushort lowerCaseSpecial : 1;
- signed short lowerCaseDiff : 15;
+ ushort unicodeVersion : 8; /* 5 used */
+ ushort nfQuickCheck : 8;
#ifdef Q_OS_WASM
unsigned char : 0; //wasm 64 packing trick
#endif
- ushort upperCaseSpecial : 1;
- signed short upperCaseDiff : 15;
- ushort titleCaseSpecial : 1;
- signed short titleCaseDiff : 15;
- ushort caseFoldSpecial : 1;
- signed short caseFoldDiff : 15;
- ushort unicodeVersion : 8; /* 5 used */
- ushort nfQuickCheck : 8;
+ struct {
+ ushort special : 1;
+ signed short diff : 15;
+ } cases[NumCases];
#ifdef Q_OS_WASM
unsigned char : 0; //wasm 64 packing trick
#endif
ushort graphemeBreakClass : 5; /* 5 used */
ushort wordBreakClass : 5; /* 5 used */
- ushort sentenceBreakClass : 8; /* 4 used */
ushort lineBreakClass : 6; /* 6 used */
+ ushort sentenceBreakClass : 8; /* 4 used */
ushort script : 8;
};
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept;
Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept;
-struct LowercaseTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->lowerCaseDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->lowerCaseSpecial; }
-};
-
-struct UppercaseTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->upperCaseDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->upperCaseSpecial; }
-};
-
-struct TitlecaseTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->titleCaseDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->titleCaseSpecial; }
-};
-
-struct CasefoldTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->caseFoldDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->caseFoldSpecial; }
-};
+Q_STATIC_ASSERT(sizeof(Properties) == 20);
enum GraphemeBreakClass {
GraphemeBreak_Any,