LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
DynamicEntryFilter.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_FILTER_H
17#define LIEF_ELF_DYNAMIC_ENTRY_FILTER_H
18
19#include <string>
20
21#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace ELF {
26
31
32 public:
37
38 DynamicEntryFilter(std::string name) :
39 DynamicEntry(DynamicEntry::TAG::FILTER, 0),
40 name_(std::move(name))
41 {}
42
45
46 std::unique_ptr<DynamicEntry> clone() const override {
47 return std::unique_ptr<DynamicEntryFilter>(new DynamicEntryFilter(*this));
48 }
49
51 const std::string& name() const {
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:34
std::ostream & print(std::ostream &os) const override
DynamicEntryFilter(const DynamicEntryFilter &)=default
static bool classof(const DynamicEntry *entry)
Definition DynamicEntryFilter.hpp:63
std::unique_ptr< DynamicEntry > clone() const override
Definition DynamicEntryFilter.hpp:46
const std::string & name() const
The actual name (e.g. libfilter.so).
Definition DynamicEntryFilter.hpp:51
void accept(Visitor &visitor) const override
DynamicEntryFilter & operator=(const DynamicEntryFilter &)=default
DynamicEntryFilter(std::string name)
Definition DynamicEntryFilter.hpp:38
TAG
Definition DynamicEntry.hpp:47
@ FILTER
Definition DynamicEntry.hpp:101
TAG tag() const
Tag of the current entry. The most common tags are: DT_NEEDED, DT_INIT, ...
Definition DynamicEntry.hpp:249
Definition Visitor.hpp:212
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:41