| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef CLANGCURSOR_H |
| 6 | #define CLANGCURSOR_H |
| 7 | |
| 8 | #include <QObject> |
| 9 | #include <clang-c/Index.h> |
| 10 | |
| 11 | class ClangCursor |
| 12 | { |
| 13 | public: |
| 14 | explicit ClangCursor(const CXCursor &cursor); |
| 15 | |
| 16 | QString kindName() const; |
| 17 | QString spelling() const; |
| 18 | QString displayName() const; |
| 19 | void location(QString &file, uint &line, uint &column) const; |
| 20 | QString typeName() const; |
| 21 | QString typeSpelling() const; |
| 22 | QString typeKindName() const; |
| 23 | ClangCursor sematicParent() const; |
| 24 | QString translationUnitSpelling() const; |
| 25 | bool isValid() const; |
| 26 | |
| 27 | private: |
| 28 | CXCursor cursor; |
| 29 | }; |
| 30 | |
| 31 | #endif // CLANGCURSOR_H |
| 32 |