LIEF: Library to Instrument Executable Formats
Version 0.17.4
Toggle main menu visibility
Loading...
Searching...
No Matches
install
linux
x86_64
sdk
static
include
LIEF
PDB
types
PDB/types/Method.hpp
Go to the documentation of this file.
1
/* Copyright 2022 - 2025 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
23
namespace
LIEF
{
24
namespace
pdb
{
25
class
Type
;
26
namespace
types
{
27
28
namespace
details
{
29
class
Method;
30
class
MethodIt;
31
}
32
35
class
LIEF_API
Method
{
36
public
:
37
class
LIEF_API
Iterator
{
38
public
:
39
using
iterator_category
= std::forward_iterator_tag;
40
using
value_type
= std::unique_ptr<Method>;
41
using
difference_type
= std::ptrdiff_t;
42
using
pointer
=
Method
*;
43
using
reference
=
Method
&;
44
using
implementation
= details::MethodIt;
45
46
class
LIEF_API
PointerProxy {
47
// Inspired from LLVM's iterator_facade_base
48
friend
class
Iterator
;
49
public
:
50
pointer
operator->
()
const
{
return
R.get(); }
51
52
private
:
53
value_type
R;
54
55
template
<
typename
RefT>
56
PointerProxy
(RefT &&R) : R(std::forward<RefT>(R)) {}
// NOLINT(bugprone-forwarding-reference-overload)
57
};
58
Iterator
(
const
Iterator
&);
59
Iterator
(
Iterator
&&) noexcept;
60
Iterator
(std::unique_ptr<
details
::MethodIt> impl);
61
~
Iterator
();
62
63
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
64
65
friend
LIEF_API
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
66
return
!(LHS == RHS);
67
}
68
69
Iterator
&
operator++
();
70
71
Iterator
operator++
(
int
) {
72
Iterator
tmp = *
static_cast<
Iterator
*
>
(
this
);
73
++*
static_cast<
Iterator
*
>
(
this
);
74
return
tmp;
75
}
76
77
std::unique_ptr<Method>
operator*
()
const
;
78
79
PointerProxy
operator->
()
const
{
80
return
static_cast<
const
Iterator
*
>
(
this
)->
operator
*();
81
}
82
83
private
:
84
std::unique_ptr<details::MethodIt> impl_;
85
};
86
public
:
87
Method
(std::unique_ptr<details::Method> impl);
88
90
std::string
name
()
const
;
91
92
~Method
();
93
94
private
:
95
std::unique_ptr<details::Method> impl_;
96
};
97
98
}
99
}
100
}
101
#endif
102
LIEF::pdb::Type
This is the base class for any PDB type.
Definition
PDB/Type.hpp:30
LIEF::pdb::types::Method::Iterator::PointerProxy
Definition
PDB/types/Method.hpp:46
LIEF::pdb::types::Method::Iterator::PointerProxy::operator->
pointer operator->() const
Definition
PDB/types/Method.hpp:50
LIEF::pdb::types::Method::Iterator::PointerProxy::Iterator
friend class Iterator
Definition
PDB/types/Method.hpp:48
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:40
LIEF::pdb::types::Method::Iterator::difference_type
std::ptrdiff_t difference_type
Definition
PDB/types/Method.hpp:41
LIEF::pdb::types::Method::Iterator::operator->
PointerProxy operator->() const
Definition
PDB/types/Method.hpp:79
LIEF::pdb::types::Method::Iterator::pointer
Method * pointer
Definition
PDB/types/Method.hpp:42
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:43
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::operator++
Iterator operator++(int)
Definition
PDB/types/Method.hpp:71
LIEF::pdb::types::Method::Iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition
PDB/types/Method.hpp:39
LIEF::pdb::types::Method::Iterator::Iterator
Iterator(const Iterator &)
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::~Method
~Method()
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