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
MachO
SourceVersion.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_MACHO_SOURCE_VERSION_COMMAND_H
17
#define LIEF_MACHO_SOURCE_VERSION_COMMAND_H
18
#include <array>
19
#include <memory>
20
#include <ostream>
21
22
#include "
LIEF/visibility.h
"
23
24
#include "
LIEF/MachO/LoadCommand.hpp
"
25
26
27
namespace
LIEF::MachO
{
28
29
namespace
details
{
30
struct
source_version_command;
31
}
32
36
class
LIEF_API
SourceVersion
:
public
LoadCommand
{
37
38
public
:
40
using
version_t
= std::array<uint32_t, 5>;
41
42
SourceVersion
() =
default
;
43
SourceVersion
(
const
details::source_version_command& version_cmd);
44
45
SourceVersion
&
operator=
(
const
SourceVersion
& copy) =
default
;
46
SourceVersion
(
const
SourceVersion
& copy) =
default
;
47
48
std::unique_ptr<LoadCommand>
clone
()
const override
{
49
return
std::make_unique<SourceVersion>(*
this
);
50
}
51
52
~SourceVersion
()
override
=
default
;
53
55
const
version_t
&
version
() const
LIEF_LIFETIMEBOUND
{
56
return
version_;
57
}
58
void
version
(
const
version_t
&
version
) {
59
version_ =
version
;
60
}
61
62
void
accept
(
Visitor
& visitor)
const override
;
63
64
std::ostream&
print
(std::ostream& os)
const override
;
65
66
static
bool
classof
(
const
LoadCommand
* cmd) {
67
return
cmd->
command
() ==
LoadCommand::TYPE::SOURCE_VERSION
;
68
}
69
70
private
:
71
version_t version_ = {0};
72
};
73
74
}
75
76
#endif
LoadCommand.hpp
LIEF::MachO::LoadCommand::LoadCommand
LoadCommand()=default
LIEF::MachO::LoadCommand::command
LoadCommand::TYPE command() const
Command type.
Definition
LoadCommand.hpp:132
LIEF::MachO::LoadCommand::TYPE::SOURCE_VERSION
@ SOURCE_VERSION
Definition
LoadCommand.hpp:91
LIEF::MachO::SourceVersion::SourceVersion
SourceVersion()=default
LIEF::MachO::SourceVersion::operator=
SourceVersion & operator=(const SourceVersion ©)=default
LIEF::MachO::SourceVersion::accept
void accept(Visitor &visitor) const override
LIEF::MachO::SourceVersion::print
std::ostream & print(std::ostream &os) const override
LIEF::MachO::SourceVersion::version
void version(const version_t &version)
Definition
SourceVersion.hpp:58
LIEF::MachO::SourceVersion::SourceVersion
SourceVersion(const details::source_version_command &version_cmd)
LIEF::MachO::SourceVersion::SourceVersion
SourceVersion(const SourceVersion ©)=default
LIEF::MachO::SourceVersion::classof
static bool classof(const LoadCommand *cmd)
Definition
SourceVersion.hpp:66
LIEF::MachO::SourceVersion::clone
std::unique_ptr< LoadCommand > clone() const override
Definition
SourceVersion.hpp:48
LIEF::MachO::SourceVersion::version
const version_t & version() const
Return the version as an array.
Definition
SourceVersion.hpp:55
LIEF::MachO::SourceVersion::~SourceVersion
~SourceVersion() override=default
LIEF::MachO::SourceVersion::version_t
std::array< uint32_t, 5 > version_t
Version is an array of 5 integers.
Definition
SourceVersion.hpp:40
LIEF::Visitor
Definition
Visitor.hpp:212
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::MachO::details
Definition
endianness_support.hpp:59
LIEF::MachO
Namespace related to the LIEF's Mach-O module.
Definition
Abstract/Header.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0