| 1 | // Copyright (C) 2019 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #if !defined(QMETAOBJECT_P_H) && !defined(UTILS_H) |
| 5 | # error "Include qmetaobject_p.h (or moc's utils.h) before including this file." |
| 6 | #endif |
| 7 | |
| 8 | // |
| 9 | // W A R N I N G |
| 10 | // ------------- |
| 11 | // |
| 12 | // This file is not part of the Qt API. It exists purely as an |
| 13 | // implementation detail. This header file may change from version to |
| 14 | // version without notice, or even be removed. |
| 15 | // |
| 16 | // We mean it. |
| 17 | // |
| 18 | |
| 19 | #include <QtCore/qbytearray.h> |
| 20 | #include <QtCore/private/qglobal_p.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | // This function is shared with moc.cpp. This file should be included where needed. |
| 25 | static QByteArray normalizeTypeInternal(const char *t, const char *e) |
| 26 | { |
| 27 | int len = QtPrivate::qNormalizeType(begin: t, end: e, output: nullptr); |
| 28 | if (len == 0) |
| 29 | return QByteArray(); |
| 30 | QByteArray result(len, Qt::Uninitialized); |
| 31 | len = QtPrivate::qNormalizeType(begin: t, end: e, output: result.data()); |
| 32 | Q_ASSERT(len == result.size()); |
| 33 | return result; |
| 34 | } |
| 35 | |
| 36 | QT_END_NAMESPACE |
| 37 | |