From 979a59647aac885049682479d31fcd2a94b3cf17 Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 21 Dec 2017 12:20:08 +0100 Subject: [PATCH] Added Cursor::Type::get_cursor --- src/cursor.cc | 4 ++++ src/cursor.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/cursor.cc b/src/cursor.cc index c8ccd98..95b60b9 100644 --- a/src/cursor.cc +++ b/src/cursor.cc @@ -10,6 +10,10 @@ clangmm::Cursor::Type clangmm::Cursor::Type::get_result() const { return Type(clang_getResultType(cx_type)); } +clangmm::Cursor clangmm::Cursor::Type::get_cursor() const { + return Cursor(clang_getTypeDeclaration(cx_type)); +} + bool clangmm::Cursor::Type::operator==(const Cursor::Type& rhs) const { return clang_equalTypes(cx_type, rhs.cx_type); } diff --git a/src/cursor.h b/src/cursor.h index bdb229d..6d6cf2e 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -182,6 +182,7 @@ namespace clangmm { Type(const CXType &cx_type) : cx_type(cx_type) {} std::string get_spelling() const; Type get_result() const; + Cursor get_cursor() const; bool operator==(const Cursor::Type& rhs) const; CXType cx_type;