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
PDB
types
PDB/types/Attribute.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_PDB_TYPE_ATTRIBUTE_H
16
#define LIEF_PDB_TYPE_ATTRIBUTE_H
17
18
#include "
LIEF/visibility.h
"
19
20
#include <cstdint>
21
#include <string>
22
#include <memory>
23
24
namespace
LIEF
{
25
namespace
pdb
{
26
class
Type
;
27
namespace
types
{
28
29
namespace
details
{
30
class
Attribute
;
31
class
AttributeIt;
32
}
33
36
class
LIEF_API
Attribute
{
37
public
:
38
class
LIEF_API
Iterator
{
39
public
:
40
using
iterator_category
= std::forward_iterator_tag;
41
using
value_type
= std::unique_ptr<Attribute>;
42
using
difference_type
= std::ptrdiff_t;
43
using
pointer
=
Attribute
*;
44
using
reference
=
Attribute
&;
45
using
implementation
= details::AttributeIt;
46
47
class
LIEF_API
PointerProxy {
48
// Inspired from LLVM's iterator_facade_base
49
friend
class
Iterator
;
50
public
:
51
pointer
operator->
()
const
{
return
R.get(); }
52
53
private
:
54
value_type
R;
55
56
template
<
typename
RefT>
57
PointerProxy
(RefT &&R) : R(std::forward<RefT>(R)) {}
// NOLINT(bugprone-forwarding-reference-overload)
58
};
59
Iterator
(
const
Iterator
&);
60
Iterator
(
Iterator
&&) noexcept;
61
Iterator
(std::unique_ptr<
details
::AttributeIt> impl);
62
~
Iterator
();
63
64
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
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<Attribute>
operator*
()
const
;
78
79
PointerProxy
operator->
()
const
{
80
return
static_cast<
const
Iterator
*
>
(
this
)->
operator
*();
81
}
82
83
private
:
84
std::unique_ptr<details::AttributeIt> impl_;
85
};
86
public
:
87
Attribute
(std::unique_ptr<details::Attribute> impl);
88
90
std::string
name
()
const
;
91
93
std::unique_ptr<Type>
type
()
const
;
94
96
uint64_t
field_offset
()
const
;
97
98
~Attribute
();
99
100
private
:
101
std::unique_ptr<details::Attribute> impl_;
102
};
103
104
}
105
}
106
}
107
#endif
108
LIEF::pdb::Type
This is the base class for any PDB type.
Definition
PDB/Type.hpp:34
LIEF::pdb::types::Attribute::Iterator::PointerProxy
Definition
PDB/types/Attribute.hpp:47
LIEF::pdb::types::Attribute::Iterator::PointerProxy::operator->
pointer operator->() const
Definition
PDB/types/Attribute.hpp:51
LIEF::pdb::types::Attribute::Iterator::PointerProxy::Iterator
friend class Iterator
Definition
PDB/types/Attribute.hpp:49
LIEF::pdb::types::Attribute::Iterator::difference_type
std::ptrdiff_t difference_type
Definition
PDB/types/Attribute.hpp:42
LIEF::pdb::types::Attribute::Iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition
PDB/types/Attribute.hpp:40
LIEF::pdb::types::Attribute::Iterator::implementation
details::AttributeIt implementation
Definition
PDB/types/Attribute.hpp:45
LIEF::pdb::types::Attribute::Iterator::operator*
std::unique_ptr< Attribute > operator*() const
LIEF::pdb::types::Attribute::Iterator::Iterator
Iterator(const Iterator &)
LIEF::pdb::types::Attribute::Iterator::value_type
std::unique_ptr< Attribute > value_type
Definition
PDB/types/Attribute.hpp:41
LIEF::pdb::types::Attribute::Iterator::reference
Attribute & reference
Definition
PDB/types/Attribute.hpp:44
LIEF::pdb::types::Attribute::Iterator::operator++
Iterator operator++(int)
Definition
PDB/types/Attribute.hpp:71
LIEF::pdb::types::Attribute::Iterator::pointer
Attribute * pointer
Definition
PDB/types/Attribute.hpp:43
LIEF::pdb::types::Attribute::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::pdb::types::Attribute::Iterator::operator++
Iterator & operator++()
LIEF::pdb::types::Attribute::Iterator::operator->
PointerProxy operator->() const
Definition
PDB/types/Attribute.hpp:79
LIEF::pdb::types::Attribute
This class represents an attribute (LF_MEMBER) in an aggregate (class, struct, union,...
Definition
PDB/types/Attribute.hpp:36
LIEF::pdb::types::Attribute::type
std::unique_ptr< Type > type() const
Type of this attribute.
LIEF::pdb::types::Attribute::~Attribute
~Attribute()
LIEF::pdb::types::Attribute::name
std::string name() const
Name of the attribute.
LIEF::pdb::types::Attribute::Attribute
Attribute(std::unique_ptr< details::Attribute > impl)
LIEF::pdb::types::Attribute::field_offset
uint64_t field_offset() const
Offset of this attribute in the aggregate.
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