dex++ 0.3.1
C++ and C API reference
Loading...
Searching...
No Matches
types.hpp File Reference
#include <bit>
#include <compare>
#include <concepts>
#include <cstdint>
#include <initializer_list>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <type_traits>
#include <variant>
#include <vector>
#include "common/access_flags.hpp"
#include "common/annotation_visibility.hpp"
#include "common/ids.hpp"
#include "common/method_handle_kind.hpp"

Classes

class  dex::model::Shared< T >
 An immutable value held by a shared pointer. More...
 
class  dex::model::RegList
 A list of registers: the arguments of an invoke or filled-new-array. More...
 
struct  dex::model::Label
 A position in a method's code. More...
 
struct  dex::model::MethodHandle
 A method handle (java.lang.invoke.MethodHandle constant). More...
 
struct  dex::model::EncodedAnnotation
 An annotation's type and its explicitly set elements. More...
 
struct  dex::model::Value
 A constant value as the DEX format encodes it (encoded_value), with its exact type: a Java char stays a Char, a byte a Byte. More...
 
struct  dex::model::Value::Null
 
struct  dex::model::Value::Boolean
 
struct  dex::model::Value::Byte
 
struct  dex::model::Value::Short
 
struct  dex::model::Value::Char
 
struct  dex::model::Value::Int
 
struct  dex::model::Value::Long
 
struct  dex::model::Value::Float
 
struct  dex::model::Value::Double
 
struct  dex::model::Value::String
 
struct  dex::model::Value::Type
 A class literal, e.g. String.class. More...
 
struct  dex::model::Value::Field
 
struct  dex::model::Value::Method
 
struct  dex::model::Value::Enum
 An enum constant, named by its static field. More...
 
struct  dex::model::Value::MethodType
 A method type (java.lang.invoke.MethodType), as a prototype descriptor. More...
 
struct  dex::model::Value::Array
 
struct  dex::model::NamedValue
 One name = value element of an annotation. More...
 
struct  dex::model::AnnotationItem
 An annotation attached to a class, field, method or parameter. More...
 
struct  dex::model::CallSite
 An invoke-custom call site: the bootstrap method and the arguments it is linked with. More...
 
struct  dex::model::Nop
 
struct  dex::model::Move
 
struct  dex::model::MoveResult
 move-result: must directly follow an invoke or filled-new-array. More...
 
struct  dex::model::MoveException
 move-exception: must be the first instruction of a catch handler. More...
 
struct  dex::model::ReturnVoid
 
struct  dex::model::Return
 
struct  dex::model::Const
 A 32-bit constant (int, float bits, or 0 as null). More...
 
struct  dex::model::ConstWide
 A 64-bit constant into a register pair. More...
 
struct  dex::model::ConstString
 
struct  dex::model::ConstClass
 
struct  dex::model::ConstMethodHandle
 
struct  dex::model::ConstMethodType
 
struct  dex::model::MonitorEnter
 
struct  dex::model::MonitorExit
 
struct  dex::model::CheckCast
 
struct  dex::model::InstanceOf
 
struct  dex::model::ArrayLength
 
struct  dex::model::NewInstance
 
struct  dex::model::NewArray
 new-array: type is the array type, e.g. "[I". More...
 
struct  dex::model::FilledNewArray
 filled-new-array: type is the array type; the result is picked up by a following MoveResult. More...
 
struct  dex::model::FillArrayData
 fill-array-data: data holds the elements' little-endian bytes, element_width bytes each (1, 2, 4 or 8). More...
 
struct  dex::model::Throw
 
struct  dex::model::Goto
 
struct  dex::model::Switch
 packed-switch or sparse-switch, chosen by write(). More...
 
struct  dex::model::Switch::Case
 
struct  dex::model::Compare
 
struct  dex::model::If
 Branch to target if a cond b. More...
 
struct  dex::model::IfZero
 Branch to target if value cond 0. More...
 
struct  dex::model::ArrayGet
 
struct  dex::model::ArrayPut
 
struct  dex::model::InstanceGet
 
struct  dex::model::InstancePut
 
struct  dex::model::StaticGet
 
struct  dex::model::StaticPut
 
struct  dex::model::Invoke
 invoke-virtual, -super, -direct, -static or -interface. More...
 
struct  dex::model::InvokePolymorphic
 invoke-polymorphic: a signature-polymorphic call (MethodHandle.invoke...). More...
 
struct  dex::model::InvokeCustom
 
struct  dex::model::Unary
 
struct  dex::model::Binary
 dest = a op b. More...
 
struct  dex::model::BinaryLiteral
 dest = src op literal (for Rsub: literal - src). More...
 
struct  dex::model::LineNumber
 The source line of the code that follows. More...
 
struct  dex::model::LocalVariable
 
struct  dex::model::LocalStart
 A local variable comes into scope in reg. More...
 
struct  dex::model::LocalEnd
 The local variable in reg goes out of scope. More...
 
struct  dex::model::LocalRestart
 The local variable last in reg comes back into scope. More...
 
struct  dex::model::PrologueEnd
 The next LineNumber marks the end of the method prologue (a breakpoint spot). More...
 
struct  dex::model::EpilogueBegin
 The next LineNumber marks the start of the method epilogue. More...
 
struct  dex::model::SetSourceFile
 Later line numbers refer to another source file (nullopt: unknown). More...
 
struct  dex::model::Catch
 
struct  dex::model::TryRange
 The instructions between start and end are protected: an exception goes to the first matching catches entry, else to catch_all. More...
 
struct  dex::model::Code
 A method body. More...
 
struct  dex::model::FieldDef
 
struct  dex::model::MethodDef
 
struct  dex::model::ClassDef
 
struct  dex::model::Dex
 One DEX file. More...
 

Namespaces

namespace  dex
 
namespace  dex::model
 An editable, in-memory model of one DEX file.
 

Typedefs

using dex::model::Reg = uint16_t
 A virtual register number.
 
using dex::model::Insn = std::variant< Nop, Move, MoveResult, MoveException, ReturnVoid, Return, Const, ConstWide, ConstString, ConstClass, ConstMethodHandle, ConstMethodType, MonitorEnter, MonitorExit, CheckCast, InstanceOf, ArrayLength, NewInstance, NewArray, FilledNewArray, FillArrayData, Throw, Goto, Switch, Compare, If, IfZero, ArrayGet, ArrayPut, InstanceGet, InstancePut, StaticGet, StaticPut, Invoke, InvokePolymorphic, InvokeCustom, Unary, Binary, BinaryLiteral >
 
using dex::model::Item = std::variant< Insn, Label, LineNumber, LocalStart, LocalEnd, LocalRestart, PrologueEnd, EpilogueBegin, SetSourceFile >
 One entry of Code::items: an instruction, a label position, or a debug marker.
 

Enumerations

enum class  dex::model::ValueKind : uint8_t {
  dex::model::Normal , dex::model::Wide , dex::model::Object , dex::model::Boolean ,
  dex::model::Byte , dex::model::Char , dex::model::Short
}
 Which variant of a move, return, array, field or result instruction: the kind of value it moves. More...
 
enum class  dex::model::Condition : uint8_t {
  dex::model::Eq , dex::model::Ne , dex::model::Lt , dex::model::Ge ,
  dex::model::Gt , dex::model::Le
}
 Comparison of an If (two registers) or IfZero (a register and zero). More...
 
enum class  dex::model::CompareOp : uint8_t {
  dex::model::CmplFloat , dex::model::CmpgFloat , dex::model::CmplDouble , dex::model::CmpgDouble ,
  dex::model::CmpLong
}
 
enum class  dex::model::UnaryOp : uint8_t {
  dex::model::NegInt , dex::model::NotInt , dex::model::NegLong , dex::model::NotLong ,
  dex::model::NegFloat , dex::model::NegDouble , dex::model::IntToLong , dex::model::IntToFloat ,
  dex::model::IntToDouble , dex::model::LongToInt , dex::model::LongToFloat , dex::model::LongToDouble ,
  dex::model::FloatToInt , dex::model::FloatToLong , dex::model::FloatToDouble , dex::model::DoubleToInt ,
  dex::model::DoubleToLong , dex::model::DoubleToFloat , dex::model::IntToByte , dex::model::IntToChar ,
  dex::model::IntToShort
}
 
enum class  dex::model::BinaryOp : uint8_t {
  dex::model::AddInt , dex::model::SubInt , dex::model::MulInt , dex::model::DivInt ,
  dex::model::RemInt , dex::model::AndInt , dex::model::OrInt , dex::model::XorInt ,
  dex::model::ShlInt , dex::model::ShrInt , dex::model::UshrInt , dex::model::AddLong ,
  dex::model::SubLong , dex::model::MulLong , dex::model::DivLong , dex::model::RemLong ,
  dex::model::AndLong , dex::model::OrLong , dex::model::XorLong , dex::model::ShlLong ,
  dex::model::ShrLong , dex::model::UshrLong , dex::model::AddFloat , dex::model::SubFloat ,
  dex::model::MulFloat , dex::model::DivFloat , dex::model::RemFloat , dex::model::AddDouble ,
  dex::model::SubDouble , dex::model::MulDouble , dex::model::DivDouble , dex::model::RemDouble
}
 
enum class  dex::model::LiteralOp : uint8_t {
  dex::model::Add , dex::model::Rsub , dex::model::Mul , dex::model::Div ,
  dex::model::Rem , dex::model::And , dex::model::Or , dex::model::Xor ,
  dex::model::Shl , dex::model::Shr , dex::model::Ushr
}
 Operation of a BinaryLiteral (an int operation with a constant). More...