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/iterators.hpp
"
19
#include "
LIEF/visibility.h
"
20
21
#include <cstdint>
22
#include <string>
23
#include <memory>
24
25
namespace
LIEF
{
26
namespace
pdb
{
27
class
Type
;
28
namespace
types
{
29
30
namespace
details
{
31
class
Attribute
;
32
class
AttributeIt;
33
}
34
37
class
LIEF_API
Attribute
{
38
public
:
39
class
Iterator
final
40
:
public
iterator_facade_base
<Iterator, std::forward_iterator_tag, Attribute,
41
std::ptrdiff_t, const Attribute*,
42
const Attribute&> {
43
public
:
44
using
implementation
= details::AttributeIt;
45
using
iterator_facade_base::operator++;
46
47
LIEF_API
Iterator
();
48
49
LIEF_API
Iterator
(std::unique_ptr<details::AttributeIt> impl);
50
51
LIEF_API
Iterator
(
const
Iterator
&);
52
LIEF_API
Iterator
&
operator=
(
const
Iterator
&);
53
54
LIEF_API
Iterator
(
Iterator
&&) noexcept;
55
LIEF_API
Iterator
& operator=(
Iterator
&&) noexcept;
56
57
LIEF_API
~
Iterator
();
58
59
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
60
friend
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
61
return
!(LHS == RHS);
62
}
63
64
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
65
LIEF_API
Iterator
&
operator++
();
66
67
LIEF_API
const
Attribute
&
operator*
()
const
;
68
69
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
70
LIEF_API
const
Attribute
*
operator->
()
const
;
71
74
LIEF_API
std::unique_ptr<Attribute>
yield
();
75
76
private
:
77
void
load()
const
;
78
79
std::unique_ptr<details::AttributeIt> impl_;
80
mutable
std::unique_ptr<Attribute> cached_;
81
};
82
83
public
:
84
Attribute
(std::unique_ptr<details::Attribute> impl);
85
87
std::string
name
()
const
;
88
90
std::unique_ptr<Type>
type
()
const
;
91
93
uint64_t
field_offset
()
const
;
94
95
~Attribute
();
96
97
private
:
98
std::unique_ptr<details::Attribute> impl_;
99
};
100
101
}
102
}
103
}
104
#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:729
LIEF::pdb::Type
This is the base class for any PDB type.
Definition
PDB/Type.hpp:37
LIEF::pdb::types::Attribute::Iterator::operator->
const Attribute * operator->() const
LIEF::pdb::types::Attribute::Iterator::yield
std::unique_ptr< Attribute > yield()
Transfer ownership of the attribute at the current position to the caller. Returns nullptr if the ite...
LIEF::pdb::types::Attribute::Iterator::implementation
details::AttributeIt implementation
Definition
PDB/types/Attribute.hpp:44
LIEF::pdb::types::Attribute::Iterator::Iterator
Iterator()
LIEF::pdb::types::Attribute::Iterator::Iterator
Iterator(const Iterator &)
LIEF::pdb::types::Attribute::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::pdb::types::Attribute::Iterator::operator++
Iterator & operator++()
LIEF::pdb::types::Attribute::Iterator::Iterator
Iterator(std::unique_ptr< details::AttributeIt > impl)
LIEF::pdb::types::Attribute::Iterator::operator*
const Attribute & operator*() const
LIEF::pdb::types::Attribute::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::pdb::types::Attribute
This class represents an attribute (LF_MEMBER) in an aggregate (class, struct, union,...
Definition
PDB/types/Attribute.hpp:37
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.
iterators.hpp
LIEF::pdb::types::details
Definition
PDB/types/Attribute.hpp:30
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:45
Generated by
1.17.0