File indexing completed on 2024-05-12 04:39:19

0001 /*
0002     SPDX-FileCopyrightText: 2014 Kevin Funk <kfunk@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #include "clangdebug.h"
0008 
0009 #include "clangtypes.h"
0010 
0011 #include <language/editor/documentcursor.h>
0012 #include <language/editor/documentrange.h>
0013 
0014 // Keep in sync with declare_qt_logging_category call
0015 const QtMsgType defaultMsgType = QtInfoMsg;
0016 Q_LOGGING_CATEGORY(KDEV_CLANG, "kdevelop.plugins.clang", defaultMsgType)
0017 
0018 using namespace KDevelop;
0019 
0020 QDebug operator<<(QDebug dbg, CXString string)
0021 {
0022     dbg << ClangString(string).c_str();
0023     return dbg;
0024 }
0025 
0026 QDebug operator<<(QDebug dbg, CXSourceLocation location)
0027 {
0028     dbg << DocumentCursor(ClangLocation(location));
0029     return dbg;
0030 }
0031 
0032 QDebug operator<<(QDebug dbg, CXSourceRange range)
0033 {
0034     dbg << ClangRange(range).toDocumentRange();
0035     return dbg;
0036 }
0037 
0038 QDebug operator<<(QDebug dbg, CXCursor cursor)
0039 {
0040     return dbg << clang_getCursorKind(cursor) << clang_getCursorDisplayName(cursor) << clang_getCursorType(cursor) << clang_getCursorLocation(cursor);
0041 }
0042 
0043 QDebug operator<<(QDebug dbg, CXCursorKind kind)
0044 {
0045     return dbg << clang_getCursorKindSpelling(kind);
0046 }
0047 
0048 QDebug operator<<(QDebug dbg, CXType type)
0049 {
0050     return dbg << type.kind << clang_getTypeSpelling(type);
0051 }
0052 
0053 QDebug operator<<(QDebug dbg, CXTypeKind typeKind)
0054 {
0055     return dbg << clang_getTypeKindSpelling(typeKind);
0056 }