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