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/Method.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_METHOD_H
16
#define LIEF_PDB_TYPE_METHOD_H
17
18
#include "
LIEF/visibility.h
"
19
20
#include <string>
21
#include <memory>
22
#include <cstdint>
23
24
namespace
LIEF
{
25
namespace
pdb
{
26
class
Type
;
27
namespace
types
{
28
29
namespace
details
{
30
class
Method;
31
class
MethodIt;
32
}
33
36
class
LIEF_API
Method
{
37
public
:
38
class
LIEF_API
Iterator
{
39
public
:
40
using
iterator_category
= std::forward_iterator_tag;
41
using
value_type
= std::unique_ptr<Method>;
42
using
difference_type
= std::ptrdiff_t;
43
using
pointer
=
Method
*;
44
using
reference
=
Method
&;
45
using
implementation
= details::MethodIt;
46
47
class
LIEF_API
PointerProxy {
48
// Inspired from LLVM's iterator_facade_base
49
friend
class
Iterator
;
50
51
public
:
52
pointer
operator->
()
const
{
53
return
R.get();
54
}
55
56
private
:
57
value_type
R;
58
59
template
<
typename
RefT>
60
PointerProxy
(RefT&& R) :
61
R(
std
::forward<RefT>(R)) {
62
}
// NOLINT(bugprone-forwarding-reference-overload)
63
};
64
Iterator
(
const
Iterator
&);
65
Iterator
(
Iterator
&&) noexcept;
66
Iterator
(
std
::unique_ptr<
details
::MethodIt> impl);
67
~
Iterator
();
68
69
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
70
71
friend
LIEF_API
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
72
return
!(LHS == RHS);
73
}
74
75
Iterator
&
operator++
();
76
77
Iterator
operator++
(
int
) {
78
Iterator
tmp = *
static_cast<
Iterator
*
>
(
this
);
79
++*
static_cast<
Iterator
*
>
(
this
);
80
return
tmp;
81
}
82
83
std::unique_ptr<Method>
operator*
()
const
;
84
85
PointerProxy
operator->
()
const
{
86
return
static_cast<
const
Iterator
*
>
(
this
)->
operator
*();
87
}
88
89
private
:
90
std::unique_ptr<details::MethodIt> impl_;
91
};
92
93
public
:
95
enum class
TYPE
{
96
VANILLA = 0x00,
97
VIRTUAL = 0x01,
98
STATIC = 0x02,
99
FRIEND = 0x03,
100
INTRODUCING_VIRTUAL =
101
0x04,
102
PURE_VIRTUAL = 0x05,
103
PURE_INTRODUCING_VIRTUAL =
104
0x06,
105
};
106
108
enum class
ACCESS
: uint8_t {
109
NONE = 0,
110
PRIVATE = 1,
111
PROTECTED = 2,
112
PUBLIC = 3,
113
};
114
115
Method
(std::unique_ptr<details::Method> impl);
116
118
std::string
name
()
const
;
119
121
TYPE
type
()
const
;
122
124
ACCESS
access
()
const
;
125
126
~Method
();
127
128
private
:
129
std::unique_ptr<details::Method> impl_;
130
};
131
132
}
133
}
134
}
135
#endif
LIEF::pdb::Type
This is the base class for any PDB type.
Definition
PDB/Type.hpp:34
LIEF::pdb::types::Method::Iterator::PointerProxy
Definition
PDB/types/Method.hpp:47
LIEF::pdb::types::Method::Iterator::PointerProxy::operator->
pointer operator->() const
Definition
PDB/types/Method.hpp:52
LIEF::pdb::types::Method::Iterator::PointerProxy::Iterator
friend class Iterator
Definition
PDB/types/Method.hpp:49
LIEF::pdb::types::Method::Iterator::operator++
Iterator & operator++()
LIEF::pdb::types::Method::Iterator::value_type
std::unique_ptr< Method > value_type
Definition
PDB/types/Method.hpp:41
LIEF::pdb::types::Method::Iterator::difference_type
std::ptrdiff_t difference_type
Definition
PDB/types/Method.hpp:42
LIEF::pdb::types::Method::Iterator::operator->
PointerProxy operator->() const
Definition
PDB/types/Method.hpp:85
LIEF::pdb::types::Method::Iterator::pointer
Method * pointer
Definition
PDB/types/Method.hpp:43
LIEF::pdb::types::Method::Iterator::operator*
std::unique_ptr< Method > operator*() const
LIEF::pdb::types::Method::Iterator::reference
Method & reference
Definition
PDB/types/Method.hpp:44
LIEF::pdb::types::Method::Iterator::implementation
details::MethodIt implementation
Definition
PDB/types/Method.hpp:45
LIEF::pdb::types::Method::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::pdb::types::Method::Iterator::operator++
Iterator operator++(int)
Definition
PDB/types/Method.hpp:77
LIEF::pdb::types::Method::Iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition
PDB/types/Method.hpp:40
LIEF::pdb::types::Method::Iterator::Iterator
Iterator(const Iterator &)
LIEF::pdb::types::Method::type
TYPE type() const
Type/Properties of the method (virtual, static, etc.).
LIEF::pdb::types::Method::Method
Method(std::unique_ptr< details::Method > impl)
LIEF::pdb::types::Method::name
std::string name() const
Name of the method.
LIEF::pdb::types::Method::access
ACCESS access() const
Visibility access (public, private, ...).
LIEF::pdb::types::Method::~Method
~Method()
LIEF::pdb::types::Method::ACCESS
ACCESS
Visibility access for the method.
Definition
PDB/types/Method.hpp:108
LIEF::pdb::types::Method::TYPE
TYPE
The type (or property) of the method.
Definition
PDB/types/Method.hpp:95
LIEF::pdb::types::details
Definition
PDB/types/Attribute.hpp:29
LIEF::pdb::types
Definition
PDB/types/Array.hpp:23
LIEF::pdb
Definition
BuildMetadata.hpp:24
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
std
Definition
string.h:155
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:43
Generated by
1.17.0