LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
BuildToolVersion.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2025 R. Thomas
2 * Copyright 2017 - 2025 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_BUILD_TOOL_VERSION_COMMAND_H
17#define LIEF_MACHO_BUILD_TOOL_VERSION_COMMAND_H
18#include <ostream>
19#include <array>
20#include <cstdint>
21
22#include "LIEF/Object.hpp"
23#include "LIEF/visibility.h"
24
25namespace LIEF {
26namespace MachO {
27
28namespace details {
29struct build_tool_version;
30}
31
35 public:
37 using version_t = std::array<uint32_t, 3>;
38
39 public:
40 enum class TOOLS {
42 CLANG = 1,
43 SWIFT = 2,
44 LD = 3,
45 LLD = 4,
46
47 METAL = 1024,
48 AIRLLD = 1025,
49 AIRNT = 1026,
51 AIRPACK = 1028,
54 };
55
56 public:
57 BuildToolVersion() = default;
58 BuildToolVersion(const details::build_tool_version& tool);
59
61 TOOLS tool() const {
62 return tool_;
63 }
64
67 return version_;
68 }
69
70 ~BuildToolVersion() override = default;
71
72 void accept(Visitor& visitor) const override;
73
74 LIEF_API friend
75 std::ostream& operator<<(std::ostream& os, const BuildToolVersion& tool);
76
77 private:
78 TOOLS tool_ = TOOLS::UNKNOWN;
79 version_t version_;
80};
81
83
84}
85}
86#endif
friend std::ostream & operator<<(std::ostream &os, const BuildToolVersion &tool)
void accept(Visitor &visitor) const override
std::array< uint32_t, 3 > version_t
A version is an array of 3 integers.
Definition BuildToolVersion.hpp:37
version_t version() const
Version associated with the tool.
Definition BuildToolVersion.hpp:66
BuildToolVersion(const details::build_tool_version &tool)
TOOLS
Definition BuildToolVersion.hpp:40
@ AIRNT_PLUGIN
Definition BuildToolVersion.hpp:50
@ CLANG
Definition BuildToolVersion.hpp:42
@ AIRNT
Definition BuildToolVersion.hpp:49
@ UNKNOWN
Definition BuildToolVersion.hpp:41
@ SWIFT
Definition BuildToolVersion.hpp:43
@ METAL
Definition BuildToolVersion.hpp:47
@ AIRLLD
Definition BuildToolVersion.hpp:48
@ METAL_FRAMEWORK
Definition BuildToolVersion.hpp:53
@ LD
Definition BuildToolVersion.hpp:44
@ AIRPACK
Definition BuildToolVersion.hpp:51
@ LLD
Definition BuildToolVersion.hpp:45
@ GPUARCHIVER
Definition BuildToolVersion.hpp:52
TOOLS tool() const
The tools used.
Definition BuildToolVersion.hpp:61
~BuildToolVersion() override=default
Definition Visitor.hpp:210
Definition endianness_support.hpp:59
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
const char * to_string(BuildToolVersion::TOOLS tool)
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:41