Go to the documentation of this file.
15#ifndef LIEF_OBJC_CLASS_H
16#define LIEF_OBJC_CLASS_H
42 using iterator_category = std::bidirectional_iterator_tag;
43 using value_type = std::unique_ptr<Class>;
44 using difference_type = std::ptrdiff_t;
45 using pointer = Class*;
46 using reference = std::unique_ptr<Class>&;
47 using implementation = details::ClassIt;
51 friend class Iterator;
58 template <
typename RefT>
59 PointerProxy(RefT &&R) : R(std::forward<RefT>(R)) {}
64 Iterator(std::unique_ptr<details::ClassIt> impl);
67 friend
LIEF_API bool operator==(const Iterator& LHS, const Iterator& RHS);
69 friend
LIEF_API bool operator!=(const Iterator& LHS, const Iterator& RHS) {
77 Iterator tmp = *
static_cast<Iterator*
>(
this);
78 --*
static_cast<Iterator *
>(
this);
83 Iterator tmp = *
static_cast<Iterator*
>(
this);
84 ++*
static_cast<Iterator *
>(
this);
91 return static_cast<const Iterator*
>(
this)->
operator*();
95 std::unique_ptr<details::ClassIt> impl_;
98 public:
using methods_t = iterator_range<Method::Iterator>;
101 using protocols_t = iterator_range<Protocol::Iterator>;
104 using properties_t = iterator_range<Property::Iterator>;
107 using ivars_t = iterator_range<IVar::Iterator>;
111 Class(std::unique_ptr<details::Class> impl);
112 std::string
name()
const;
132 ivars_t
ivars()
const;
135 std::string
to_decl(
const DeclOpt& opt = DeclOpt())
const;
143 std::unique_ptr<details::Class> impl_;
pointer operator->() const
Definition ObjC/Class.hpp:53
std::unique_ptr< Class > operator*() const
Iterator operator--(int)
Definition ObjC/Class.hpp:76
PointerProxy operator->() const
Definition ObjC/Class.hpp:90
Iterator(const Iterator &)
Iterator operator++(int)
Definition ObjC/Class.hpp:82
Iterator(Iterator &&) noexcept
This class represents an Objective-C class (@interface)
Definition ObjC/Class.hpp:38
std::string name() const
Name of the class.
properties_t properties() const
Iterator over the properties of this class.
Class(std::unique_ptr< details::Class > impl)
std::string to_decl(const DeclOpt &opt=DeclOpt()) const
Generate a header-like string for this specific class.
std::unique_ptr< Class > super_class() const
Parent class in case of inheritance.
ivars_t ivars() const
Iterator over the different instance variables defined in this class.
methods_t methods() const
Iterator over the different methods defined by this class.
std::string demangled_name() const
Demangled name of the class.
protocols_t protocols() const
Iterator over the different protocols implemented by this class.
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