LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
PE
signature
attributes
ContentType.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_PE_ATTRIBUTES_CONTENT_TYPE_H
16
#define LIEF_PE_ATTRIBUTES_CONTENT_TYPE_H
17
#include <memory>
18
19
#include "
LIEF/PE/signature/Attribute.hpp
"
20
#include "
LIEF/PE/signature/types.hpp
"
21
#include "
LIEF/visibility.h
"
22
23
24
namespace
LIEF
{
25
class
VectorStream
;
26
namespace
PE
{
27
38
class
LIEF_API
ContentType
:
public
Attribute
{
39
40
friend
class
Parser
;
41
friend
class
SignatureParser
;
42
43
public
:
44
ContentType
() :
45
Attribute
(
Attribute
::
TYPE
::CONTENT_TYPE) {}
46
47
ContentType
(
oid_t
oid
) :
48
Attribute
(
Attribute
::
TYPE
::CONTENT_TYPE),
49
oid_{std::move(
oid
)} {}
50
ContentType
(
const
ContentType
&) =
default
;
51
ContentType
&
operator=
(
const
ContentType
&) =
default
;
52
54
const
oid_t
&
oid
()
const
{
55
return
oid_;
56
}
57
59
std::string
print
()
const override
;
60
61
std::unique_ptr<Attribute>
clone
()
const override
{
62
return
std::unique_ptr<Attribute>(
new
ContentType
{*
this
});
63
}
64
65
static
bool
classof
(
const
Attribute
* attr) {
66
return
attr->
type
() ==
Attribute::TYPE::CONTENT_TYPE
;
67
}
68
69
void
accept
(
Visitor
& visitor)
const override
;
70
~ContentType
()
override
=
default
;
71
72
private
:
73
oid_t
oid_;
74
};
75
76
}
77
}
78
79
#endif
Attribute.hpp
types.hpp
LIEF::PE::Attribute::TYPE
TYPE
Definition
PE/signature/Attribute.hpp:34
LIEF::PE::Attribute::TYPE::CONTENT_TYPE
@ CONTENT_TYPE
Definition
PE/signature/Attribute.hpp:36
LIEF::PE::Attribute::Attribute
Attribute()=delete
LIEF::PE::Attribute::type
virtual TYPE type() const
Concrete type of the attribute.
Definition
PE/signature/Attribute.hpp:61
LIEF::PE::ContentType::ContentType
ContentType(oid_t oid)
Definition
ContentType.hpp:47
LIEF::PE::ContentType::classof
static bool classof(const Attribute *attr)
Definition
ContentType.hpp:65
LIEF::PE::ContentType::operator=
ContentType & operator=(const ContentType &)=default
LIEF::PE::ContentType::~ContentType
~ContentType() override=default
LIEF::PE::ContentType::ContentType
ContentType(const ContentType &)=default
LIEF::PE::ContentType::SignatureParser
friend class SignatureParser
Definition
ContentType.hpp:41
LIEF::PE::ContentType::print
std::string print() const override
Print information about the attribute.
LIEF::PE::ContentType::oid
const oid_t & oid() const
OID as described in RFC #2985.
Definition
ContentType.hpp:54
LIEF::PE::ContentType::Parser
friend class Parser
Definition
ContentType.hpp:40
LIEF::PE::ContentType::ContentType
ContentType()
Definition
ContentType.hpp:44
LIEF::PE::ContentType::accept
void accept(Visitor &visitor) const override
LIEF::PE::ContentType::clone
std::unique_ptr< Attribute > clone() const override
Definition
ContentType.hpp:61
LIEF::VectorStream
Definition
VectorStream.hpp:28
LIEF::Visitor
Definition
Visitor.hpp:211
LIEF::PE
Namespace related to the LIEF's PE module.
Definition
Abstract/Header.hpp:31
LIEF::PE::oid_t
std::string oid_t
Definition
PE/signature/types.hpp:22
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:44
Generated by
1.19.0