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
public
:
51
pointer
operator->
()
const
{
return
R.get(); }
52
53
private
:
54
value_type
R;
55
56
template
<
typename
RefT>
57
PointerProxy
(RefT &&R) : R(std::forward<RefT>(R)) {}
// NOLINT(bugprone-forwarding-reference-overload)
58
};
59
Iterator
(
const
Iterator
&);
60
Iterator
(
Iterator
&&) noexcept;
61
Iterator
(std::unique_ptr<
details
::MethodIt> impl);
62
~
Iterator
();
63
64
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
65
66
friend
LIEF_API
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
67
return
!(LHS == RHS);
68
}
69
70
Iterator
&
operator++
();
71
72
Iterator
operator++
(
int
) {
73
Iterator
tmp = *
static_cast<
Iterator
*
>
(
this
);
74
++*
static_cast<
Iterator
*
>
(
this
);
75
return
tmp;
76
}
77
78
std::unique_ptr<Method>
operator*
()
const
;
79
80
PointerProxy
operator->
()
const
{
81
return
static_cast<
const
Iterator
*
>
(
this
)->
operator
*();
82
}
83
84
private
:
85
std::unique_ptr<details::MethodIt> impl_;
86
};
87
public
:
89
enum class
TYPE
{
90
VANILLA = 0x00,
91
VIRTUAL = 0x01,
92
STATIC = 0x02,
93
FRIEND = 0x03,
94
INTRODUCING_VIRTUAL = 0x04,
95
PURE_VIRTUAL = 0x05,
96
PURE_INTRODUCING_VIRTUAL = 0x06
97
};
98
100
enum class
ACCESS
: uint8_t {
101
NONE = 0,
102
PRIVATE = 1,
103
PROTECTED = 2,
104
PUBLIC = 3
105
};
106
107
Method
(std::unique_ptr<details::Method> impl);
108
110
std::string
name
()
const
;
111
113
TYPE
type
()
const
;
114
116
ACCESS
access
()
const
;
117
118
~Method
();
119
120
private
:
121
std::unique_ptr<details::Method> impl_;
122
};
123
124
}
125
}
126
}
127
#endif
128
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:51
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:80
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:72
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:100
LIEF::pdb::types::Method::TYPE
TYPE
The type (or property) of the method.
Definition
PDB/types/Method.hpp:89
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
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.17.0