LIEF: Library to Instrument Executable Formats Version
Loading...
Searching...
No Matches
VersionMin.hpp
1/* Copyright 2017 - 2023 R. Thomas
2 * Copyright 2017 - 2023 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#include "LIEF/types.hpp"
23
24#include "LIEF/MachO/LoadCommand.hpp"
25
26namespace LIEF {
27namespace MachO {
28
29namespace details {
30struct version_min_command;
31}
32
34class LIEF_API VersionMin : public LoadCommand {
35
36 public:
38 using version_t = std::array<uint32_t, 3>;
39
40 VersionMin();
41 VersionMin(const details::version_min_command& version_cmd);
42
43 VersionMin& operator=(const VersionMin& copy);
44 VersionMin(const VersionMin& copy);
45
46 VersionMin* clone() const override;
47
48 ~VersionMin() override;
49
51 const version_t& version() const;
52 void version(const version_t& version);
53
55 const version_t& sdk() const;
56 void sdk(const version_t& sdk);
57
58 void accept(Visitor& visitor) const override;
59
60 std::ostream& print(std::ostream& os) const override;
61
62 static bool classof(const LoadCommand* cmd);
63
64 private:
65 version_t version_;
66 version_t sdk_;
67};
68
69}
70}
71#endif
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:39
Class that wraps the LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS, ... commands.
Definition VersionMin.hpp:34
const version_t & version() const
Return the version as an array.
const version_t & sdk() const
Return the sdk version as an array.
std::array< uint32_t, 3 > version_t
Version is an array of 3 integers.
Definition VersionMin.hpp:38
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32