aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/sourcelocation.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <friedemann.kleint@qt.io>2023-05-10 13:50:56 +0200
committerCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2025-11-24 12:06:06 +0100
commit845630ad239c4b37ff37e49ef5bb969a8946744b (patch)
tree5c65f2e270511459d346c14f0ad8d01f5e6e39a0 /sources/shiboken6/ApiExtractor/sourcelocation.cpp
parent3cf2077a1b060bbea3419ccde23c5da6485a2e24 (diff)
Move the shiboken-generator source around
THIS COMMIT WAS GENERATED BY A SCRIPT Task-number: PYSIDE-962 Task-number: PYSIDE-1587 Change-Id: I58b05c3d05606efb6303193f2d7f907a0ab5741b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/sourcelocation.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/sourcelocation.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/sources/shiboken6/ApiExtractor/sourcelocation.cpp b/sources/shiboken6/ApiExtractor/sourcelocation.cpp
deleted file mode 100644
index f13ff3422..000000000
--- a/sources/shiboken6/ApiExtractor/sourcelocation.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-#include "sourcelocation.h"
-#include <QtCore/qdir.h>
-#include <QtCore/qdebug.h>
-
-SourceLocation::SourceLocation() = default;
-
-SourceLocation::SourceLocation(const QString &file, int l)
- : m_fileName(file), m_lineNumber(l)
-{
-}
-
-bool SourceLocation::isValid() const
-{
- return m_lineNumber >= 0 && !m_fileName.isEmpty();
-}
-
-QString SourceLocation::fileName() const
-{
- return m_fileName;
-}
-
-void SourceLocation::setFileName(const QString &fileName)
-{
- m_fileName = fileName;
-}
-
-int SourceLocation::lineNumber() const
-{
- return m_lineNumber;
-}
-
-void SourceLocation::setLineNumber(int lineNumber)
-{
- m_lineNumber = lineNumber;
-}
-
-QString SourceLocation::toString() const
-{
- QString result;
- QTextStream s(&result);
- format(s);
- return result;
-}
-
-template<class Stream>
-void SourceLocation::format(Stream &s) const
-{
- if (isValid())
- s << QDir::toNativeSeparators(m_fileName) << ':' << m_lineNumber << ':';
- else
- s << "<unknown>";
-}
-
-QTextStream &operator<<(QTextStream &s, const SourceLocation &l)
-{
- if (l.isValid()) {
- l.format(s);
- s << '\t'; // ":\t" is used by ReportHandler for filtering suppressions
- }
- return s;
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const SourceLocation &l)
-{
- QDebugStateSaver saver(d);
- d.noquote();
- d.nospace();
- l.format(d);
- return d;
-}
-#endif