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
VersionMin.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_MACHO_VERSION_MIN_COMMAND_H
16
#define LIEF_MACHO_VERSION_MIN_COMMAND_H
17
#include <array>
18
#include <memory>
19
#include <ostream>
20
21
#include "
LIEF/visibility.h
"
22
23
#include "
LIEF/MachO/LoadCommand.hpp
"
24
25
26
namespace
LIEF::MachO
{
27
28
namespace
details
{
29
struct
version_min_command;
30
}
31
34
class
LIEF_API
VersionMin
:
public
LoadCommand
{
35
36
public
:
38
using
version_t
= std::array<uint32_t, 3>;
39
40
VersionMin
() =
default
;
41
VersionMin
(
const
details::version_min_command& version_cmd);
42
43
VersionMin
&
operator=
(
const
VersionMin
& copy) =
default
;
44
VersionMin
(
const
VersionMin
& copy) =
default
;
45
46
std::unique_ptr<LoadCommand>
clone
()
const override
{
47
return
std::make_unique<VersionMin>(*
this
);
48
}
49
50
~VersionMin
()
override
=
default
;
51
53
const
version_t
&
version
() const
LIEF_LIFETIMEBOUND
{
54
return
version_;
55
}
56
57
void
version
(
const
version_t
&
version
) {
58
version_ =
version
;
59
}
60
62
const
version_t
&
sdk
() const
LIEF_LIFETIMEBOUND
{
63
return
sdk_;
64
}
65
66
void
sdk
(
const
version_t
&
sdk
) {
67
sdk_ =
sdk
;
68
}
69
70
void
accept
(
Visitor
& visitor)
const override
;
71
72
std::ostream&
print
(std::ostream& os)
const override
;
73
74
static
bool
classof
(
const
LoadCommand
* cmd) {
75
const
LoadCommand::TYPE
type = cmd->
command
();
76
return
type ==
LoadCommand::TYPE::VERSION_MIN_MACOSX
||
77
type ==
LoadCommand::TYPE::VERSION_MIN_IPHONEOS
||
78
type ==
LoadCommand::TYPE::VERSION_MIN_TVOS
||
79
type ==
LoadCommand::TYPE::VERSION_MIN_WATCHOS
;
80
}
81
82
private
:
83
version_t version_{};
84
version_t sdk_{};
85
};
86
87
}
88
89
#endif
LoadCommand.hpp
LIEF::MachO::LoadCommand::LoadCommand
LoadCommand()=default
LIEF::MachO::LoadCommand::command
LoadCommand::TYPE command() const
Command type.
Definition
LoadCommand.hpp:131
LIEF::MachO::LoadCommand::TYPE
TYPE
Definition
LoadCommand.hpp:46
LIEF::MachO::LoadCommand::TYPE::VERSION_MIN_TVOS
@ VERSION_MIN_TVOS
Definition
LoadCommand.hpp:95
LIEF::MachO::LoadCommand::TYPE::VERSION_MIN_WATCHOS
@ VERSION_MIN_WATCHOS
Definition
LoadCommand.hpp:96
LIEF::MachO::LoadCommand::TYPE::VERSION_MIN_MACOSX
@ VERSION_MIN_MACOSX
Definition
LoadCommand.hpp:84
LIEF::MachO::LoadCommand::TYPE::VERSION_MIN_IPHONEOS
@ VERSION_MIN_IPHONEOS
Definition
LoadCommand.hpp:85
LIEF::MachO::VersionMin::~VersionMin
~VersionMin() override=default
LIEF::MachO::VersionMin::VersionMin
VersionMin(const VersionMin ©)=default
LIEF::MachO::VersionMin::version
const version_t & version() const
Return the version as an array.
Definition
VersionMin.hpp:53
LIEF::MachO::VersionMin::sdk
const version_t & sdk() const
Return the sdk version as an array.
Definition
VersionMin.hpp:62
LIEF::MachO::VersionMin::VersionMin
VersionMin(const details::version_min_command &version_cmd)
LIEF::MachO::VersionMin::accept
void accept(Visitor &visitor) const override
LIEF::MachO::VersionMin::clone
std::unique_ptr< LoadCommand > clone() const override
Definition
VersionMin.hpp:46
LIEF::MachO::VersionMin::version
void version(const version_t &version)
Definition
VersionMin.hpp:57
LIEF::MachO::VersionMin::VersionMin
VersionMin()=default
LIEF::MachO::VersionMin::operator=
VersionMin & operator=(const VersionMin ©)=default
LIEF::MachO::VersionMin::classof
static bool classof(const LoadCommand *cmd)
Definition
VersionMin.hpp:74
LIEF::MachO::VersionMin::sdk
void sdk(const version_t &sdk)
Definition
VersionMin.hpp:66
LIEF::MachO::VersionMin::print
std::ostream & print(std::ostream &os) const override
LIEF::MachO::VersionMin::version_t
std::array< uint32_t, 3 > version_t
Version is an array of 3 integers.
Definition
VersionMin.hpp:38
LIEF::Visitor
Definition
Visitor.hpp:211
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::MachO::details
Definition
endianness_support.hpp:62
LIEF::MachO
Namespace related to the LIEF's Mach-O module.
Definition
Abstract/Header.hpp:35
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:44
Generated by
1.19.0