LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
SubFramework.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_SUB_FRAMEWORK_H
17#define LIEF_MACHO_SUB_FRAMEWORK_H
18#include <string>
19#include <ostream>
20
21#include "LIEF/visibility.h"
22
24
25namespace LIEF {
26namespace MachO {
27
28class BinaryParser;
29
30namespace details {
31struct sub_framework_command;
32}
33
47 friend class BinaryParser;
48 public:
49 SubFramework() = default;
50 SubFramework(const details::sub_framework_command& cmd);
51
52 SubFramework& operator=(const SubFramework& copy) = default;
53 SubFramework(const SubFramework& copy) = default;
54
55 std::unique_ptr<LoadCommand> clone() const override {
56 return std::unique_ptr<SubFramework>(new SubFramework(*this));
57 }
58
60 const std::string& umbrella() const {
61 return umbrella_;
62 }
63 void umbrella(std::string u) {
64 umbrella_ = std::move(u);
65 }
66
67 ~SubFramework() override = default;
68
69 void accept(Visitor& visitor) const override;
70
71 std::ostream& print(std::ostream& os) const override;
72
73 static bool classof(const LoadCommand* cmd) {
74 return cmd->command() == LoadCommand::TYPE::SUB_FRAMEWORK;
75 }
76
77 private:
78 std::string umbrella_;
79};
80
81}
82}
83#endif
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:36
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:122
Class that represents the SubFramework command. Accodring to the Mach-O loader.h documentation:
Definition SubFramework.hpp:46
SubFramework(const SubFramework &copy)=default
std::unique_ptr< LoadCommand > clone() const override
Definition SubFramework.hpp:55
SubFramework & operator=(const SubFramework &copy)=default
SubFramework(const details::sub_framework_command &cmd)
~SubFramework() override=default
std::ostream & print(std::ostream &os) const override
void accept(Visitor &visitor) const override
void umbrella(std::string u)
Definition SubFramework.hpp:63
const std::string & umbrella() const
Name of the umbrella framework.
Definition SubFramework.hpp:60
static bool classof(const LoadCommand *cmd)
Definition SubFramework.hpp:73
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41