| 1 | // Copyright (C) 2023 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| 3 | |
| 4 | #ifndef QQMLSASOURCELOCATION_P_H |
| 5 | #define QQMLSASOURCELOCATION_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | |
| 17 | #include "qqmlsasourcelocation.h" |
| 18 | |
| 19 | #include <QtQml/private/qqmljssourcelocation_p.h> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | namespace QQmlSA { |
| 24 | |
| 25 | class SourceLocationPrivate |
| 26 | { |
| 27 | public: |
| 28 | static const QQmlJS::SourceLocation & |
| 29 | sourceLocation(const QQmlSA::SourceLocation &sourceLocation) |
| 30 | { |
| 31 | return reinterpret_cast<const QQmlJS::SourceLocation &>(sourceLocation.m_data); |
| 32 | } |
| 33 | |
| 34 | static QQmlSA::SourceLocation |
| 35 | createQQmlSASourceLocation(const QQmlJS::SourceLocation &jsLocation) |
| 36 | { |
| 37 | QQmlSA::SourceLocation saLocation; |
| 38 | auto &internal = reinterpret_cast<QQmlJS::SourceLocation &>(saLocation.m_data); |
| 39 | internal = jsLocation; |
| 40 | return saLocation; |
| 41 | } |
| 42 | |
| 43 | static constexpr qsizetype sizeOfSourceLocation() |
| 44 | { |
| 45 | return SourceLocation::sizeofSourceLocation; |
| 46 | } |
| 47 | }; |
| 48 | |
| 49 | } // namespace QQmlSA |
| 50 | |
| 51 | QT_END_NAMESPACE |
| 52 | |
| 53 | #endif // QQMLSASOURCELOCATION_P_H |
| 54 | |