From e4009462df355ee833cfc9b398e2355836610d03 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 7 Feb 2018 11:44:50 +0100 Subject: [PATCH] Added Cursor::get_kind_spelling --- src/cursor.cc | 4 ++++ src/cursor.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/cursor.cc b/src/cursor.cc index a4b942a..9b01b9c 100644 --- a/src/cursor.cc +++ b/src/cursor.cc @@ -22,6 +22,10 @@ clangmm::Cursor::Kind clangmm::Cursor::get_kind() const { return static_cast(clang_getCursorKind(cx_cursor)); } +std::string clangmm::Cursor::get_kind_spelling() const { + return to_string(clang_getCursorKindSpelling(clang_getCursorKind(cx_cursor))); +} + bool clangmm::Cursor::is_similar_kind(Kind kind, Kind other_kind) { auto is_function_or_method=[](Kind kind) { if(kind==Kind::FunctionDecl || kind==Kind::CXXMethod || kind==Kind::FunctionTemplate) diff --git a/src/cursor.h b/src/cursor.h index c0d7982..4d521f8 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -191,6 +191,7 @@ namespace clangmm { Cursor() { cx_cursor=clang_getNullCursor(); } Cursor(const CXCursor &cx_cursor) : cx_cursor(cx_cursor) {} Kind get_kind() const; + std::string get_kind_spelling() const; static bool is_similar_kind(Kind kind, Kind other_kind); Type get_type() const; SourceLocation get_source_location() const;