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
ObjC
IVar.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_OBJC_IVAR_H
16
#define LIEF_OBJC_IVAR_H
17
#include <
LIEF/visibility.h
>
18
#include <
LIEF/ObjC/Method.hpp
>
19
#include <
LIEF/ObjC/Property.hpp
>
20
#include <
LIEF/iterators.hpp
>
21
22
#include <memory>
23
#include <string>
24
25
namespace
LIEF
{
26
namespace
objc
{
27
28
namespace
details
{
29
class
IVar;
30
class
IVarIt;
31
}
32
34
class
LIEF_API
IVar
{
35
public
:
36
class
LIEF_API
Iterator
{
37
public
:
38
using
iterator_category
= std::bidirectional_iterator_tag;
39
using
value_type
= std::unique_ptr<IVar>;
40
using
difference_type
= std::ptrdiff_t;
41
using
pointer
=
IVar
*;
42
using
reference
= std::unique_ptr<IVar>&;
43
using
implementation
= details::IVarIt;
44
45
class
LIEF_API
PointerProxy {
46
// Inspired from LLVM's iterator_facade_base
47
friend
class
Iterator
;
48
49
public
:
50
pointer
operator->
()
const
{
51
return
R.get();
52
}
53
54
private
:
55
value_type
R;
56
57
template
<
typename
RefT>
58
PointerProxy
(RefT&& R) :
59
R(
std
::forward<RefT>(R)) {
60
}
// NOLINT(bugprone-forwarding-reference-overload)
61
};
62
63
Iterator
(
const
Iterator
&);
64
Iterator
(
Iterator
&&) noexcept;
65
Iterator
(
std
::unique_ptr<
details
::IVarIt> impl);
66
~
Iterator
();
67
68
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
69
70
friend
LIEF_API
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
71
return
!(LHS == RHS);
72
}
73
74
Iterator
&
operator++
();
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
Iterator
operator++
(
int
) {
84
Iterator
tmp = *
static_cast<
Iterator
*
>
(
this
);
85
++*
static_cast<
Iterator
*
>
(
this
);
86
return
tmp;
87
}
88
89
std::unique_ptr<IVar>
operator*
()
const
;
90
91
PointerProxy
operator->
()
const
{
92
return
static_cast<
const
Iterator
*
>
(
this
)->
operator
*();
93
}
94
95
private
:
96
std::unique_ptr<details::IVarIt> impl_;
97
};
98
99
public
:
100
IVar
(std::unique_ptr<details::IVar> impl);
101
103
std::string
name
()
const
;
104
106
std::string
mangled_type
()
const
;
107
108
~IVar
();
109
110
private
:
111
std::unique_ptr<details::IVar> impl_;
112
};
113
114
}
115
}
116
#endif
Method.hpp
Property.hpp
LIEF::objc::IVar::Iterator::PointerProxy
Definition
IVar.hpp:45
LIEF::objc::IVar::Iterator::PointerProxy::operator->
pointer operator->() const
Definition
IVar.hpp:50
LIEF::objc::IVar::Iterator::PointerProxy::Iterator
friend class Iterator
Definition
IVar.hpp:47
LIEF::objc::IVar::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::objc::IVar::Iterator::implementation
details::IVarIt implementation
Definition
IVar.hpp:43
LIEF::objc::IVar::Iterator::operator*
std::unique_ptr< IVar > operator*() const
LIEF::objc::IVar::Iterator::difference_type
std::ptrdiff_t difference_type
Definition
IVar.hpp:40
LIEF::objc::IVar::Iterator::reference
std::unique_ptr< IVar > & reference
Definition
IVar.hpp:42
LIEF::objc::IVar::Iterator::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition
IVar.hpp:38
LIEF::objc::IVar::Iterator::operator--
Iterator operator--(int)
Definition
IVar.hpp:77
LIEF::objc::IVar::Iterator::operator++
Iterator operator++(int)
Definition
IVar.hpp:83
LIEF::objc::IVar::Iterator::operator->
PointerProxy operator->() const
Definition
IVar.hpp:91
LIEF::objc::IVar::Iterator::operator--
Iterator & operator--()
LIEF::objc::IVar::Iterator::Iterator
Iterator(const Iterator &)
LIEF::objc::IVar::Iterator::operator++
Iterator & operator++()
LIEF::objc::IVar::Iterator::pointer
IVar * pointer
Definition
IVar.hpp:41
LIEF::objc::IVar::Iterator::value_type
std::unique_ptr< IVar > value_type
Definition
IVar.hpp:39
LIEF::objc::IVar::~IVar
~IVar()
LIEF::objc::IVar::mangled_type
std::string mangled_type() const
Type of the instance var in its mangled representation ([29i]).
LIEF::objc::IVar::IVar
IVar(std::unique_ptr< details::IVar > impl)
LIEF::objc::IVar::name
std::string name() const
Name of the instance variable.
iterators.hpp
LIEF::objc::details
Definition
ObjC/Class.hpp:32
LIEF::objc
Namespace related to ObjC metadata.
Definition
MachO/Binary.hpp:41
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