LIEF: Library to Instrument Executable Formats Version 1.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>
18#include <ostream>
19
20#include "LIEF/visibility.h"
21
23
24namespace LIEF {
25namespace MachO {
26
27class BinaryParser;
28
29namespace details {
30struct sub_client_command;
31}
32
44 friend class BinaryParser;
45
46 public:
47 SubClient() = default;
48 SubClient(const details::sub_client_command& cmd);
49
50 SubClient& operator=(const SubClient& copy) = default;
51 SubClient(const SubClient& copy) = default;
52
53 std::unique_ptr<LoadCommand> clone() const override {
54 return std::unique_ptr<SubClient>(new SubClient(*this));
55 }
56
58 const std::string& client() const {
59 return client_;
60 }
61
62 void client(std::string u) {
63 client_ = std::move(u);
64 }
65
66 ~SubClient() override = default;
67
68 void accept(Visitor& visitor) const override;
69
70 std::ostream& print(std::ostream& os) const override;
71
72 static bool classof(const LoadCommand* cmd) {
74 }
75
76 private:
77 std::string client_;
78};
79
80}
81}
82#endif
Class used to parse a single binary (i.e. non-FAT).
Definition BinaryParser.hpp:78
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:128
@ SUB_CLIENT
Definition LoadCommand.hpp:66
std::ostream & print(std::ostream &os) const override
SubClient & operator=(const SubClient &copy)=default
friend class BinaryParser
Definition SubClient.hpp:44
std::unique_ptr< LoadCommand > clone() const override
Definition SubClient.hpp:53
const std::string & client() const
Name of the client.
Definition SubClient.hpp:58
void client(std::string u)
Definition SubClient.hpp:62
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:72
Definition Visitor.hpp:212
Definition endianness_support.hpp:60
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:43