-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathcpp_member_function.cpp
65 lines (50 loc) · 1.37 KB
/
cpp_member_function.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (C) 2017-2023 Jonathan Müller and cppast contributors
// SPDX-License-Identifier: MIT
#include <cppast/cpp_member_function.hpp>
#include <cppast/cpp_entity_kind.hpp>
using namespace cppast;
std::string cpp_member_function_base::do_get_signature() const
{
auto result = cpp_function_base::do_get_signature();
if (is_const(cv_qualifier()))
result += " const";
if (is_volatile(cv_qualifier()))
result += " volatile";
if (ref_qualifier() == cpp_ref_lvalue)
result += " &";
else if (ref_qualifier() == cpp_ref_rvalue)
result += " &&";
return result;
}
cpp_entity_kind cpp_member_function::kind() noexcept
{
return cpp_entity_kind::member_function_t;
}
cpp_entity_kind cpp_member_function::do_get_entity_kind() const noexcept
{
return kind();
}
cpp_entity_kind cpp_conversion_op::kind() noexcept
{
return cpp_entity_kind::conversion_op_t;
}
cpp_entity_kind cpp_conversion_op::do_get_entity_kind() const noexcept
{
return kind();
}
cpp_entity_kind cpp_constructor::kind() noexcept
{
return cpp_entity_kind::constructor_t;
}
cpp_entity_kind cpp_constructor::do_get_entity_kind() const noexcept
{
return kind();
}
cpp_entity_kind cpp_destructor::kind() noexcept
{
return cpp_entity_kind::destructor_t;
}
cpp_entity_kind cpp_destructor::do_get_entity_kind() const noexcept
{
return kind();
}