LIEF: Library to Instrument Executable Formats Version 0.16.0
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}
31class LIEF_API BuildToolVersion : public Object {
35 public: 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
48 public:
49 BuildToolVersion() = default;
50 BuildToolVersion(const details::build_tool_version& tool);
51 TOOLS tool() const {
54 return tool_;
55 }
56 version_t version() const {
59 return version_;
60 }
61
62 ~BuildToolVersion() override = default;
63
64 void accept(Visitor& visitor) const override;
65
66 LIEF_API friend
67 std::ostream& operator<<(std::ostream& os, const BuildToolVersion& tool);
68
69 private:
70 TOOLS tool_ = TOOLS::UNKNOWN;
71 version_t version_;
72};
73
74LIEF_API const char* to_string(BuildToolVersion::TOOLS tool);
75
76}
77}
78#endif
Object.hpp
LIEF::MachO::BuildToolVersion
Class that represents a tool's version that was involved in the build of the binary.
Definition BuildToolVersion.hpp:34
LIEF::MachO::BuildToolVersion::BuildToolVersion
BuildToolVersion()=default
LIEF::MachO::BuildToolVersion::operator<<
friend std::ostream & operator<<(std::ostream &os, const BuildToolVersion &tool)
LIEF::MachO::BuildToolVersion::accept
void accept(Visitor &visitor) const override
LIEF::MachO::BuildToolVersion::version
version_t version() const
Version associated with the tool.
Definition BuildToolVersion.hpp:58
LIEF::MachO::BuildToolVersion::BuildToolVersion
BuildToolVersion(const details::build_tool_version &tool)
LIEF::MachO::BuildToolVersion::TOOLS
TOOLS
Definition BuildToolVersion.hpp:40
LIEF::MachO::BuildToolVersion::tool
TOOLS tool() const
The tools used.
Definition BuildToolVersion.hpp:53
LIEF::MachO::BuildToolVersion::~BuildToolVersion
~BuildToolVersion() override=default
LIEF::MachO::details
Definition endianness_support.hpp:59
LIEF::MachO
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF::MachO::MACHO_TYPES::UNKNOWN
@ UNKNOWN
Definition MachO/enums.hpp:25
LIEF::MachO::to_string
const char * to_string(BuildToolVersion::TOOLS tool)
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41