summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/quuid.h
Commit message (Collapse)AuthorAgeFilesLines
* doc: Ensure GUID is declared for clangqdocMartin Smith2017-11-161-6/+6
| | | | | | | | | Clang needs to see a declaration for GUID, or it will ignore some function declarations that must be documented. Change-Id: Ic5d5a88b82c709be7f763a44994b1c077977731a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QUuid, QHttpMultipart and QHash: use QRandomGeneratorThiago Macieira2017-06-121-0/+1
| | | | | | | | | QRandomGenerator can produce more than 31 bits of data. And it uses /dev/urandom for us on Unix, so QHash does not need to duplicate that part. Change-Id: Icd0e0d4b27cb4e5eb892fffd14b52a0d91f179eb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QUuid: add fromString(QStringView/QLatin1String)Marc Mutz2017-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As for the formatting code, de-duplicate the parsing code by only parsing char*s, converting QChars to Latin-1 first in a small buffer. The QUuid(const char*) ctor performed no length checking, relying instead on the checks performed within _q_uuidFromHex(), which includes an implicit check for premature end (because NUL is not a valid token for the parser). The (QString) and (QByteArray) ctors did perform length checking. To the extent possible, this is removed, since it is handled by _q_uuidFromHex(). Failure cases need not be optimized. Only the QLatin1String overload needs to do some checking, because views in general are not NUL-terminated. The QStringView overload can just append a NUL when it converts to Latin-1. The only check I added to _q_uuidFromHex() is that for src == nullptr. It would otherwise be duplicated in several callers. While touching the internal functions, port to passing and returning by value. Saves 1.6KiB in text size on optimized GCC 6.1 Linux AMD64 builds, even though we added new API. Port some users to the new functions. Expand fromString() test. [ChangeLog][QtCore][QUuid] Added fromString(QStringView/QLatin1String). Change-Id: I519339419129550c86e0ea80514865cd6a768f5d Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Properly forward-declare the Apple types with Q_QDOCOlivier Goffart2016-05-311-1/+1
| | | | | | | | | They are needed for the header to be parsed properly with clang based qdoc. While we are at it, change the condition from Q_OS_MAC to Q_OS_DARWIN Change-Id: I2a2f9c1159f47795d9811023d67c86fec1866846 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* darwin: Simplify conversion function declarations in headersTor Arne Vestbø2016-05-031-5/+1
| | | | | | | | | | | We don't need to include Q_QDOC in the forward-declarations of the native types, and Q_FORWARD_DECLARE_OBJC_CLASS works in non-Objective-C mode as well, which means we can declare the Objective-C versions of the functions without guards. Change-Id: I32089c496b4f7ce47f0388ba3f65e0b091d1e9ee Reviewed-by: Martin Smith <martin.smith@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Forward declare the Objective C types for the documentation.Olivier Goffart2016-03-181-2/+2
| | | | | | | Required for clang doc parsing. Change-Id: Ia00717377e9524efae1266d1a01b2ef0e064b11e Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add Objective-C specific type converters to QUuid.Jake Petroules2015-11-041-0/+15
| | | | | | | | | | This patch adds the Objective-C NSUUID/CFUUIDRef converters to QUuid [ChangeLog][QtCore][Objective-C] Added NSUUID/CFUUIDRef converters for QUuid Change-Id: Ifebf6fd5ce9f46dcdc06f221e189cb1fd9079e18 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* QUuid: add missing relational operatorsMarc Mutz2015-04-041-0/+5
| | | | | | | QUuid has ==, !=, <, and >. Add <= and =>, too. Change-Id: I11a0b8028be766e2d48dc7664d935df4d327b3d3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUuid: add some noexceptMarc Mutz2015-04-041-17/+17
| | | | | Change-Id: I43647e558a761ff6e7a275e30382919ba038f467 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Add Q_DECL_RELAXED_CONSTEXPR to QUuidOlivier Goffart2014-12-111-8/+7
| | | | | | Change-Id: I0fa5806ef7a8e14b0728f0b914fa9ffd0dbad811 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* qcompilerdetection.h: add Q_COMPILER_UNIFORM_INITMarc Mutz2013-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up to now, the feature classe Uniform Initialization was subsumed by the Q_COMPILER_INITIALIZER_LISTS flag together with support for std::initializer_list. This caused at least two problems: 1. On QNX, the standard libray does not ship <initializer_list>, even though the compiler (a GCC 4.6, IIRC) supports it. But since there was only one Q_COMPILER flag for both, support for the compiler-only part of the feature had to be disabled, too. 2. MSVC 2013 supports initializer lists, but has a bug that renders full uniform initialization support, as required for QUuid, useless. By splitting the feature into two, we can separate them better, and do so in QUuid, which is the only class that currently takes advantage of uniform initialization (to provide constexpr constructors). Since Q_COMPILER_INITIALIZER_LISTS worked as a flag for uniform initialization so far, with the two known exceptions above, UNIFORM_INIT is defined whenever INITIALIZER_LIST is, except that I don't revert UNIFORM_INIT on QNX as I do for INITIALIZER_LISTS and that I expect the MSVC 2013 features to set INITIALIZER_LIST, but not UNIFORM_INIT. Task-number: QTBUG-34705 Change-Id: I81916e950a0f3aab3de7977e0326d2de3d31b14c Reviewed-by: Yuchen Deng <loaden@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qdoc: Use Q_QDOC in quuid.h to help qdocMartin Smith2013-04-031-5/+5
| | | | | | | | | | | | | Some new ctor initializers were added that use curly braces. qdoc's dumb C++ parser can't handle curly braces in the ctor area; it thinks they are the body of the function. In this update, the Q_QDOC macro is used to isolate these problems so qdoc doesn't have to deal with them. Task-number: QTBUG-30254 Change-Id: Ie318e4ac58861f4ebd8a7b9f004d2677f850436e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* 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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove QUUID_STRING from qfeatures.{h,txt}Tasuku Suzuki2012-12-051-4/+0
| | | | | | | It is too specific and relatively small Change-Id: I55ec15ecaac0692741996a5c15a111db696490cf Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@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 Q_DECL_NOTHROW to some qHash functionsThiago Macieira2012-08-201-1/+1
| | | | | | | | | | | | The hashing functions for QDateTime and QHostAddress did not get the noexcept keyword because they might allocate memory. QDateTime doesn't do it now, but it could in the future. QHostAddress does allocate memory today. Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* More qHash(T, uint) supportGiuseppe D'Angelo2012-07-231-1/+1
| | | | | | | | Add the seed to QPair, QUuid, QPersistentModelIndex's qHash(), and fix qHash documentation for them and for many other datatypes. Change-Id: I1386f3ed42ee1a832371a242ee5c82895ba92c2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-101-0/+16
|\ | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * QUuid: mark constructors constexprMarc Mutz2012-03-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See e.g. f3141c58badbd2da9eb42 for rationale. The problematic part here is the array member which in C++98 cannot be initialised in the ctor-initializer-list. For this, C++11 Uniform Initialisation is needed, for which Qt does not yet have a Q_COMPILER_* macro. I'm not sure we need one, either, since I doubt that there's a compiler that implements std::initializer_list, but not uniform initialisation. Change-Id: I4fa8f4f9db8703096358634fb2e6f5de61f0fedd Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QUuid: mark as Q_PRIMITIVE_TYPEMarc Mutz2012-04-021-1/+1
|/ | | | | | | | | | | | | | Commit 01674860ac85a42eb152092c6e99f7ad03346977 marked QUuid as Q_MOVABLE_TYPE, but it's even primitive: Every bit pattern represents a valid QUuid object (if not a valid UUID), and memcpy() can be used to obtain a valid, independent copy of the object. It might not be a POD, but its close enough. Change-Id: I0fd2d11472590688a91e9ee424732e4d5ba15df8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Add JSON support to the bootstrap libraryLars Knoll2012-02-151-1/+2
| | | | | | | | | | | The JSON support will get used in moc to support the creation of plugin metadata that's embedded into the plugin itself. Change-Id: I3bc52b16ca0a43bc8bf9141b450045c6183b7823 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* Add V3(md5) and V5(sha1) version for DCE in QUuidLiang Qi2012-01-101-2/+20
| | | | | | | | | | Add the above versions based on RFC4122 standard. Done-with: Hagen Rother Task-number: QTBUG-23071 Change-Id: Ieb90925374d1e3c85011b899b8dd3bb1a608c561 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Implement QDebug stream operators for builtin classesJędrzej Nowacki2012-01-101-0/+4
| | | | | | | | | | | QDebug stream operator was added for: QPixmap, QImage, QUuid, QBitArray, QLocale, QRegExp, QCursor, QPalette, QTextFormat, QTextLength, QIcon and QSizePolicy Change-Id: Ibcf5c9b599ba322d53cb106d8e5e157427ebe757 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Make QUuid a class.Friedemann Kleint2012-01-061-1/+2
| | | | | | | | Silence MSVC warnings about forward-declarations as class in the metatype system. Change-Id: I676662e5919585e98c87413fd8360d6f41f73631 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@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>
* Removed obsolete function QUuid::operator QString()Denis Dzyubenko2012-01-051-3/+0
| | | | | | | | | | It is a source incompatible change, but I believe it is safe to say that it is a small change, which doesn't affect many people. Change-Id: Iad11befe4cca60484cf4e04cd3049c93a4ea5faf Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Marked QUuid as Q_MOVABLE_TYPE in the metatype system.Denis Dzyubenko2012-01-041-0/+2
| | | | | | | | Change-Id: I3d343b71294ad5640636694d1a079ea9dcca6348 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* Add a qHash for QUuidOlivier Goffart2011-07-191-0/+2
| | | | | | | | Change-Id: Ib0d9a765b8db3b34aa20d510de501c72a54cacbe Reviewed-on: http://codereview.qt.nokia.com/1743 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Xizhi Zhu <xizhi.zhu@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Deprecated QUuid::toStringOlivier Goffart2011-07-151-1/+3
| | | | | | | Change-Id: I1186358df1c3f7615868725d93621608ed22ac99 Reviewed-on: http://codereview.qt.nokia.com/432 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add QUuid::toRfc4122() and fromRfc4122()Liang Qi2011-05-271-0/+2
| | | | | | | | | | | | | | | | Following the RFC4122, provide the interfaces between QUuid and QByteArray, they are simpler then toByteArray() and relevant. Thanks for the suggestion and brief code from Robin Burchell. Task-number: QTBUG-19420 Reviewed-by: joao (cherry picked from commit 06873e467d98ad60d827afae29500bf2ff783c03) Change-Id: I4623ae3363f1d5affa45de73fac616bb67a9eaa1 Reviewed-on: http://codereview.qt.nokia.com/168 Reviewed-by: Liang Qi <liang.qi@nokia.com>
* Add QUuid::toByteArray() and relevantLiang Qi2011-05-271-0/+2
| | | | | | | | | | | | | Add QUuid::toByteArray() and QUuid(const QByteArray &). Same behavior with QUuid::toString() and QUuid(const QString &). Task-number: QTBUG-19419 Reviewed-by: joao (cherry picked from commit 71f923f29e2c60444a85fc765fc582e06cb7eca4) Change-Id: I41dad65e269f739ba9ec1c27e9da96af6401356c Reviewed-on: http://codereview.qt.nokia.com/167 Reviewed-by: Liang Qi <liang.qi@nokia.com>
* Optimize QUuid::toString() and relevantLiang Qi2011-05-271-1/+1
| | | | | | | | | | | | | | | | QUuid::toString() and QUuid(const QString &) are too slow now. Task-number: QTBUG-19418 Reviewed-by: joao Reviewed-by: Denis Dzyubenko Reviewed-by: Ritt Konstantin Reviewed-by: Robin Burchell Reviewed-by: Richard J. Moore (cherry picked from commit 7ce566ed82666ac08f137f4d8590ce589d42c82a) Change-Id: I7e5bb4072f0941c20a7278a2d9766d4ef47be811 Reviewed-on: http://codereview.qt.nokia.com/166 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/+190
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