From 997d02a8de78ff879577a3522e1de5ebec9802e7 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 15 Jan 2018 06:37:23 +0100 Subject: [PATCH] Added Cursor::get_all_overridden_cursors --- src/cursor.cc | 22 ++++++++++++++++++++++ src/cursor.h | 1 + 2 files changed, 23 insertions(+) diff --git a/src/cursor.cc b/src/cursor.cc index 95b60b9..a4b942a 100644 --- a/src/cursor.cc +++ b/src/cursor.cc @@ -161,6 +161,28 @@ std::vector clangmm::Cursor::get_arguments() const { return cursors; } +std::vector clangmm::Cursor::get_all_overridden_cursors() const { + std::vector result; + if(get_kind()!=Kind::CXXMethod) + return result; + + class Recursive { + public: + static void overridden(std::vector &result, const Cursor &cursor, int depth) { + if(depth>0) + result.emplace_back(cursor); + CXCursor *cursors; + unsigned size; + clang_getOverriddenCursors(cursor.cx_cursor, &cursors, &size); + for(unsigned c=0;c get_arguments() const; + std::vector get_all_overridden_cursors() const; operator bool() const; bool operator==(const Cursor& rhs) const;