Add cpp_member_function and cpp_conversion_op

This commit is contained in:
Jonathan Müller 2017-01-24 21:15:49 +01:00
commit 03da9ceb63
5 changed files with 206 additions and 0 deletions

View file

@ -51,6 +51,10 @@ const char* cppast::to_string(cpp_entity_kind kind) noexcept
return "function parameter";
case cpp_entity_kind::function_t:
return "function";
case cpp_entity_kind::member_function_t:
return "member function";
case cpp_entity_kind::conversion_op_t:
return "conversion operator";
case cpp_entity_kind::count:
break;
@ -82,6 +86,8 @@ bool cppast::is_type(cpp_entity_kind kind) noexcept
case cpp_entity_kind::bitfield_t:
case cpp_entity_kind::function_parameter_t:
case cpp_entity_kind::function_t:
case cpp_entity_kind::member_function_t:
case cpp_entity_kind::conversion_op_t:
case cpp_entity_kind::count:
break;
}

View file

@ -0,0 +1,19 @@
// Copyright (C) 2017 Jonathan Müller <jonathanmueller.dev@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.
#include <cppast/cpp_member_function.hpp>
#include <cppast/cpp_entity_kind.hpp>
using namespace cppast;
cpp_entity_kind cpp_member_function::do_get_entity_kind() const noexcept
{
return cpp_entity_kind::member_function_t;
}
cpp_entity_kind cpp_conversion_op::do_get_entity_kind() const noexcept
{
return cpp_entity_kind::conversion_op_t;
}

View file

@ -11,6 +11,7 @@
#include <cppast/cpp_file.hpp>
#include <cppast/cpp_function.hpp>
#include <cppast/cpp_language_linkage.hpp>
#include <cppast/cpp_member_function.hpp>
#include <cppast/cpp_namespace.hpp>
using namespace cppast;
@ -50,6 +51,10 @@ bool detail::visit(const cpp_entity& e, detail::visitor_callback_t cb, void* fun
return handle_container<cpp_class>(e, cb, functor);
case cpp_entity_kind::function_t:
return handle_container<cpp_function>(e, cb, functor);
case cpp_entity_kind::member_function_t:
return handle_container<cpp_member_function>(e, cb, functor);
case cpp_entity_kind::conversion_op_t:
return handle_container<cpp_conversion_op>(e, cb, functor);
case cpp_entity_kind::namespace_alias_t:
case cpp_entity_kind::using_directive_t: