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
PDB
types
PDB/types/Enum.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_ENUM_H
16
#define LIEF_PDB_TYPE_ENUM_H
17
18
#include "
LIEF/PDB/Type.hpp
"
19
#include "
LIEF/compiler_attributes.hpp
"
20
#include "
LIEF/visibility.h
"
21
22
23
namespace
LIEF::pdb::types
{
24
25
namespace
details
{
26
class
EnumEntry;
27
}
28
30
class
LIEF_API
Enum
:
public
Type
{
31
public
:
32
template
<
typename
... Args,
33
typename
= std::enable_if_t<std::is_constructible_v<
Type
, Args&&...>>>
34
Enum
(Args&&... args) :
35
Type
(std::forward<Args>(args)...) {}
36
39
class
LIEF_API
Entry
{
40
public
:
41
Entry
(std::unique_ptr<details::EnumEntry> impl
LIEF_LIFETIMEBOUND
);
42
Entry
(
Entry
&& other)
noexcept
;
43
Entry
&
operator=
(
Entry
&& other)
noexcept
;
44
46
std::string
name
()
const
;
47
49
int64_t
value
()
const
;
50
51
~Entry
();
52
53
private
:
54
std::unique_ptr<details::EnumEntry> impl_;
55
};
56
58
std::string
unique_name
()
const
;
59
61
std::vector<Entry>
entries
() const
LIEF_LIFETIMEBOUND
;
62
64
const
Type
*
underlying_type
() const
LIEF_LIFETIMEBOUND
;
65
67
std::optional<
Entry
>
find_entry
(int64_t value) const
LIEF_LIFETIMEBOUND
;
68
69
static
bool
classof
(const
Type
* type) {
70
return
type->kind() ==
Type::KIND::ENUM
;
71
}
72
73
~Enum
()
override
;
74
75
protected
:
76
mutable
std::unique_ptr<Type> underlying_;
77
};
78
79
}
80
81
82
#endif
Type.hpp
LIEF::pdb::Type::Type
Type(std::unique_ptr< details::Type > impl)
LIEF::pdb::Type::KIND::ENUM
@ ENUM
Definition
PDB/Type.hpp:89
LIEF::pdb::types::Enum::Entry
This class represents an enum entry which is essentially composed of a name and its value (integer).
Definition
PDB/types/Enum.hpp:39
LIEF::pdb::types::Enum::Entry::~Entry
~Entry()
LIEF::pdb::types::Enum::Entry::Entry
Entry(Entry &&other) noexcept
LIEF::pdb::types::Enum::Entry::value
int64_t value() const
Enum entry's value (if any).
LIEF::pdb::types::Enum::Entry::operator=
Entry & operator=(Entry &&other) noexcept
LIEF::pdb::types::Enum::Entry::Entry
Entry(std::unique_ptr< details::EnumEntry > impl)
LIEF::pdb::types::Enum::Entry::name
std::string name() const
Enum entry's name.
LIEF::pdb::types::Enum::unique_name
std::string unique_name() const
Enum's mangled name.
LIEF::pdb::types::Enum::~Enum
~Enum() override
LIEF::pdb::types::Enum::entries
std::vector< Entry > entries() const
Return the different entries associated with this enum.
LIEF::pdb::types::Enum::underlying_type
const Type * underlying_type() const
The underlying type that is used to encode this enum.
LIEF::pdb::types::Enum::find_entry
std::optional< Entry > find_entry(int64_t value) const
Try to find the enum matching the given value.
LIEF::pdb::types::Enum::Enum
Enum(Args &&... args)
Definition
PDB/types/Enum.hpp:34
LIEF::pdb::types::Enum::classof
static bool classof(const Type *type)
Definition
PDB/types/Enum.hpp:69
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::pdb::types::details
Definition
PDB/types/Attribute.hpp:31
LIEF::pdb::types
Definition
PDB/types/Array.hpp:23
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0