LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
SubFramework.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_SUB_FRAMEWORK_H
17#define LIEF_MACHO_SUB_FRAMEWORK_H
18#include <string_view>
19#include <memory>
20#include <ostream>
21#include <string>
22
24#include "LIEF/visibility.h"
25
27
28
29namespace LIEF::MachO {
30
31class BinaryParser;
32
33namespace details {
34struct sub_framework_command;
35}
36
50 friend class BinaryParser;
51
52 public:
53 SubFramework() = default;
54 SubFramework(const details::sub_framework_command& cmd);
55
56 SubFramework& operator=(const SubFramework& copy) = default;
57 SubFramework(const SubFramework& copy) = default;
58
59 std::unique_ptr<LoadCommand> clone() const override {
60 return std::make_unique<SubFramework>(*this);
61 }
62
64 std::string_view umbrella() const LIEF_LIFETIMEBOUND {
65 return umbrella_;
66 }
67 void umbrella(std::string u) {
68 umbrella_ = std::move(u);
69 }
70
71 ~SubFramework() override = default;
72
73 void accept(Visitor& visitor) const override;
74
75 std::ostream& print(std::ostream& os) const override;
76
77 static bool classof(const LoadCommand* cmd) {
79 }
80
81 private:
82 std::string umbrella_;
83};
84
85}
86
87#endif
Class used to parse a single binary (i.e. non-FAT).
Definition BinaryParser.hpp:79
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:132
@ SUB_FRAMEWORK
Definition LoadCommand.hpp:66
SubFramework(const SubFramework &copy)=default
std::unique_ptr< LoadCommand > clone() const override
Definition SubFramework.hpp:59
friend class BinaryParser
Definition SubFramework.hpp:50
SubFramework & operator=(const SubFramework &copy)=default
SubFramework(const details::sub_framework_command &cmd)
~SubFramework() override=default
std::ostream & print(std::ostream &os) const override
std::string_view umbrella() const
Name of the umbrella framework.
Definition SubFramework.hpp:64
void accept(Visitor &visitor) const override
void umbrella(std::string u)
Definition SubFramework.hpp:67
static bool classof(const LoadCommand *cmd)
Definition SubFramework.hpp:77
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