| 1 | // Copyright (C) 2021 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 UTILITIES_H |
| 5 | #define UTILITIES_H |
| 6 | |
| 7 | #include <QtCore/qstring.h> |
| 8 | #include <QtCore/qloggingcategory.h> |
| 9 | |
| 10 | using namespace Qt::Literals::StringLiterals; |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | Q_DECLARE_LOGGING_CATEGORY(lcQdoc) |
| 15 | Q_DECLARE_LOGGING_CATEGORY(lcQdocClang) |
| 16 | |
| 17 | class INode; |
| 18 | class Location; |
| 19 | |
| 20 | namespace Utilities { |
| 21 | void startDebugging(const QString &message); |
| 22 | void stopDebugging(const QString &message); |
| 23 | bool debugging(); |
| 24 | |
| 25 | const INode *nodeForString(const QString &string); |
| 26 | QString stringForNode(const INode *node); |
| 27 | |
| 28 | QString uniqueIdentifier(const Location &loc, const QString &prefix); |
| 29 | QString separator(qsizetype wordPosition, qsizetype numberOfWords); |
| 30 | QString comma(qsizetype wordPosition, qsizetype numberOfWords); |
| 31 | QString asAsciiPrintable(const QString &name); |
| 32 | QString protect(const QString &string); |
| 33 | QStringList getInternalIncludePaths(const QString &compiler); |
| 34 | bool isGeneratedFile(const QString &path); |
| 35 | |
| 36 | static constexpr QLatin1StringView samp = "&"_L1; |
| 37 | static constexpr QLatin1StringView slt = "<"_L1; |
| 38 | static constexpr QLatin1StringView sgt = ">"_L1; |
| 39 | static constexpr QLatin1StringView squot = """_L1; |
| 40 | } |
| 41 | |
| 42 | QT_END_NAMESPACE |
| 43 | |
| 44 | #endif // UTILITIES_H |
| 45 |
