16#ifndef LIEF_DEX_CLASS_H
17#define LIEF_DEX_CLASS_H
21#include "LIEF/visibility.h"
22#include "LIEF/Object.hpp"
23#include "LIEF/iterators.hpp"
25#include "LIEF/DEX/enums.hpp"
26#include "LIEF/DEX/deopt.hpp"
39 using access_flags_list_t = std::vector<ACCESS_FLAGS>;
41 using methods_t = std::vector<Method*>;
45 using fields_t = std::vector<Field*>;
56 static std::string package_normalized(
const std::string& pkg_name);
57 static std::string fullname_normalized(
const std::string& pkg_cls);
58 static std::string fullname_normalized(
const std::string& pkg,
const std::string& cls_name);
64 Class(std::string fullname, uint32_t access_flags = ACCESS_FLAGS::ACC_UNKNOWN,
65 Class* parent =
nullptr, std::string source_filename =
"");
80 bool has(ACCESS_FLAGS f)
const;
117 void accept(
Visitor& visitor)
const override;
120 LIEF_API
friend std::ostream& operator<<(std::ostream& os,
const Class& cls);
125 std::string fullname_;
126 uint32_t access_flags_ = ACCESS_FLAGS::ACC_UNKNOWN;
127 Class* parent_ =
nullptr;
130 std::string source_filename_;
132 uint32_t original_index_ = UINT_MAX;
Class which represents a DEX Class (i.e. a Java/Kotlin class)
Definition DEX/Class.hpp:35
size_t index() const
Original index in the DEX class pool.
access_flags_list_t access_flags() const
Access flags used by this class.
it_const_methods methods() const
Methods implemented in this class.
bool has_parent() const
True if the current class extends another one.
std::string pretty_name() const
Demangled class name.
bool has(ACCESS_FLAGS f) const
Check if the class has the given access flag.
it_named_fields fields(const std::string &name)
Return Fields having the given name.
it_named_methods methods(const std::string &name)
Return Methods having the given name.
std::string name() const
Class name.
dex2dex_class_info_t dex2dex_info() const
De-optimize information.
const std::string & fullname() const
Mangled class name (e.g. Lcom/example/android/MyActivity;)
it_const_fields fields() const
Fields implemented in this class.
const Class * parent() const
Parent class.
std::string package_name() const
Package Name.
const std::string & source_filename() const
Filename associated with this class (if any)
Class which parses a DEX file to produce a DEX::File object.
Definition DEX/Parser.hpp:38
Definition Visitor.hpp:219
Iterator which return a ref on container's values given predicates.
Definition iterators.hpp:265
Iterator which returns reference on container's values.
Definition iterators.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:32