LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
DynamicEntryFilter.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 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_ELF_DYNAMIC_ENTRY_FILTER_H
16#define LIEF_ELF_DYNAMIC_ENTRY_FILTER_H
17
18#include <string_view>
19#include <memory>
20#include <string>
21
24#include "LIEF/visibility.h"
25
26
27namespace LIEF::ELF {
28
33
34 public:
38
39 DynamicEntryFilter(std::string name) :
40 DynamicEntry(DynamicEntry::TAG::FILTER, 0),
41 name_(std::move(name)) {}
42
45
46 std::unique_ptr<DynamicEntry> clone() const override {
47 return std::make_unique<DynamicEntryFilter>(*this);
48 }
49
51 std::string_view name() const LIEF_LIFETIMEBOUND {
52 return name_;
53 }
54
55 void name(std::string name) {
56 name_ = std::move(name);
57 }
58
59 void accept(Visitor& visitor) const override;
60
61 std::ostream& print(std::ostream& os) const override;
62
63 static bool classof(const DynamicEntry* entry) {
64 return entry->tag() == DynamicEntry::TAG::FILTER;
65 }
66
67 ~DynamicEntryFilter() override = default;
68
69 private:
70 std::string name_;
71};
72}
73
74#endif
~DynamicEntryFilter() override=default
void name(std::string name)
Definition DynamicEntryFilter.hpp:55
DynamicEntryFilter()
Definition DynamicEntryFilter.hpp:36
std::ostream & print(std::ostream &os) const override
DynamicEntryFilter(const DynamicEntryFilter &)=default
static bool classof(const DynamicEntry *entry)
Definition DynamicEntryFilter.hpp:63
std::string_view name() const
The actual name (e.g. libfilter.so).
Definition DynamicEntryFilter.hpp:51
std::unique_ptr< DynamicEntry > clone() const override
Definition DynamicEntryFilter.hpp:46
void accept(Visitor &visitor) const override
DynamicEntryFilter & operator=(const DynamicEntryFilter &)=default
DynamicEntryFilter(std::string name)
Definition DynamicEntryFilter.hpp:39
TAG
Definition DynamicEntry.hpp:48
@ FILTER
Definition DynamicEntry.hpp:102
TAG tag() const
Tag of the current entry. The most common tags are: DT_NEEDED, DT_INIT, ...
Definition DynamicEntry.hpp:251
Definition Visitor.hpp:211
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:27
#define LIEF_API
Definition visibility.h:44