Browse Source

Added Cursor::get_kind_spelling

merge-requests/37/head
Florian Jung 8 years ago
parent
commit
e4009462df
  1. 4
      src/cursor.cc
  2. 1
      src/cursor.h

4
src/cursor.cc

@ -22,6 +22,10 @@ clangmm::Cursor::Kind clangmm::Cursor::get_kind() const {
return static_cast<Kind>(clang_getCursorKind(cx_cursor)); return static_cast<Kind>(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) { bool clangmm::Cursor::is_similar_kind(Kind kind, Kind other_kind) {
auto is_function_or_method=[](Kind kind) { auto is_function_or_method=[](Kind kind) {
if(kind==Kind::FunctionDecl || kind==Kind::CXXMethod || kind==Kind::FunctionTemplate) if(kind==Kind::FunctionDecl || kind==Kind::CXXMethod || kind==Kind::FunctionTemplate)

1
src/cursor.h

@ -191,6 +191,7 @@ namespace clangmm {
Cursor() { cx_cursor=clang_getNullCursor(); } Cursor() { cx_cursor=clang_getNullCursor(); }
Cursor(const CXCursor &cx_cursor) : cx_cursor(cx_cursor) {} Cursor(const CXCursor &cx_cursor) : cx_cursor(cx_cursor) {}
Kind get_kind() const; Kind get_kind() const;
std::string get_kind_spelling() const;
static bool is_similar_kind(Kind kind, Kind other_kind); static bool is_similar_kind(Kind kind, Kind other_kind);
Type get_type() const; Type get_type() const;
SourceLocation get_source_location() const; SourceLocation get_source_location() const;

Loading…
Cancel
Save