Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
cppit
libclangmm
Commits
997d02a8
Commit
997d02a8
authored
Jan 15, 2018
by
Ole Christian Eidheim
Browse files
Added Cursor::get_all_overridden_cursors
parent
ee37617c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
src/cursor.cc
src/cursor.cc
+22
-0
src/cursor.h
src/cursor.h
+1
-0
No files found.
src/cursor.cc
View file @
997d02a8
...
...
@@ -161,6 +161,28 @@ std::vector<clangmm::Cursor> clangmm::Cursor::get_arguments() const {
return
cursors
;
}
std
::
vector
<
clangmm
::
Cursor
>
clangmm
::
Cursor
::
get_all_overridden_cursors
()
const
{
std
::
vector
<
Cursor
>
result
;
if
(
get_kind
()
!=
Kind
::
CXXMethod
)
return
result
;
class
Recursive
{
public:
static
void
overridden
(
std
::
vector
<
Cursor
>
&
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
<
size
;
++
c
)
overridden
(
result
,
cursors
[
c
],
depth
+
1
);
clang_disposeOverriddenCursors
(
cursors
);
}
};
Recursive
::
overridden
(
result
,
*
this
,
0
);
return
result
;
}
clangmm
::
Cursor
::
operator
bool
()
const
{
return
!
clang_Cursor_isNull
(
cx_cursor
);
}
...
...
src/cursor.h
View file @
997d02a8
...
...
@@ -208,6 +208,7 @@ namespace clangmm {
Cursor
get_definition
()
const
;
Cursor
get_semantic_parent
()
const
;
std
::
vector
<
Cursor
>
get_arguments
()
const
;
std
::
vector
<
Cursor
>
get_all_overridden_cursors
()
const
;
operator
bool
()
const
;
bool
operator
==
(
const
Cursor
&
rhs
)
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment