LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
DynamicEntryLibrary.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_LIBRARY_H
17#define LIEF_ELF_DYNAMIC_ENTRY_LIBRARY_H
18
19#include <string>
20#include "LIEF/visibility.h"
22
23namespace LIEF {
24namespace ELF {
25
30
31 public:
33
36
39 libname_(std::move(name)) {}
40
43
44 std::unique_ptr<DynamicEntry> clone() const override {
45 return std::unique_ptr<DynamicEntryLibrary>(new DynamicEntryLibrary{*this});
46 }
47
49 const std::string& name() const {
50 return libname_;
51 }
52
53 void name(std::string name) {
54 libname_ = std::move(name);
55 }
56
57 static bool classof(const DynamicEntry* entry) {
58 return entry->tag() == DynamicEntry::TAG::NEEDED;
59 }
60
61 void accept(Visitor& visitor) const override;
62
63 std::ostream& print(std::ostream& os) const override;
64
65 private:
66 std::string libname_;
67};
68}
69}
70
71#endif
std::unique_ptr< DynamicEntry > clone() const override
Definition DynamicEntryLibrary.hpp:44
DynamicEntryLibrary(const DynamicEntryLibrary &)=default
DynamicEntryLibrary & operator=(const DynamicEntryLibrary &)=default
void name(std::string name)
Definition DynamicEntryLibrary.hpp:53
const std::string & name() const
Return the library associated with this entry (e.g. libc.so.6).
Definition DynamicEntryLibrary.hpp:49
static bool classof(const DynamicEntry *entry)
Definition DynamicEntryLibrary.hpp:57
std::ostream & print(std::ostream &os) const override
void accept(Visitor &visitor) const override
DynamicEntryLibrary()
Definition DynamicEntryLibrary.hpp:34
DynamicEntryLibrary(std::string name)
Definition DynamicEntryLibrary.hpp:37
TAG
Definition DynamicEntry.hpp:48
@ NEEDED
Definition DynamicEntry.hpp:51
TAG tag() const
Tag of the current entry. The most common tags are: DT_NEEDED, DT_INIT, ...
Definition DynamicEntry.hpp:309
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:43