LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
PDB
types
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
"
20
#include "
LIEF/PDB/types/Attribute.hpp
"
21
#include "
LIEF/PDB/types/Method.hpp
"
22
#include "
LIEF/iterators.hpp
"
23
24
#include <type_traits>
25
26
namespace
LIEF
{
27
namespace
pdb
{
28
namespace
types
{
29
32
class
LIEF_API
ClassLike
:
public
Type {
33
public
:
34
using
Type::Type;
35
37
using
attributes_iterator
=
iterator_range<Attribute::Iterator>
;
38
40
using
methods_iterator
=
iterator_range<Method::Iterator>
;
41
43
std::string
unique_name
()
const
;
44
46
attributes_iterator
attributes
()
const
;
47
49
methods_iterator
methods
()
const
;
50
51
template
<
class
T>
52
static
bool
classof
(
const
T*,
typename
std::enable_if<std::is_base_of<ClassLike, T>::value>::type* = 0)
53
{
54
return
true
;
55
}
56
57
~ClassLike
()
override
;
58
};
59
60
62
class
LIEF_API
Structure
:
public
ClassLike
{
63
public
:
64
using
ClassLike::ClassLike;
65
66
static
bool
classof
(
const
Type* type) {
67
return
type->
kind
() ==
Type::KIND::STRUCTURE
;
68
}
69
70
~Structure
()
override
;
71
};
72
74
class
LIEF_API
Class
:
public
ClassLike
{
75
public
:
76
using
ClassLike::ClassLike;
77
78
static
bool
classof
(
const
Type* type) {
79
return
type->
kind
() ==
Type::KIND::CLASS
;
80
}
81
82
~Class
()
override
;
83
};
84
86
class
LIEF_API
Interface
:
public
ClassLike
{
87
public
:
88
using
ClassLike::ClassLike;
89
90
static
bool
classof
(
const
Type* type) {
91
return
type->
kind
() ==
Type::KIND::INTERFACE
;
92
}
93
94
~Interface
()
override
;
95
};
96
97
98
}
99
}
100
}
101
#endif
102
103
Type.hpp
Attribute.hpp
Method.hpp
LIEF::iterator_range
Definition
iterators.hpp:486
LIEF::pdb::Type::KIND::INTERFACE
@ INTERFACE
Definition
PDB/Type.hpp:99
LIEF::pdb::Type::KIND::STRUCTURE
@ STRUCTURE
Definition
PDB/Type.hpp:98
LIEF::pdb::Type::KIND::CLASS
@ CLASS
Definition
PDB/Type.hpp:89
LIEF::pdb::Type::kind
KIND kind() const
LIEF::pdb::types::ClassLike
This class abstracts the following PDB types: LF_STRUCTURE, LF_INTERFACE, LF_CLASS or LF_UNION.
Definition
PDB/types/ClassLike.hpp:32
LIEF::pdb::types::ClassLike::methods_iterator
iterator_range< Method::Iterator > methods_iterator
Methods iterator.
Definition
PDB/types/ClassLike.hpp:40
LIEF::pdb::types::ClassLike::methods
methods_iterator methods() const
Iterator over the different methods implemented in this class-type type.
LIEF::pdb::types::ClassLike::classof
static bool classof(const T *, typename std::enable_if< std::is_base_of< ClassLike, T >::value >::type *=0)
Definition
PDB/types/ClassLike.hpp:52
LIEF::pdb::types::ClassLike::attributes_iterator
iterator_range< Attribute::Iterator > attributes_iterator
Attributes iterator.
Definition
PDB/types/ClassLike.hpp:37
LIEF::pdb::types::ClassLike::unique_name
std::string unique_name() const
Mangled type name.
LIEF::pdb::types::ClassLike::attributes
attributes_iterator attributes() const
Iterator over the different attributes defined in this class-like type.
LIEF::pdb::types::ClassLike::~ClassLike
~ClassLike() override
LIEF::pdb::types::Class
Interface for the LF_CLASS PDB type.
Definition
PDB/types/ClassLike.hpp:74
LIEF::pdb::types::Class::classof
static bool classof(const Type *type)
Definition
PDB/types/ClassLike.hpp:78
LIEF::pdb::types::Class::~Class
~Class() override
LIEF::pdb::types::Interface
Interface for the LF_INTERFACE PDB type.
Definition
PDB/types/ClassLike.hpp:86
LIEF::pdb::types::Interface::classof
static bool classof(const Type *type)
Definition
PDB/types/ClassLike.hpp:90
LIEF::pdb::types::Interface::~Interface
~Interface() override
LIEF::pdb::types::Structure
Interface for the LF_STRUCTURE PDB type.
Definition
PDB/types/ClassLike.hpp:62
LIEF::pdb::types::Structure::classof
static bool classof(const Type *type)
Definition
PDB/types/ClassLike.hpp:66
LIEF::pdb::types::Structure::~Structure
~Structure() override
iterators.hpp
LIEF::pdb::types
Definition
PDB/types/Array.hpp:23
LIEF::pdb
Definition
BuildMetadata.hpp:24
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.17.0