Add first cpp_type infrastructure
This commit is contained in:
parent
21c59afc71
commit
ebfa75aa8b
4 changed files with 341 additions and 0 deletions
|
|
@ -23,3 +23,19 @@ bool cppast::is_scope(cpp_entity_type type) noexcept
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cppast::is_type(cpp_entity_type type) noexcept
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
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::count:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
15
src/cpp_type.cpp
Normal file
15
src/cpp_type.cpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// 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_type.hpp>
|
||||
|
||||
#include <cppast/cpp_entity.hpp>
|
||||
#include <cppast/cpp_entity_type.hpp>
|
||||
|
||||
using namespace cppast;
|
||||
|
||||
bool detail::cpp_type_ref_predicate::operator()(const cpp_entity& e)
|
||||
{
|
||||
return is_type(e.type());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue