Rename cpp_entity_type -> cpp_entity_kind

This commit is contained in:
Jonathan Müller 2017-01-22 12:29:24 +01:00
commit 87aba96c5b
13 changed files with 79 additions and 79 deletions

27
src/cpp_entity_kind.cpp Normal file
View file

@ -0,0 +1,27 @@
// 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_entity_kind.hpp>
using namespace cppast;
bool cppast::is_type(cpp_entity_kind type) noexcept
{
switch (type)
{
case cpp_entity_kind::enum_t:
return true;
case cpp_entity_kind::file_t:
case cpp_entity_kind::namespace_t:
case cpp_entity_kind::namespace_alias_t:
case cpp_entity_kind::using_directive_t:
case cpp_entity_kind::using_declaration_t:
case cpp_entity_kind::enum_value_t:
case cpp_entity_kind::count:
break;
}
return false;
}

View file

@ -1,27 +0,0 @@
// 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_entity_type.hpp>
using namespace cppast;
bool cppast::is_type(cpp_entity_type type) noexcept
{
switch (type)
{
case cpp_entity_type::enum_t:
return true;
case cpp_entity_type::file_t:
case cpp_entity_type::namespace_t:
case cpp_entity_type::namespace_alias_t:
case cpp_entity_type::using_directive_t:
case cpp_entity_type::using_declaration_t:
case cpp_entity_type::enum_value_t:
case cpp_entity_type::count:
break;
}
return false;
}

View file

@ -4,18 +4,18 @@
#include <cppast/cpp_enum.hpp>
#include <cppast/cpp_entity_type.hpp>
#include <cppast/cpp_entity_kind.hpp>
using namespace cppast;
cpp_entity_type cpp_enum_value::do_get_entity_type() const noexcept
cpp_entity_kind cpp_enum_value::do_get_entity_kind() const noexcept
{
return cpp_entity_type::enum_value_t;
return cpp_entity_kind::enum_value_t;
}
cpp_entity_type cpp_enum::do_get_entity_type() const noexcept
cpp_entity_kind cpp_enum::do_get_entity_kind() const noexcept
{
return cpp_entity_type::enum_t;
return cpp_entity_kind::enum_t;
}
type_safe::optional<std::string> cpp_enum::do_get_scope_name() const

View file

@ -4,11 +4,11 @@
#include <cppast/cpp_file.hpp>
#include <cppast/cpp_entity_type.hpp>
#include <cppast/cpp_entity_kind.hpp>
using namespace cppast;
cpp_entity_type cpp_file::do_get_entity_type() const noexcept
cpp_entity_kind cpp_file::do_get_entity_kind() const noexcept
{
return cpp_entity_type::file_t;
return cpp_entity_kind::file_t;
}

View file

@ -4,31 +4,31 @@
#include <cppast/cpp_namespace.hpp>
#include <cppast/cpp_entity_type.hpp>
#include <cppast/cpp_entity_kind.hpp>
using namespace cppast;
cpp_entity_type cpp_namespace::do_get_entity_type() const noexcept
cpp_entity_kind cpp_namespace::do_get_entity_kind() const noexcept
{
return cpp_entity_type::namespace_t;
return cpp_entity_kind::namespace_t;
}
bool detail::cpp_namespace_ref_predicate::operator()(const cpp_entity& e)
{
return e.type() == cpp_entity_type::namespace_t;
return e.kind() == cpp_entity_kind::namespace_t;
}
cpp_entity_type cpp_namespace_alias::do_get_entity_type() const noexcept
cpp_entity_kind cpp_namespace_alias::do_get_entity_kind() const noexcept
{
return cpp_entity_type::namespace_alias_t;
return cpp_entity_kind::namespace_alias_t;
}
cpp_entity_type cpp_using_directive::do_get_entity_type() const noexcept
cpp_entity_kind cpp_using_directive::do_get_entity_kind() const noexcept
{
return cpp_entity_type::using_directive_t;
return cpp_entity_kind::using_directive_t;
}
cpp_entity_type cpp_using_declaration::do_get_entity_type() const noexcept
cpp_entity_kind cpp_using_declaration::do_get_entity_kind() const noexcept
{
return cpp_entity_type::using_declaration_t;
return cpp_entity_kind::using_declaration_t;
}

View file

@ -6,14 +6,14 @@
#include <cppast/cpp_array_type.hpp>
#include <cppast/cpp_entity.hpp>
#include <cppast/cpp_entity_type.hpp>
#include <cppast/cpp_entity_kind.hpp>
#include <cppast/cpp_function_types.hpp>
using namespace cppast;
bool detail::cpp_type_ref_predicate::operator()(const cpp_entity& e)
{
return is_type(e.type());
return is_type(e.kind());
}
namespace

View file

@ -5,7 +5,7 @@
#include <cppast/visitor.hpp>
#include <cppast/cpp_entity.hpp>
#include <cppast/cpp_entity_type.hpp>
#include <cppast/cpp_entity_kind.hpp>
#include <cppast/cpp_enum.hpp>
#include <cppast/cpp_file.hpp>
#include <cppast/cpp_namespace.hpp>
@ -33,22 +33,22 @@ namespace
bool detail::visit(const cpp_entity& e, detail::visitor_callback_t cb, void* functor)
{
switch (e.type())
switch (e.kind())
{
case cpp_entity_type::file_t:
case cpp_entity_kind::file_t:
return handle_container<cpp_file>(e, cb, functor);
case cpp_entity_type::namespace_t:
case cpp_entity_kind::namespace_t:
return handle_container<cpp_namespace>(e, cb, functor);
case cpp_entity_type::enum_t:
case cpp_entity_kind::enum_t:
return handle_container<cpp_enum>(e, cb, functor);
case cpp_entity_type::namespace_alias_t:
case cpp_entity_type::using_directive_t:
case cpp_entity_type::using_declaration_t:
case cpp_entity_type::enum_value_t:
case cpp_entity_kind::namespace_alias_t:
case cpp_entity_kind::using_directive_t:
case cpp_entity_kind::using_declaration_t:
case cpp_entity_kind::enum_value_t:
return cb(functor, e, visitor_info::leave_entity);
case cpp_entity_type::count:
case cpp_entity_kind::count:
break;
}