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
ce0929dd
Commit
ce0929dd
authored
Feb 08, 2018
by
Florian Jung
Browse files
Added Cursor::get_children() method
parent
bb7b7984
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
src/cursor.cc
src/cursor.cc
+12
-0
src/cursor.h
src/cursor.h
+1
-0
No files found.
src/cursor.cc
View file @
ce0929dd
...
...
@@ -157,6 +157,18 @@ clangmm::Cursor clangmm::Cursor::get_semantic_parent() const {
return
Cursor
(
clang_getCursorSemanticParent
(
cx_cursor
));
}
std
::
vector
<
clangmm
::
Cursor
>
clangmm
::
Cursor
::
get_children
()
const
{
std
::
vector
<
Cursor
>
result
;
clang_visitChildren
(
cx_cursor
,
[](
CXCursor
cur
,
CXCursor
/*parent*/
,
CXClientData
data
)
{
static_cast
<
std
::
vector
<
Cursor
>*>
(
data
)
->
emplace_back
(
cur
);
return
CXChildVisit_Continue
;
},
&
result
);
return
result
;
}
std
::
vector
<
clangmm
::
Cursor
>
clangmm
::
Cursor
::
get_arguments
()
const
{
std
::
vector
<
Cursor
>
cursors
;
auto
size
=
clang_Cursor_getNumArguments
(
cx_cursor
);
...
...
src/cursor.h
View file @
ce0929dd
...
...
@@ -208,6 +208,7 @@ namespace clangmm {
Cursor
get_canonical
()
const
;
Cursor
get_definition
()
const
;
Cursor
get_semantic_parent
()
const
;
std
::
vector
<
Cursor
>
get_children
()
const
;
std
::
vector
<
Cursor
>
get_arguments
()
const
;
std
::
vector
<
Cursor
>
get_all_overridden_cursors
()
const
;
operator
bool
()
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