LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
ObjC/Metadata.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 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_OBJC_METADATA_H
16#define LIEF_OBJC_METADATA_H
18#include <LIEF/visibility.h>
19#include <LIEF/ObjC/Class.hpp>
22
23#include <LIEF/iterators.hpp>
24#include <LIEF/ObjC/DeclOpt.hpp>
25
26#include <memory>
27
28namespace LIEF {
30namespace objc {
31
32namespace details {
33class Metadata;
34}
35
40 public:
44
45 Metadata(std::unique_ptr<details::Metadata> impl);
46
49
53
57
59 std::unique_ptr<Class>
60 get_class(const std::string& name) const LIEF_LIFETIMEBOUND;
61
63 std::unique_ptr<Protocol>
64 get_protocol(const std::string& name) const LIEF_LIFETIMEBOUND;
65
69 std::string to_decl(const DeclOpt& opt = DeclOpt()) const;
70
72
73 private:
74 std::unique_ptr<details::Metadata> impl_;
75};
76
77}
78}
79#endif
Definition iterators.hpp:603
This class represents an Objective-C class (@interface).
Definition ObjC/Class.hpp:39
iterator_range< Protocol::Iterator > protocols_it
Definition ObjC/Metadata.hpp:42
protocols_it protocols() const
Return an iterator over the Objective-C protocols declared in this binary (@protocol).
std::unique_ptr< Protocol > get_protocol(const std::string &name) const
Try to find the Objective-C protocol with the given mangled name.
std::string to_decl(const DeclOpt &opt=DeclOpt()) const
Generate a header-like of all the Objective-C metadata identified in the binary. The generated output...
iterator_range< Class::Iterator > classes_it
Definition ObjC/Metadata.hpp:41
classes_it classes() const
Return an iterator over the different Objective-C classes (@interface).
std::unique_ptr< Class > get_class(const std::string &name) const
Try to find the Objective-C class with the given mangled name.
categories_it categories() const
Return an iterator over the Objective-C categories declared in this binary (e.g. @interface NSString ...
iterator_range< Category::Iterator > categories_it
Definition ObjC/Metadata.hpp:43
Metadata(std::unique_ptr< details::Metadata > impl)
This class represents an Objective-C @protocol.
Definition Protocol.hpp:37
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition Category.hpp:32
Namespace related to ObjC metadata.
Definition MachO/Binary.hpp:43
LIEF namespace.
Definition Abstract/Binary.hpp:41
This structure wraps options to tweak the generated output of functions like LIEF::objc::Metadata::to...
Definition DeclOpt.hpp:22
#define LIEF_API
Definition visibility.h:45