LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
MsManifestBinaryID.hpp
Go to the documentation of this file.
1
2/* Copyright 2017 - 2026 R. Thomas
3 * Copyright 2017 - 2026 Quarkslab
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef LIEF_PE_ATTRIBUTES_MS_MANIFEST_BINARY_ID_H
18#define LIEF_PE_ATTRIBUTES_MS_MANIFEST_BINARY_ID_H
19
22#include "LIEF/visibility.h"
23#include <string_view>
24
25
26namespace LIEF::PE {
27
40
41 friend class Parser;
42 friend class SignatureParser;
43
44 public:
46 MsManifestBinaryID(std::string binid) :
47 Attribute(Attribute::TYPE::MS_PLATFORM_MANIFEST_BINARY_ID),
48 id_(std::move(binid)) {}
49
52
54 std::string print() const override {
55 return id_;
56 }
57
59 std::string_view manifest_id() const LIEF_LIFETIMEBOUND {
60 return id_;
61 }
62
63 void manifest_id(const std::string& id) {
64 id_ = id;
65 }
66
67 std::unique_ptr<Attribute> clone() const override {
68 return std::unique_ptr<Attribute>(new MsManifestBinaryID{*this});
69 }
70
71 static bool classof(const Attribute* attr) {
73 }
74
75 void accept(Visitor& visitor) const override;
76
77 ~MsManifestBinaryID() override = default;
78
79 private:
80 std::string id_;
81};
82
83}
84
85
86#endif
TYPE
Definition PE/signature/Attribute.hpp:35
@ MS_PLATFORM_MANIFEST_BINARY_ID
Definition PE/signature/Attribute.hpp:47
virtual TYPE type() const
Concrete type of the attribute.
Definition PE/signature/Attribute.hpp:62
std::string_view manifest_id() const
The manifest id as a string.
Definition MsManifestBinaryID.hpp:59
std::unique_ptr< Attribute > clone() const override
Definition MsManifestBinaryID.hpp:67
MsManifestBinaryID(std::string binid)
Definition MsManifestBinaryID.hpp:46
void manifest_id(const std::string &id)
Definition MsManifestBinaryID.hpp:63
friend class SignatureParser
Definition MsManifestBinaryID.hpp:42
std::string print() const override
Print information about the attribute.
Definition MsManifestBinaryID.hpp:54
friend class Parser
Definition MsManifestBinaryID.hpp:41
MsManifestBinaryID & operator=(const MsManifestBinaryID &)=default
MsManifestBinaryID(const MsManifestBinaryID &)=default
static bool classof(const Attribute *attr)
Definition MsManifestBinaryID.hpp:71
void accept(Visitor &visitor) const override
~MsManifestBinaryID() override=default
Definition Visitor.hpp:212
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
#define LIEF_API
Definition visibility.h:45