LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
BuildToolVersion.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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 {
41 UNKNOWN = 0,
42 CLANG = 1,
43 SWIFT = 2,
44 LD = 3,
45 };
46
47 public:
48 BuildToolVersion() = default;
49 BuildToolVersion(const details::build_tool_version& tool);
50
52 TOOLS tool() const {
53 return tool_;
54 }
55
58 return version_;
59 }
60
61 ~BuildToolVersion() override = default;
62
63 void accept(Visitor& visitor) const override;
64
65 LIEF_API friend
66 std::ostream& operator<<(std::ostream& os, const BuildToolVersion& tool);
67
68 private:
69 TOOLS tool_ = TOOLS::UNKNOWN;
70 version_t version_;
71};
72
74
75}
76}
77#endif
Class that represents a tool's version that was involved in the build of the binary.
Definition BuildToolVersion.hpp:34
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:57
BuildToolVersion(const details::build_tool_version &tool)
TOOLS
Definition BuildToolVersion.hpp:40
TOOLS tool() const
The tools used.
Definition BuildToolVersion.hpp:52
~BuildToolVersion() override=default
Definition Object.hpp:25
Definition Visitor.hpp:224
const char * to_string(BuildToolVersion::TOOLS tool)
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41