summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qchar.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add QChar::Script enumKonstantin Ritt2012-12-201-0/+128
|/ | | | | | | | | | | | | | | ...where the values are not aliased to Common script. The old QUnicodeTables::Script enum was retained for compatibility reasons until Qt internals are updated to use QChar::script(). Using QChar::Script instead of QUnicodeTables::Script would improve both the text analysis (itemization, boundary finding) and the text shaping quality. This also a required step for switching to Hurfbuzz-NG. /* This adds 6668 more .rodata bytes */ Change-Id: I5aa3d12c550528d0052542436990f8d0779ea8e5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Update the Unicode Data and Algorithms up to Unicode 6.2Konstantin Ritt2012-10-091-1/+2
| | | | | | | | | | | | | Version 6.2 of the Unicode Standard is a special release dedicated to the early publication of the newly encoded Turkish lira sign. In addition, there are some significant changes to the Unicode algorithms for text segmentation and line breaking to improve breaking for emoji symbols. For more details, see http://www.unicode.org/versions/Unicode6.2.0/ Change-Id: I21cfd4f307e41b41a19d36cce87f7a44c2661bc2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Add QChar::SoftHyphen enum valueKonstantin Ritt2012-07-031-0/+1
| | | | | | | | | Just like for the QChar::ByteOrderMark, `ch == QChar::SoftHyphen` is much more readable than `ch == 0x00ad // (soft-hyphen)`, etc. Change-Id: I9c85f14cfd979037d35103c3259a435fd729b869 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Update the qunicodetables generator to deal with UCD 6.1 filesKonstantin Ritt2012-06-101-1/+5
| | | | | Change-Id: If22018ff83cfc6b9c984f689648da038fce11d84 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Deprecate {QString,QStringRef,QChar}::{to,from}AsciiThiago Macieira2012-05-221-4/+7
| | | | | | | | | | | | Make them call exactly their Latin 1 counterparts. For the QString functions that take a single char, also use fromAscii directly. Change-Id: I87645aba6ab9cde34c1df3cbc3a979fbd9e91f9d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* add some more widely-used QChar::SpecialCharacter enum valuesKonstantin Ritt2012-05-171-0/+4
| | | | | | Change-Id: Iad58f4366ba6cd6da29a268c56c8a4bc4cf0329c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QChar: add isSurrogate() and isNonCharacter() to the public APIKonstantin Ritt2012-05-161-7/+12
| | | | | | | | + QChar::LastValidCodePoint enum value that supercede the UNICODE_LAST_CODEPOINT macro replace uses of hardcoded values with the new API; remove leftovers Change-Id: I1395c9840b85fcb6b08e241b131794a98773c952 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QChar: add missing UCS-4 overloads, get rid of UCS-2 onesKonstantin Ritt2012-05-161-48/+64
| | | | | | | | | | inline all non-static members to a static ones (declared with QT_FASTCALL), ushort converts automatically to uint and the conversion cost is minimal. Task-Number: QTBUG-13052 Change-Id: I189a6f205736766adcd3de2d61cee71f30cc64f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* stop ignoring unassigned codepointsKonstantin Ritt2012-05-041-1/+1
| | | | | | | | | | in Unicode 5.1, it was clarified that unassigned codepoints normally should not be excluded from the process; moreover, unassigned codepoints assumed to be starters in decomposition by default Change-Id: Ic4a61ec3759ee62b6843c81045e1d611d0684ead Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QChar: reduce code duplication by inlining some methodsKonstantin Ritt2012-04-241-11/+11
| | | | | | | | | using templates for toLower()/toUpper()/toTitleCase()/toCaseFolded() makes the upcoming patches smaller and thus easier to review Change-Id: Ideb23e8669dbc2fe9ea3f129bf0137e1805ece11 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QChar: optimize some methods a bit for general caseKonstantin Ritt2012-04-111-16/+13
| | | | | | | | | | | | by reordering and regrouping conditions so that they lead to result earlier in most-common usecases (l.letters, spaces and puncts, u.letters, other); there are no title cased letters in range [0..127] -> use this in isTitleCase(); test for 0xa0 (nbsp) early in isSpace() as it is quite common in HTML, etc.; add early test to isNumber(). Change-Id: Ib415f34cb1212d9ccf8753de2d1beaece1aa2243 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove QT_ASCII_CAST_WARN_CONSTRUCTORStephen Kelly2012-02-231-2/+2
| | | | | | | GCC version < 3 which it was created for is not supported anymore. Change-Id: I0b4df4c99600cacbaafbf0bc4270cd4978600956 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove custom text codec for C strings.Robin Burchell2012-02-221-6/+7
| | | | | | | | | | This setting is extremely harmful, as code cannot know whether or not to expect it. It also made the behaviour of QString::fromAscii and ::toAscii unintuitive, and caused a lot of people to make mistakes with it. Change-Id: I2f429fa7ef93bd75bb93a7f64c56db15b7283388 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* replace 'const QChar &' with 'QChar ' for QChar and QStringRitt Konstantin2011-10-261-1/+1
| | | | | | | | Merge-request: 69 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Change-Id: I61f5a54b783252029fcad95677958fa6a2130d01 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Add Q_DECL_CONSTEXPR to a QChar, QLatin1Char and QLatin1String constructorsThiago Macieira2011-10-221-24/+17
| | | | | | | | These types now technically are trivially-constructible and standard-layout in C++0x. Change-Id: I455bd905fd6e237a1dff517b86dcbe59d571266f Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* fix QChar::isSpace() to handle codepoint U+0085Konstantin Ritt2011-10-061-1/+1
| | | | | | | | | | | according to the Unicode specs, code point U+0085 should be treated like a white space character (an exceptional Cc one) Change-Id: Ib17ae0c4d3cdafe667cafa38b645138ef24c238c Merge-request: 32 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-on: http://codereview.qt-project.org/6158 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Boost performance of QChar::isSpaceKent Hansen2011-09-151-1/+5
| | | | | | | | | | | | | | | | | | | | | Make it inline; add fast checks for typical spaces; add fallback function that uses the fastcall calling convention. On ia32, this change makes isSpace ~340x faster for ascii spaces, ~170x faster for non-space ascii characters, and ~1.3x faster for non-ascii characters. Note that this change is NOT binary compatible. Also add an autotest with expected results from before the optimization, to ensure that the behavior is the same. Change-Id: I9438d0ad3c9ba2e80560c4bee7eed05115265798 Reviewed-on: http://codereview.qt-project.org/4905 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Boost performance of QChar::isLetterOrNumberKent Hansen2011-09-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | Make it inline; add fast checks for ascii letters and digits; add fallback function that uses the fastcall calling convention. On ia32, this change makes isLetterOrNumber ~120x faster for ascii letters and digits, ~150x faster for non-letter/digit ascii characters, and ~1.3x faster for non-ascii characters. Note that this change is NOT binary compatible. Also add an autotest with expected results from before the optimization, to ensure that the behavior is the same. Change-Id: Ia4e13692f4dd79f6aa0b96da29449e0487971b0e Reviewed-on: http://codereview.qt-project.org/4904 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Boost performance of QChar::isLetterKent Hansen2011-09-151-1/+6
| | | | | | | | | | | | | | | | | | | | | Make it inline; add fast checks for ascii letters; add fallback function that uses the fastcall calling convention. On ia32, this change makes isLetter ~370x faster for ascii letters, ~250x faster for non-letter ascii characters, and ~1.5x faster for non-ascii characters. Note that this change is NOT binary compatible. Also add an autotest with expected results from before the optimization, to ensure that the behavior is the same. Change-Id: I06f8d3d43114537cee5567e670898cef6494c20a Reviewed-on: http://codereview.qt-project.org/4903 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Boost performance of QChar::isDigitKent Hansen2011-09-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | Make it inline; add fast checks for ascii digits; add fallback function that uses the fastcall calling convention. On ia32, this change makes isDigit ~370x faster for ascii digit characters, ~250x faster for non-digit ascii characters, and ~1.5x faster for non-ascii characters. Note that this change is NOT binary compatible. Also add an autotest with expected results from before the optimization, to ensure that the behavior is the same. Change-Id: I718fadecda3f591d6f4c22374d8e476f4724fd83 Reviewed-on: http://codereview.qt-project.org/4902 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Boost performance of QChar::is{Upper,Lower}Kent Hansen2011-09-151-2/+8
| | | | | | | | | | | | | | | | | | | | | Calling QChar::category() is slow; do some fast checks to detect ascii characters before falling back to the generic handling. On ia32, this change makes isUpper ~260x faster for uppercase ascii characters, and ~180x faster for non-uppercase ascii characters. Similar numbers for isLower. Even with the additional checks, these versions are slightly faster than before for non-ascii characters as well, since we now call the static fastcall category(ushort) function, which is faster than the category() member function (which uses the stack to pass the unicode value). Change-Id: I6ae0df466bb4835ca0d5319fd6018862c849313b Reviewed-on: http://codereview.qt-project.org/4901 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Revert "make QChar::Unicode_Unassigned a constantly big value"Olivier Goffart2011-07-151-2/+2
| | | | | | | | | | | | This reverts commit ebfd24a20b1acdced5fe032eedb2737efdc6eb92. Breaks QChar and QString autotests Change-Id: If1e915520ea491262c5f7753368be98c02ddac5e Reviewed-by: Ritt Konstantin Reviewed-on: http://codereview.qt.nokia.com/1672 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* make QChar::Unicode_Unassigned a constantly big valueRitt Konstantin2011-07-131-2/+2
| | | | | | | | this makes the version based checks a bit simpler (and thus faster) Change-Id: I975c6d043d238a5c16a4b13f8379e87fbade23cc Reviewed-on: http://codereview.qt.nokia.com/1586 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* drop a dead QChar::Punctuation_Dask enum valueRitt Konstantin2011-07-131-3/+1
| | | | | | Change-Id: I22c67ff7c08ab514a646bad86eb8cd0f41099e9c Reviewed-on: http://codereview.qt.nokia.com/1585 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* drop an obsolete QChar::NoCategory enum valueRitt Konstantin2011-07-131-2/+0
| | | | | | | | | | | | there is no such category in the Unicode specs. the QChar::NoCategory was a subject of bugs since it was introduced. int 4.6 it's meaning was limited to mention ucs4 > UNICODE_LAST_CODEPOINT only (which is useless anyways) in order to preserve the old (wrong) behavior. fix it now for qtbase Change-Id: I630534824e071090b39772881e747c1fdb758719 Reviewed-on: http://codereview.qt.nokia.com/1584 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove #ifdef for platforms where QChar was packed -- there aren't anyThiago Macieira2011-07-111-4/+0
| | | | | | | | | | | | On ARM OABI, sizeof(QChar) was 4, so we used to pack it so QChar[] was isomorphic to ushort[]. We don't support the OABI anymore and the EABI does the right thing. Change-Id: I181dd2f169f6868450302e269ef9ad5d643f306f Merge-request: 13 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/1386 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Remove Qt 4.3 binary compatibility for MSVCThiago Macieira2011-07-111-15/+0
| | | | | | | | | | | | | | | When we removed the useless "const" in the return type, we broke compatibility with a few compilers that include the return type in the mangling. We don't need that anymore in Qt 5. This change should have had a ### Qt5 mark everywhere, not just in a comment in qstring.cpp. Change-Id: I8839f8dc540b34e57a3efdb160a1c015f7328422 Merge-request: 13 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/1385 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* remove QT3_SUPPORT from corelib/toolsLars Knoll2011-06-291-27/+0
| | | | | | | Change-Id: Ie224cf992be675c7d405d4be05e4acd4157e590e Reviewed-on: http://codereview.qt.nokia.com/863 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+404
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12