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
DWARF
editor
EnumType.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_DWARF_EDITOR_ENUM_TYPE_H
16
#define LIEF_DWARF_EDITOR_ENUM_TYPE_H
17
#include <cstdint>
18
#include <string>
19
20
#include "
LIEF/compiler_attributes.hpp
"
21
#include "
LIEF/visibility.h
"
22
#include "
LIEF/DWARF/editor/Type.hpp
"
23
24
namespace
LIEF
{
25
namespace
dwarf
{
26
namespace
editor
{
27
28
namespace
details
{
29
class
EnumValue;
30
}
31
33
class
LIEF_API
EnumType
:
public
Type
{
34
public
:
35
template
<
typename
... Args,
36
typename
=
typename
std::
37
enable_if<std::is_constructible<
Type
, Args&&...>::value>::type>
38
EnumType
(Args&&... args) :
39
Type
(std::forward<Args>(args)...) {}
40
42
class
LIEF_API
Value
{
43
public
:
44
Value
() =
delete
;
45
Value
(std::unique_ptr<details::EnumValue> impl);
46
47
~Value
();
48
49
private
:
50
std::unique_ptr<details::EnumValue> impl_;
51
};
52
55
EnumType
&
set_size
(uint64_t size)
LIEF_LIFETIMEBOUND
;
56
58
EnumType
&
set_underlying_type
(
const
Type
& type)
LIEF_LIFETIMEBOUND
;
59
61
std::unique_ptr<Value>
add_value
(
const
std::string& name,
62
int64_t value)
LIEF_LIFETIMEBOUND
;
63
64
static
bool
classof
(
const
Type
* type);
65
66
~EnumType
()
override
=
default
;
67
};
68
69
}
70
}
71
}
72
#endif
Type.hpp
LIEF::dwarf::editor::EnumType::Value::~Value
~Value()
LIEF::dwarf::editor::EnumType::Value::Value
Value(std::unique_ptr< details::EnumValue > impl)
LIEF::dwarf::editor::EnumType::Value::Value
Value()=delete
LIEF::dwarf::editor::EnumType::set_underlying_type
EnumType & set_underlying_type(const Type &type)
Set the underlying type that is used to encode this enum.
LIEF::dwarf::editor::EnumType::set_size
EnumType & set_size(uint64_t size)
Define the number of bytes required to hold an instance of the enumeration (DW_AT_byte_size).
LIEF::dwarf::editor::EnumType::EnumType
EnumType(Args &&... args)
Definition
EnumType.hpp:38
LIEF::dwarf::editor::EnumType::~EnumType
~EnumType() override=default
LIEF::dwarf::editor::EnumType::classof
static bool classof(const Type *type)
LIEF::dwarf::editor::EnumType::add_value
std::unique_ptr< Value > add_value(const std::string &name, int64_t value)
Add an enum value by specifying its name and its integer value.
LIEF::dwarf::editor::Type::Type
Type()=delete
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::dwarf::editor::details
Definition
DWARF/editor/CompilationUnit.hpp:38
LIEF::dwarf::editor
Definition
Editor.hpp:32
LIEF::dwarf
Namespace for the DWARF debug format.
Definition
DWARF/CompilationUnit.hpp:30
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0