LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
Metadata.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2024 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
17#include <LIEF/visibility.h>
18#include <LIEF/ObjC/Class.hpp>
20
21#include <LIEF/iterators.hpp>
22#include <LIEF/ObjC/DeclOpt.hpp>
23
24#include <memory>
25
26namespace LIEF {namespace objc {
29
30namespace details {
31class Metadata;
32}
33class LIEF_API Metadata {
38 public:
39 using classes_it = iterator_range<Class::Iterator>;
40 using protocols_it = iterator_range<Protocol::Iterator>;
41
42 Metadata(std::unique_ptr<details::Metadata> impl);
43 classes_it classes() const;
46 protocols_it protocols() const;
49 std::unique_ptr<Class> get_class(const std::string& name) const;
52 std::unique_ptr<Protocol> get_protocol(const std::string& name) const;
55 std::string to_decl(const DeclOpt& opt = DeclOpt()) const;
60
62 private:
63 std::unique_ptr<details::Metadata> impl_;
64};
65
66}
67}
68#endif
This class is the main interface to inspect Objective-C metadata.
Definition Metadata.hpp:37
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...
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.
Metadata(std::unique_ptr< details::Metadata > impl)
Definition ObjC/Class.hpp:32
Namespace related to ObjC metadata.
Definition MachO/Binary.hpp:41
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41