LIEF: Library to Instrument Executable Formats
Version 2.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/compiler_attributes.hpp
"
18
#include "
LIEF/iterators.hpp
"
19
#include "
LIEF/visibility.h
"
20
21
#include <memory>
22
#include <string>
23
24
25
namespace
LIEF::objc
{
26
27
namespace
details
{
28
class
IVar;
29
class
IVarIt;
30
}
31
33
class
LIEF_API
IVar
{
34
public
:
35
class
Iterator
final
36
:
public
iterator_facade_base<Iterator, std::bidirectional_iterator_tag, IVar,
37
std::ptrdiff_t, const IVar*, const IVar&> {
38
public
:
39
using
implementation
= details::IVarIt;
40
using
iterator_facade_base::operator++;
41
using
iterator_facade_base::operator--;
42
43
LIEF_API
Iterator
();
44
45
LIEF_API
Iterator
(std::unique_ptr<details::IVarIt> impl);
46
47
LIEF_API
Iterator
(
const
Iterator
&);
48
LIEF_API
Iterator
&
operator=
(
const
Iterator
&);
49
50
LIEF_API
Iterator
(
Iterator
&&) noexcept;
51
LIEF_API
Iterator
& operator=(
Iterator
&&) noexcept;
52
53
LIEF_API
~
Iterator
();
54
55
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
56
57
friend
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
58
return
!(LHS == RHS);
59
}
60
61
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
62
LIEF_API
Iterator
&
operator++
();
63
64
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
65
LIEF_API
Iterator
&
operator--
();
66
67
LIEF_API
const
IVar
&
operator*
() const
LIEF_LIFETIMEBOUND
;
68
69
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
70
LIEF_API
const
IVar
* operator->() const
LIEF_LIFETIMEBOUND
;
71
74
LIEF_API
std::unique_ptr<
IVar
>
yield
();
75
76
private:
77
void
load() const;
78
79
std::unique_ptr<
details
::IVarIt> impl_;
80
mutable std::unique_ptr<
IVar
> cached_;
81
};
82
83
public:
84
IVar
(std::unique_ptr<
details
::
IVar
> impl);
85
87
std::
string
name
() const;
88
90
std::
string
mangled_type
() const;
91
92
~
IVar
();
93
94
private:
95
std::unique_ptr<
details
::
IVar
> impl_;
96
};
97
98
}
99
100
#endif
LIEF::objc::IVar::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::objc::IVar::Iterator::implementation
details::IVarIt implementation
Definition
IVar.hpp:39
LIEF::objc::IVar::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::objc::IVar::Iterator::Iterator
Iterator()
LIEF::objc::IVar::Iterator::operator*
const IVar & operator*() const
LIEF::objc::IVar::Iterator::yield
std::unique_ptr< IVar > yield()
Transfer ownership of the ivar at the current position to the caller. Returns nullptr if the iterator...
LIEF::objc::IVar::Iterator::Iterator
Iterator(std::unique_ptr< details::IVarIt > impl)
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::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.
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
iterators.hpp
LIEF::objc::details
Definition
Category.hpp:32
LIEF::objc
Namespace related to ObjC metadata.
Definition
MachO/Binary.hpp:46
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.19.0