LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
DWARF/types/Enum.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2025 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_TYPE_ENUM_H
16#define LIEF_DWARF_TYPE_ENUM_H
17
18#include "LIEF/visibility.h"
19#include "LIEF/optional.hpp"
20#include "LIEF/DWARF/Type.hpp"
21
22namespace LIEF {
23namespace dwarf {
24namespace types {
25
26namespace details {
27class EnumEntry;
28}
29
31class LIEF_API Enum : public Type {
32 public:
33 using Type::Type;
34
38 public:
39 Entry(std::unique_ptr<details::EnumEntry> impl);
40 Entry(Entry&& other) noexcept;
41 Entry& operator=(Entry&& other) noexcept;
42
44 std::string name() const;
45
48
50
51 private:
52 std::unique_ptr<details::EnumEntry> impl_;
53 };
54
56 std::vector<Entry> entries() const;
57
58 static bool classof(const Type* type) {
59 return type->kind() == Type::KIND::ENUM;
60 }
61
62 ~Enum() override;
63};
64
65}
66}
67}
68#endif
KIND kind() const
@ ENUM
Definition DWARF/Type.hpp:154
Entry & operator=(Entry &&other) noexcept
Entry(Entry &&other) noexcept
optional< int64_t > value() const
Enum entry's value (if any).
Entry(std::unique_ptr< details::EnumEntry > impl)
std::string name() const
Enum entry's name.
This class represents a DW_TAG_enumeration_type.
Definition DWARF/types/Enum.hpp:31
std::vector< Entry > entries() const
Return the different entries associated with this enum.
static bool classof(const Type *type)
Definition DWARF/types/Enum.hpp:58
Definition optional.hpp:23
Definition DWARF/types/ClassLike.hpp:26
Definition DWARF/types/Array.hpp:23
Namespace for the DWARF debug format.
Definition DWARF/CompilationUnit.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:41