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/compiler_attributes.hpp
"
19
#include "
LIEF/iterators.hpp
"
20
#include "
LIEF/visibility.h
"
21
22
#include <string>
23
#include <memory>
24
#include <cstdint>
25
26
namespace
LIEF
{
27
namespace
pdb
{
28
class
Type
;
29
namespace
types
{
30
31
namespace
details
{
32
class
Method;
33
class
MethodIt;
34
}
35
38
class
LIEF_API
Method
{
39
public
:
40
class
Iterator
final
41
:
public
iterator_facade_base
<Iterator, std::forward_iterator_tag, Method,
42
std::ptrdiff_t, const Method*, const Method&> {
43
public
:
44
using
implementation
= details::MethodIt;
45
using
iterator_facade_base::operator++;
46
47
LIEF_API
Iterator
();
48
49
LIEF_API
Iterator
(std::unique_ptr<details::MethodIt> impl);
50
51
LIEF_API
Iterator
(
const
Iterator
&);
52
LIEF_API
Iterator
&
operator=
(
const
Iterator
&);
53
54
LIEF_API
Iterator
(
Iterator
&&) noexcept;
55
LIEF_API
Iterator
& operator=(
Iterator
&&) noexcept;
56
57
LIEF_API
~
Iterator
();
58
59
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
60
61
friend
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
62
return
!(LHS == RHS);
63
}
64
65
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
66
LIEF_API
Iterator
&
operator++
();
67
68
LIEF_API
const
Method
&
operator*
() const
LIEF_LIFETIMEBOUND
;
69
70
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
71
LIEF_API
const
Method
* operator->() const
LIEF_LIFETIMEBOUND
;
72
75
LIEF_API
std::unique_ptr<
Method
>
yield
();
76
77
private:
78
void
load() const;
79
80
std::unique_ptr<
details
::MethodIt> impl_;
81
mutable std::unique_ptr<
Method
> cached_;
82
};
83
84
public:
86
enum class
TYPE
{
88
VANILLA = 0x00,
89
91
VIRTUAL = 0x01,
92
94
STATIC = 0x02,
95
97
FRIEND = 0x03,
98
100
INTRODUCING_VIRTUAL = 0x04,
101
103
PURE_VIRTUAL = 0x05,
104
106
PURE_INTRODUCING_VIRTUAL = 0x06,
107
};
108
110
enum class
ACCESS
: uint8_t {
111
NONE = 0,
112
PRIVATE = 1,
113
PROTECTED = 2,
114
PUBLIC = 3,
115
};
116
117
Method
(std::unique_ptr<details::Method> impl);
118
120
std::string
name
()
const
;
121
123
TYPE
type
()
const
;
124
126
ACCESS
access
()
const
;
127
128
~Method
();
129
130
private
:
131
std::unique_ptr<details::Method> impl_;
132
};
133
134
}
135
}
136
}
137
#endif
LIEF::iterator_facade_base
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition
iterators.hpp:729
LIEF::pdb::Type
This is the base class for any PDB type.
Definition
PDB/Type.hpp:36
LIEF::pdb::types::Method::Iterator::operator++
Iterator & operator++()
LIEF::pdb::types::Method::Iterator::Iterator
Iterator(std::unique_ptr< details::MethodIt > impl)
LIEF::pdb::types::Method::Iterator::yield
std::unique_ptr< Method > yield()
Transfer ownership of the method at the current position to the caller. Returns nullptr if the iterat...
LIEF::pdb::types::Method::Iterator::operator*
const Method & operator*() const
LIEF::pdb::types::Method::Iterator::implementation
details::MethodIt implementation
Definition
PDB/types/Method.hpp:44
LIEF::pdb::types::Method::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::pdb::types::Method::Iterator::Iterator
Iterator(const Iterator &)
LIEF::pdb::types::Method::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::pdb::types::Method::Iterator::Iterator
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:110
LIEF::pdb::types::Method::TYPE
TYPE
The type (or property) of the method.
Definition
PDB/types/Method.hpp:86
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
iterators.hpp
LIEF::pdb::types::details
Definition
PDB/types/Attribute.hpp:31
LIEF::pdb::types
Definition
PDB/types/Array.hpp:24
LIEF::pdb
Definition
BuildMetadata.hpp:25
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0