Added custom method type destructor filter

This commit is contained in:
Bartek Kryza
2023-06-02 21:08:19 +02:00
parent e40dc3a60c
commit e681d1a3cc
5 changed files with 9 additions and 1 deletions

View File

@@ -262,7 +262,9 @@ tvl::value_t method_type_filter::match(
method_types_.begin(), method_types_.end(), [&m](auto mt) { method_types_.begin(), method_types_.end(), [&m](auto mt) {
switch (mt) { switch (mt) {
case config::method_type::constructor: case config::method_type::constructor:
return m.is_constructor() || m.is_destructor(); return m.is_constructor();
case config::method_type::destructor:
return m.is_destructor();
case config::method_type::assignment: case config::method_type::assignment:
return m.is_copy_assignment() || m.is_move_assignment(); return m.is_copy_assignment() || m.is_move_assignment();
case config::method_type::operator_: case config::method_type::operator_:

View File

@@ -67,6 +67,8 @@ std::string to_string(method_type mt)
switch (mt) { switch (mt) {
case method_type::constructor: case method_type::constructor:
return "constructor"; return "constructor";
case method_type::destructor:
return "destructor";
case method_type::assignment: case method_type::assignment:
return "assignment"; return "assignment";
case method_type::operator_: case method_type::operator_:

View File

@@ -39,6 +39,7 @@ enum class method_arguments { full, abbreviated, none };
enum class method_type { enum class method_type {
constructor, constructor,
destructor,
assignment, assignment,
operator_, operator_,
defaulted, defaulted,

View File

@@ -231,6 +231,8 @@ template <> struct convert<method_type> {
const auto &val = node.as<std::string>(); const auto &val = node.as<std::string>();
if (val == to_string(method_type::constructor)) if (val == to_string(method_type::constructor))
rhs = method_type::constructor; rhs = method_type::constructor;
else if (val == to_string(method_type::destructor))
rhs = method_type::destructor;
else if (val == to_string(method_type::assignment)) else if (val == to_string(method_type::assignment))
rhs = method_type::assignment; rhs = method_type::assignment;
else if (val == to_string(method_type::operator_)) else if (val == to_string(method_type::operator_))

View File

@@ -11,6 +11,7 @@ diagrams:
exclude: exclude:
method_types: method_types:
- constructor - constructor
- destructor
- operator - operator
- assignment - assignment
- static - static