LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
DynamicEntryAuxiliary.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 Quarkslab
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef LIEF_ELF_DYNAMIC_ENTRY_AUXILIARY_H
17#define LIEF_ELF_DYNAMIC_ENTRY_AUXILIARY_H
18
19#include <string_view>
20#include <memory>
21#include <string>
22
25#include "LIEF/visibility.h"
26
27
28namespace LIEF::ELF {
29
34
35 public:
39
41 DynamicEntry(DynamicEntry::TAG::AUXILIARY, 0),
42 name_(std::move(name)) {}
43
46
47 std::unique_ptr<DynamicEntry> clone() const override {
48 return std::make_unique<DynamicEntryAuxiliary>(*this);
49 }
50
52 std::string_view name() const LIEF_LIFETIMEBOUND {
53 return name_;
54 }
55
56 void name(std::string name) {
57 name_ = std::move(name);
58 }
59
60 void accept(Visitor& visitor) const override;
61
62 std::ostream& print(std::ostream& os) const override;
63
64 static bool classof(const DynamicEntry* entry) {
65 return entry->tag() == DynamicEntry::TAG::AUXILIARY;
66 }
67
68 ~DynamicEntryAuxiliary() override = default;
69
70 private:
71 std::string name_;
72};
73}
74
75#endif
std::string_view name() const
The actual name (e.g. libaux.so).
Definition DynamicEntryAuxiliary.hpp:52
DynamicEntryAuxiliary()
Definition DynamicEntryAuxiliary.hpp:37
void name(std::string name)
Definition DynamicEntryAuxiliary.hpp:56
static bool classof(const DynamicEntry *entry)
Definition DynamicEntryAuxiliary.hpp:64
void accept(Visitor &visitor) const override
std::unique_ptr< DynamicEntry > clone() const override
Definition DynamicEntryAuxiliary.hpp:47
DynamicEntryAuxiliary & operator=(const DynamicEntryAuxiliary &)=default
std::ostream & print(std::ostream &os) const override
DynamicEntryAuxiliary(const DynamicEntryAuxiliary &)=default
DynamicEntryAuxiliary(std::string name)
Definition DynamicEntryAuxiliary.hpp:40
~DynamicEntryAuxiliary() override=default
TAG
Definition DynamicEntry.hpp:49
@ AUXILIARY
Definition DynamicEntry.hpp:102
TAG tag() const
Tag of the current entry. The most common tags are: DT_NEEDED, DT_INIT, ...
Definition DynamicEntry.hpp:252
Definition Visitor.hpp:212
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
#define LIEF_API
Definition visibility.h:45