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