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
Property.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_PROPERTY_H
16
#define LIEF_OBJC_PROPERTY_H
17
#include <
LIEF/visibility.h
>
18
19
#include <memory>
20
#include <string>
21
22
namespace
LIEF
{
23
namespace
objc
{
24
25
namespace
details
{
26
class
Property;
27
class
PropertyIt;
28
}
29
31
class
LIEF_API
Property
{
32
public
:
33
class
LIEF_API
Iterator
{
34
public
:
35
using
iterator_category
= std::bidirectional_iterator_tag;
36
using
value_type
= std::unique_ptr<Property>;
37
using
difference_type
= std::ptrdiff_t;
38
using
pointer
=
Property
*;
39
using
reference
= std::unique_ptr<Property>&;
40
using
implementation
= details::PropertyIt;
41
42
class
LIEF_API
PointerProxy {
43
// Inspired from LLVM's iterator_facade_base
44
friend
class
Iterator
;
45
46
public
:
47
pointer
operator->
()
const
{
48
return
R.get();
49
}
50
51
private
:
52
value_type
R;
53
54
template
<
typename
RefT>
55
PointerProxy
(RefT&& R) :
56
R(std::forward<RefT>(R)) {
57
}
// NOLINT(bugprone-forwarding-reference-overload)
58
};
59
60
Iterator
(
const
Iterator
&);
61
Iterator
(
Iterator
&&) noexcept;
62
Iterator
(std::unique_ptr<
details
::PropertyIt> impl);
63
~
Iterator
();
64
65
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
66
67
friend
LIEF_API
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
68
return
!(LHS == RHS);
69
}
70
71
Iterator
&
operator++
();
72
Iterator
&
operator--
();
73
74
Iterator
operator--
(
int
) {
75
Iterator
tmp = *
static_cast<
Iterator
*
>
(
this
);
76
--*
static_cast<
Iterator
*
>
(
this
);
77
return
tmp;
78
}
79
80
Iterator
operator++
(
int
) {
81
Iterator
tmp = *
static_cast<
Iterator
*
>
(
this
);
82
++*
static_cast<
Iterator
*
>
(
this
);
83
return
tmp;
84
}
85
86
std::unique_ptr<Property>
operator*
()
const
;
87
88
PointerProxy
operator->
()
const
{
89
return
static_cast<
const
Iterator
*
>
(
this
)->
operator
*();
90
}
91
92
private
:
93
std::unique_ptr<details::PropertyIt> impl_;
94
};
95
96
public
:
97
Property
(std::unique_ptr<details::Property> impl);
98
100
std::string
name
()
const
;
101
103
std::string
attribute
()
const
;
104
105
~Property
();
106
107
private
:
108
std::unique_ptr<details::Property> impl_;
109
};
110
111
}
112
}
113
#endif
LIEF::objc::Property::Iterator::PointerProxy
Definition
Property.hpp:42
LIEF::objc::Property::Iterator::PointerProxy::operator->
pointer operator->() const
Definition
Property.hpp:47
LIEF::objc::Property::Iterator::PointerProxy::Iterator
friend class Iterator
Definition
Property.hpp:44
LIEF::objc::Property::Iterator::Iterator
Iterator(const Iterator &)
LIEF::objc::Property::Iterator::difference_type
std::ptrdiff_t difference_type
Definition
Property.hpp:37
LIEF::objc::Property::Iterator::operator->
PointerProxy operator->() const
Definition
Property.hpp:88
LIEF::objc::Property::Iterator::operator++
Iterator operator++(int)
Definition
Property.hpp:80
LIEF::objc::Property::Iterator::operator++
Iterator & operator++()
LIEF::objc::Property::Iterator::operator--
Iterator & operator--()
LIEF::objc::Property::Iterator::pointer
Property * pointer
Definition
Property.hpp:38
LIEF::objc::Property::Iterator::value_type
std::unique_ptr< Property > value_type
Definition
Property.hpp:36
LIEF::objc::Property::Iterator::operator*
std::unique_ptr< Property > operator*() const
LIEF::objc::Property::Iterator::operator--
Iterator operator--(int)
Definition
Property.hpp:74
LIEF::objc::Property::Iterator::implementation
details::PropertyIt implementation
Definition
Property.hpp:40
LIEF::objc::Property::Iterator::reference
std::unique_ptr< Property > & reference
Definition
Property.hpp:39
LIEF::objc::Property::Iterator::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition
Property.hpp:35
LIEF::objc::Property::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::objc::Property::attribute
std::string attribute() const
(raw) property's attributes (e.g. T@"NSString",C,D,N)
LIEF::objc::Property::~Property
~Property()
LIEF::objc::Property::name
std::string name() const
Name of the property.
LIEF::objc::Property::Property
Property(std::unique_ptr< details::Property > impl)
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
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:43
Generated by
1.17.0