Go to the documentation of this file.
15#ifndef LIEF_DWARF_TYPE_H
16#define LIEF_DWARF_TYPE_H
68 using iterator_category = std::bidirectional_iterator_tag;
69 using value_type = std::unique_ptr<Type>;
70 using difference_type = std::ptrdiff_t;
71 using pointer = Type*;
72 using reference = std::unique_ptr<Type>&;
73 using implementation = details::TypeIt;
77 friend class Iterator;
84 template <
typename RefT>
85 PointerProxy(RefT &&R) : R(std::forward<RefT>(R)) {}
90 Iterator(std::unique_ptr<details::TypeIt> impl);
93 friend
LIEF_API bool operator==(const Iterator& LHS, const Iterator& RHS);
94 friend
LIEF_API bool operator!=(const Iterator& LHS, const Iterator& RHS) {
102 Iterator tmp = *
static_cast<Iterator*
>(
this);
103 --*
static_cast<Iterator *
>(
this);
108 Iterator tmp = *
static_cast<Iterator*
>(
this);
109 ++*
static_cast<Iterator *
>(
this);
116 return static_cast<const Iterator*
>(
this)->
operator*();
120 std::unique_ptr<details::TypeIt> impl_;
161 return kind() == KIND::UNSPECIFIED;
163 result<std::string>
name()
const;
167 result<uint64_t>
size()
const;
175 std::unique_ptr<Scope>
scope()
const;
180 const T*
as()
const {
181 if (T::classof(
this)) {
182 return static_cast<const T*
>(
this);
187 static std::unique_ptr<Type>
create(std::unique_ptr<details::Type> impl);
190 Type(std::unique_ptr<details::Type> impl);
191 Type(details::Type& impl);
193 LIEF::details::canbe_unique<details::Type> impl_;
This class materializes a scope in which Function, Variable, Type, ... can be defined.
Definition Scope.hpp:32
pointer operator->() const
Definition DWARF/Type.hpp:79
PointerProxy operator->() const
Definition DWARF/Type.hpp:115
Iterator operator--(int)
Definition DWARF/Type.hpp:101
Iterator operator++(int)
Definition DWARF/Type.hpp:107
Iterator(const Iterator &)
Iterator(Iterator &&) noexcept
std::unique_ptr< Type > operator*() const
This class represents a DWARF Type which includes:
Definition DWARF/Type.hpp:64
const T * as() const
Definition DWARF/Type.hpp:180
bool is_unspecified() const
Whether this type is a DW_TAG_unspecified_type
Definition DWARF/Type.hpp:160
result< std::string > name() const
Return the type's name using either DW_AT_name or DW_AT_picture_string (if any).
result< uint64_t > size() const
Return the size of the type or an error if it can't be computed.
debug_location_t location() const
Return the debug location where this type is defined.
static std::unique_ptr< Type > create(std::unique_ptr< details::Type > impl)
std::unique_ptr< Scope > scope() const
Return the scope in which this type is defined.
Definition DWARF/CompilationUnit.hpp:30
Namespace for the DWARF debug format.
Definition DWARF/CompilationUnit.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41