LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
LIEF::DEX::Type Class Reference

Class which represents a DEX type as described in the format specifications: https://source.android.com/devices/tech/dalvik/dex-format#typedescriptor. More...

#include <Type.hpp>

Inheritance diagram for LIEF::DEX::Type:
Collaboration diagram for LIEF::DEX::Type:

Public Types

enum class  TYPES { UNKNOWN = 0 , PRIMITIVE = 1 , CLASS = 2 , ARRAY = 3 }
 
enum class  PRIMITIVES {
  VOID_T = 0x01 , BOOLEAN = 0x02 , BYTE = 0x03 , SHORT = 0x04 ,
  CHAR = 0x05 , INT = 0x06 , LONG = 0x07 , FLOAT = 0x08 ,
  DOUBLE = 0x09
}
 
using array_t = std::vector<Type>
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Public Member Functions

 Type ()
 
 Type (const std::string &mangled)
 
 Type (const Type &other)
 
TYPES type () const
 Whether it is a primitive type, a class, ...
 
const Classcls () const
 
const array_tarray () const
 
const PRIMITIVESprimitive () const
 
Classcls ()
 IF the current type is a TYPES::CLASS, return the associated DEX::CLASS. Otherwise the returned value is undefined.
 
array_tarray ()
 IF the current type is a TYPES::ARRAY, return the associated array. Otherwise the returned value is undefined.
 
PRIMITIVESprimitive ()
 IF the current type is a TYPES::PRIMITIVE, return the associated PRIMITIVES. Otherwise the returned value is undefined.
 
size_t dim () const
 Return the array dimension if the current type is an array. Otherwise it returns 0.
 
const Typeunderlying_array_type () const
 In the case of a TYPES::ARRAY, return the array's type.
 
Typeunderlying_array_type ()
 
void accept (Visitor &visitor) const override
 
 ~Type () override
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 
virtual ~Object ()
 

Static Public Member Functions

static std::string pretty_name (PRIMITIVES p)
 

Detailed Description

Class which represents a DEX type as described in the format specifications: https://source.android.com/devices/tech/dalvik/dex-format#typedescriptor.

Member Typedef Documentation

◆ array_t

using LIEF::DEX::Type::array_t = std::vector<Type>

Member Enumeration Documentation

◆ PRIMITIVES

enum class LIEF::DEX::Type::PRIMITIVES
strong
Enumerator
VOID_T 
BOOLEAN 
BYTE 
SHORT 
CHAR 
INT 
LONG 
FLOAT 
DOUBLE 

◆ TYPES

enum class LIEF::DEX::Type::TYPES
strong
Enumerator
UNKNOWN 
PRIMITIVE 
CLASS 
ARRAY 

Constructor & Destructor Documentation

◆ Type() [1/3]

LIEF::DEX::Type::Type ( )

◆ Type() [2/3]

LIEF::DEX::Type::Type ( const std::string & mangled)

◆ Type() [3/3]

LIEF::DEX::Type::Type ( const Type & other)

◆ ~Type()

LIEF::DEX::Type::~Type ( )
override

Member Function Documentation

◆ accept()

void LIEF::DEX::Type::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ array() [1/2]

array_t & LIEF::DEX::Type::array ( )

IF the current type is a TYPES::ARRAY, return the associated array. Otherwise the returned value is undefined.

◆ array() [2/2]

const array_t & LIEF::DEX::Type::array ( ) const

◆ cls() [1/2]

Class & LIEF::DEX::Type::cls ( )

IF the current type is a TYPES::CLASS, return the associated DEX::CLASS. Otherwise the returned value is undefined.

◆ cls() [2/2]

const Class & LIEF::DEX::Type::cls ( ) const

◆ dim()

size_t LIEF::DEX::Type::dim ( ) const

Return the array dimension if the current type is an array. Otherwise it returns 0.

◆ pretty_name()

static std::string LIEF::DEX::Type::pretty_name ( PRIMITIVES p)
static

◆ primitive() [1/2]

PRIMITIVES & LIEF::DEX::Type::primitive ( )

IF the current type is a TYPES::PRIMITIVE, return the associated PRIMITIVES. Otherwise the returned value is undefined.

◆ primitive() [2/2]

const PRIMITIVES & LIEF::DEX::Type::primitive ( ) const

◆ type()

TYPES LIEF::DEX::Type::type ( ) const

Whether it is a primitive type, a class, ...

◆ underlying_array_type() [1/2]

Type & LIEF::DEX::Type::underlying_array_type ( )

◆ underlying_array_type() [2/2]

const Type & LIEF::DEX::Type::underlying_array_type ( ) const

In the case of a TYPES::ARRAY, return the array's type.

Member Data Documentation

◆ array_

array_t* LIEF::DEX::Type::array_

◆ basic_

PRIMITIVES* LIEF::DEX::Type::basic_

◆ cls_

Class* LIEF::DEX::Type::cls_ {nullptr}

The documentation for this class was generated from the following file: