LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
VersionMin.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_VERSION_MIN_COMMAND_H
17#define LIEF_MACHO_VERSION_MIN_COMMAND_H
18#include <ostream>
19#include <array>
20
21#include "LIEF/visibility.h"
22
24
25namespace LIEF {
26namespace MachO {
27
28namespace details {
29struct version_min_command;
30}
31
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::unique_ptr<VersionMin>(new VersionMin(*this));
48 }
49
50 ~VersionMin() override = default;
51
53 const version_t& version() const {
54 return version_;
55 }
56 void version(const version_t& version) {
57 version_ = version;
58 }
59
61 const version_t& sdk() const {
62 return sdk_;
63 }
64 void sdk(const version_t& sdk) {
65 sdk_ = sdk;
66 }
67
68 void accept(Visitor& visitor) const override;
69
70 std::ostream& print(std::ostream& os) const override;
71
79
80 private:
81 version_t version_;
82 version_t sdk_;
83};
84
85}
86}
87#endif
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:128
TYPE
Definition LoadCommand.hpp:45
@ VERSION_MIN_TVOS
Definition LoadCommand.hpp:94
@ VERSION_MIN_WATCHOS
Definition LoadCommand.hpp:95
@ VERSION_MIN_MACOSX
Definition LoadCommand.hpp:83
@ VERSION_MIN_IPHONEOS
Definition LoadCommand.hpp:84
~VersionMin() override=default
VersionMin(const VersionMin &copy)=default
const version_t & version() const
Return the version as an array.
Definition VersionMin.hpp:53
const version_t & sdk() const
Return the sdk version as an array.
Definition VersionMin.hpp:61
VersionMin(const details::version_min_command &version_cmd)
void accept(Visitor &visitor) const override
std::unique_ptr< LoadCommand > clone() const override
Definition VersionMin.hpp:46
void version(const version_t &version)
Definition VersionMin.hpp:56
VersionMin & operator=(const VersionMin &copy)=default
static bool classof(const LoadCommand *cmd)
Definition VersionMin.hpp:72
void sdk(const version_t &sdk)
Definition VersionMin.hpp:64
std::ostream & print(std::ostream &os) const override
std::array< uint32_t, 3 > version_t
Version is an array of 3 integers.
Definition VersionMin.hpp:38
Definition Visitor.hpp:212
Definition endianness_support.hpp:60
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:43