forked from v-yatsenko/binder-aio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype.hpp
More file actions
74 lines (43 loc) · 2.46 KB
/
type.hpp
File metadata and controls
74 lines (43 loc) · 2.46 KB
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
66
67
68
69
70
71
72
73
74
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// Copyright (c) 2016 Sergey Lyskov <[email protected]>
//
// All rights reserved. Use of this source code is governed by a
// MIT license that can be found in the LICENSE file.
/// @file binder/type.hpp
/// @brief Various functionality for handline clang::QualType and clang::NamedDecl
/// @author Sergey Lyskov
#ifndef _INCLUDED_type_hpp_
#define _INCLUDED_type_hpp_
#include <context.hpp>
#include <config.hpp>
#include <clang/AST/Decl.h>
#include <string>
namespace binder {
/// check if user requested binding for the given QualType
bool is_binding_requested(clang::QualType const &qt, Config const &config);
/// check if user requested skipping for the given QualType
bool is_skipping_requested(clang::QualType const &qt, Config const &config);
// extract include path needed for declaration itself (without template dependency if any), return empty string if no include could be found
std::string relevant_include(clang::NamedDecl const *decl);
// extract include path needed for declaration itself (without template dependency if any), do nothing if include could not be found (ie for build-in's)
void add_relevant_include_for_decl(clang::NamedDecl const *decl, IncludeSet &includes);
/// extract include needed for this generator and add it to includes vector
void add_relevant_includes(clang::QualType const &qt, /*clang::ASTContext const &context,*/ IncludeSet &includes, int level);
// check if given QualType is bindable
bool is_bindable(clang::QualType const &qt);
/// extract type info from QualType if any and bind relative type
void request_bindings(clang::QualType const &qt, Context &context);
// transform give type name to standard form
std::string standard_name(std::string const &type);
/// Attempt to simplify std:: name by removing unneded template arguments. Function assume that there is no 'std::' namespaces prefix at the beginning of the argument string
std::string simplify_std_class_name(std::string const &type);
/// check if given class/struct is builtin in Python and therefor should not be binded
bool is_python_builtin(clang::NamedDecl const *C);
// check if class/struct/function/enum is in banned symbol lists
bool is_banned_symbol(clang::NamedDecl const *D);
// check if class/struct is in banned type lists
//bool is_banned_type(clang::CXXRecordDecl const *C);
} // namespace binder
#endif // _INCLUDED_type_hpp_