LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
PDB/types/ClassLike.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_PDB_TYPE_CLASS_H
16#define LIEF_PDB_TYPE_CLASS_H
17
18#include "LIEF/visibility.h"
19#include "LIEF/PDB/Type.hpp"
22#include "LIEF/iterators.hpp"
23
24#include <type_traits>
25
26namespace LIEF {
27namespace pdb {
28namespace types {
29
32class LIEF_API ClassLike : public Type {
33 public:
34 using Type::Type;
35
38
41
43 std::string unique_name() const;
44
47
50
51 template<class T>
52 static bool classof(
53 const T*,
54 typename std::enable_if<std::is_base_of<ClassLike, T>::value>::type* = 0
55 ) {
56 return true;
57 }
58
59 ~ClassLike() override;
60};
61
62
65 public:
66 using ClassLike::ClassLike;
67
68 static bool classof(const Type* type) {
69 return type->kind() == Type::KIND::STRUCTURE;
70 }
71
72 ~Structure() override;
73};
74
76class LIEF_API Class : public ClassLike {
77 public:
78 using ClassLike::ClassLike;
79
80 static bool classof(const Type* type) {
81 return type->kind() == Type::KIND::CLASS;
82 }
83
84 ~Class() override;
85};
86
89 public:
90 using ClassLike::ClassLike;
91
92 static bool classof(const Type* type) {
93 return type->kind() == Type::KIND::INTERFACE;
94 }
95
96 ~Interface() override;
97};
98
99
100}
101}
102}
103#endif
Definition iterators.hpp:567
@ INTERFACE
Definition PDB/Type.hpp:104
@ STRUCTURE
Definition PDB/Type.hpp:103
@ CLASS
Definition PDB/Type.hpp:94
KIND kind() const
This class abstracts the following PDB types: LF_STRUCTURE, LF_INTERFACE, LF_CLASS or LF_UNION.
Definition PDB/types/ClassLike.hpp:32
iterator_range< Method::Iterator > methods_iterator
Methods iterator.
Definition PDB/types/ClassLike.hpp:40
methods_iterator methods() const
Iterator over the different methods implemented in this class-type type.
static bool classof(const T *, typename std::enable_if< std::is_base_of< ClassLike, T >::value >::type *=0)
Definition PDB/types/ClassLike.hpp:52
iterator_range< Attribute::Iterator > attributes_iterator
Attributes iterator.
Definition PDB/types/ClassLike.hpp:37
std::string unique_name() const
Mangled type name.
attributes_iterator attributes() const
Iterator over the different attributes defined in this class-like type.
Interface for the LF_CLASS PDB type.
Definition PDB/types/ClassLike.hpp:76
static bool classof(const Type *type)
Definition PDB/types/ClassLike.hpp:80
Interface for the LF_INTERFACE PDB type.
Definition PDB/types/ClassLike.hpp:88
static bool classof(const Type *type)
Definition PDB/types/ClassLike.hpp:92
Interface for the LF_STRUCTURE PDB type.
Definition PDB/types/ClassLike.hpp:64
static bool classof(const Type *type)
Definition PDB/types/ClassLike.hpp:68
Definition PDB/types/Array.hpp:23
Definition BuildMetadata.hpp:24
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:43