LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
SubClient.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_MACHO_SUB_CLIENT_H
16#define LIEF_MACHO_SUB_CLIENT_H
17#include <string_view>
18#include <memory>
19#include <ostream>
20#include <string>
21
23#include "LIEF/visibility.h"
24
26
27
28namespace LIEF::MachO {
29
30class BinaryParser;
31
32namespace details {
33struct sub_client_command;
34}
35
47 friend class BinaryParser;
48
49 public:
50 SubClient() = default;
51 SubClient(const details::sub_client_command& cmd);
52
53 SubClient& operator=(const SubClient& copy) = default;
54 SubClient(const SubClient& copy) = default;
55
56 std::unique_ptr<LoadCommand> clone() const override {
57 return std::make_unique<SubClient>(*this);
58 }
59
61 std::string_view client() const LIEF_LIFETIMEBOUND {
62 return client_;
63 }
64
65 void client(std::string u) {
66 client_ = std::move(u);
67 }
68
69 ~SubClient() override = default;
70
71 void accept(Visitor& visitor) const override;
72
73 std::ostream& print(std::ostream& os) const override;
74
75 static bool classof(const LoadCommand* cmd) {
77 }
78
79 private:
80 std::string client_;
81};
82
83}
84
85#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_CLIENT
Definition LoadCommand.hpp:68
std::ostream & print(std::ostream &os) const override
SubClient & operator=(const SubClient &copy)=default
friend class BinaryParser
Definition SubClient.hpp:47
std::unique_ptr< LoadCommand > clone() const override
Definition SubClient.hpp:56
std::string_view client() const
Name of the client.
Definition SubClient.hpp:61
void client(std::string u)
Definition SubClient.hpp:65
SubClient(const details::sub_client_command &cmd)
void accept(Visitor &visitor) const override
~SubClient() override=default
SubClient(const SubClient &copy)=default
static bool classof(const LoadCommand *cmd)
Definition SubClient.hpp:75
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