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/iterators.hpp
"
18
#include "
LIEF/visibility.h
"
19
20
#include <memory>
21
#include <string>
22
23
24
namespace
LIEF::objc
{
25
26
namespace
details
{
27
class
IVar;
28
class
IVarIt;
29
}
30
32
class
LIEF_API
IVar
{
33
public
:
34
class
Iterator
final
35
:
public
iterator_facade_base
<Iterator, std::bidirectional_iterator_tag, IVar,
36
std::ptrdiff_t, const IVar*, const IVar&> {
37
public
:
38
using
implementation
= details::IVarIt;
39
using
iterator_facade_base::operator++;
40
using
iterator_facade_base::operator--;
41
42
LIEF_API
Iterator
();
43
44
LIEF_API
Iterator
(std::unique_ptr<details::IVarIt> impl);
45
46
LIEF_API
Iterator
(
const
Iterator
&);
47
LIEF_API
Iterator
&
operator=
(
const
Iterator
&);
48
49
LIEF_API
Iterator
(
Iterator
&&) noexcept;
50
LIEF_API
Iterator
& operator=(
Iterator
&&) noexcept;
51
52
LIEF_API
~
Iterator
();
53
54
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
55
56
friend
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
57
return
!(LHS == RHS);
58
}
59
60
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
61
LIEF_API
Iterator
&
operator++
();
62
63
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
64
LIEF_API
Iterator
&
operator--
();
65
66
LIEF_API
const
IVar
&
operator*
()
const
;
67
68
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
69
LIEF_API
const
IVar
*
operator->
()
const
;
70
73
LIEF_API
std::unique_ptr<IVar>
yield
();
74
75
private
:
76
void
load()
const
;
77
78
std::unique_ptr<details::IVarIt> impl_;
79
mutable
std::unique_ptr<IVar> cached_;
80
};
81
82
public
:
83
IVar
(std::unique_ptr<details::IVar> impl);
84
86
std::string
name
()
const
;
87
89
std::string
mangled_type
()
const
;
90
91
~IVar
();
92
93
private
:
94
std::unique_ptr<details::IVar> impl_;
95
};
96
97
}
98
99
#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:738
LIEF::objc::IVar::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::objc::IVar::Iterator::implementation
details::IVarIt implementation
Definition
IVar.hpp:38
LIEF::objc::IVar::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::objc::IVar::Iterator::operator->
const IVar * operator->() const
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::~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
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.18.0