IDA C++ SDK 9.2
Loading...
Searching...
No Matches
enum_type_data_t Struct Reference

Enum type information (see tinfo_t::get_enum_details()) More...

#include <typeinf.hpp>

Inheritance diagram for enum_type_data_t:
qvector< edm_t >

Public Member Functions

 enum_type_data_t (bte_t _bte=BTE_ALWAYS|BTE_HEX)
 DEFINE_MEMORY_ALLOCATION_FUNCS () int get_enum_radix() const
 Get enum constant radix.
bool is_number_signed () const
void set_enum_radix (int radix, bool sign)
 Set radix to display constants.
bool is_char () const
bool is_dec () const
bool is_hex () const
bool is_oct () const
bool is_bin () const
bool is_udec () const
bool is_shex () const
bool is_soct () const
bool is_sbin () const
bool has_lzero () const
void set_lzero (bool on)
uint64 calc_mask () const
bool store_64bit_values () const
bool is_bf () const
 is bitmask or ordinary enum?
int calc_nbytes () const
 get the width of enum in bytes
bool set_nbytes (int nbytes)
 set enum width (nbytes)
bool get_constant_group (size_t *group_start_index, size_t *group_size, size_t idx) const
 get group parameters for the constant, valid for bitmask enum
bool is_group_mask_at (size_t idx) const
 is the enum member at IDX a non-trivial group mask?
bool is_valid_group_sizes () const
 is valid group sizes
ssize_t find_member (const char *name, size_t from=0, size_t to=size_t(-1)) const
 find member (constant or bmask) by name
ssize_t find_member (uint64 value, uchar serial, size_t from=0, size_t to=size_t(-1), uint64 vmask=uint64(-1)) const
 find member (constant or bmask) by value
void swap (enum_type_data_t &r)
 swap two instances
void add_constant (const char *name, uint64 value, const char *cmt=nullptr)
 add constant for regular enum
tinfo_code_t get_value_repr (value_repr_t *repr) const
 get enum radix and other representation info
tinfo_code_t set_value_repr (const value_repr_t &repr)
 set enum radix and other representation info
uchar get_serial (size_t index) const
 returns serial for the constant
uchar get_max_serial (uint64 value) const
 return the maximum serial for the value
int for_all_constants (std::function< int(size_t idx, size_t grp_start, int grp_size)> v) const
 visit all enum constants not bmasks
int for_all_groups (std::function< int(size_t grp_start, int grp_size)> v, bool skip_trivial=false) const
 visit all enum groups, for bitmask enum only
Public Member Functions inherited from qvector< edm_t >
 qvector (void)
 Constructor.
 qvector (const qvector< edm_t > &x)
 Constructor - creates a new qvector identical to 'x'.
 qvector (qvector< edm_t > &&x) noexcept
 Move constructor.
 ~qvector (void)
 Destructor.
 DEFINE_MEMORY_ALLOCATION_FUNCS () void push_back(const edm_t &x)
 Append a new element to the end the qvector.
void push_back (edm_t &&x)
 Append a new element to the end the qvector with a move semantics.
void emplace_back (Args &&... args)
 Construct and append a new element to the end the qvector with a forwarding semantics.
edm_tpush_back (void)
 Append a new empty element to the end of the qvector.
void pop_back (void)
 Remove the last element in the qvector.
size_t size (void) const
 Get the number of elements in the qvector.
bool empty (void) const
 Does the qvector have 0 elements?
const edm_toperator[] (size_t _idx) const
 Allows use of typical c-style array indexing for qvectors.
edm_toperator[] (size_t _idx)
 Allows use of typical c-style array indexing for qvectors.
const edm_tat (size_t _idx) const
 Get element at index '_idx'.
edm_tat (size_t _idx)
 Get element at index '_idx'.
const edm_tfront (void) const
 Get the first element in the qvector.
edm_tfront (void)
 Get the first element in the qvector.
const edm_tback (void) const
 Get the last element in the qvector.
edm_tback (void)
 Get the last element in the qvector.
void qclear (void)
 Destroy all elements but do not free memory.
void clear (void)
 Destroy all elements and free memory.
qvector< edm_t > & operator= (const qvector< edm_t > &x)
 Allow assignment of one qvector to another using '='.
qvector< edm_t > & operator= (qvector< edm_t > &&x) noexcept
 Move assignment operator.
void resize (size_t _newsize, const edm_t &x)
 Resize to the given size.
void resize (size_t _newsize)
 Same as resize(size_t, const T &), but extra space is filled with empty elements.
void resize_noinit (size_t _newsize)
void grow (const edm_t &x=edm_t())
 Add an element to the end of the qvector, which will be a new T() if x is not given.
size_t capacity (void) const
 Get the number of elements that this qvector can contain - not the same as the number of elements currently in the qvector (size())
void reserve (size_t cnt)
 Increase the capacity of the qvector.
void truncate (void)
 Shrink the capacity down to the current number of elements.
void swap (qvector< edm_t > &r) noexcept
 Replace all attributes of this qvector with that of 'r', and vice versa.
edm_textract (void)
 Empty the qvector and return a pointer to it's contents.
void inject (edm_t *s, size_t len)
 Populate the qvector with dynamic memory.
bool operator== (const qvector< edm_t > &r) const
 Allow ability to test the equality of two qvectors using '=='.
bool operator!= (const qvector< edm_t > &r) const
 Allow ability to test equality of two qvectors using '!='.
iterator begin (void)
 Get an iterator that points to the first element in the qvector.
iterator end (void)
 Get an iterator that points to the end of the qvector (NOT the last element)
const_iterator begin (void) const
 Get a const iterator that points to the first element in the qvector.
const_iterator end (void) const
 Get a const iterator that points to the end of the qvector (NOT the last element)
iterator insert (iterator it, const edm_t &x)
 Insert an element into the qvector at a specified position.
iterator insert (iterator it, edm_t &&x)
 Insert an element into the qvector with a move semantics.
iterator insert (iterator it, it2 first, it2 last)
 Insert a several elements to the qvector at a specified position.
iterator erase (iterator it)
 Remove an element from the qvector.
iterator erase (iterator first, iterator last)
 Remove a subset of the qvector.
iterator find (const edm_t &x)
 Find an element in the qvector.
const_iterator find (const edm_t &x) const
 Find an element in the qvector.
ssize_t index (const edm_t &x) const
 Find index of the specified value or return -1.
void add (const edm_t &x)
 Add an element to the end of the qvector.
void add (edm_t &&x)
bool has (const edm_t &x) const
 Does the qvector contain x?
bool add_unique (const edm_t &x)
 Add an element to the end of the qvector - only if it isn't already present.
bool del (const edm_t &x)
 Find an element and remove it.
const char * dstr (void) const

Public Attributes

intvec_t group_sizes
 if present, specifies bitmask group sizes each non-trivial group starts with a mask member
uint32 taenum_bits = 0
 Type attributes for enums
bte_t bte
 enum member sizes (shift amount) and style.

Additional Inherited Members

Public Types inherited from qvector< edm_t >
typedef edm_t value_type
 the type of objects contained in this qvector
typedef edm_titerator
typedef const edm_tconst_iterator

Detailed Description

Enum type information (see tinfo_t::get_enum_details())

Constructor & Destructor Documentation

◆ enum_type_data_t()

enum_type_data_t::enum_type_data_t ( bte_t _bte = BTE_ALWAYS|BTE_HEX)
inline

Member Function Documentation

◆ DEFINE_MEMORY_ALLOCATION_FUNCS()

enum_type_data_t::DEFINE_MEMORY_ALLOCATION_FUNCS ( ) const
inline

Get enum constant radix.

Returns
radix or 1 for BTE_CHAR

◆ is_number_signed()

bool enum_type_data_t::is_number_signed ( ) const
inline

◆ set_enum_radix()

void enum_type_data_t::set_enum_radix ( int radix,
bool sign )
inline

Set radix to display constants.

Parameters
radixradix with the special case 1 to display as character
sign

◆ is_char()

bool enum_type_data_t::is_char ( ) const
inline

◆ is_dec()

bool enum_type_data_t::is_dec ( ) const
inline

◆ is_hex()

bool enum_type_data_t::is_hex ( ) const
inline

◆ is_oct()

bool enum_type_data_t::is_oct ( ) const
inline

◆ is_bin()

bool enum_type_data_t::is_bin ( ) const
inline

◆ is_udec()

bool enum_type_data_t::is_udec ( ) const
inline

◆ is_shex()

bool enum_type_data_t::is_shex ( ) const
inline

◆ is_soct()

bool enum_type_data_t::is_soct ( ) const
inline

◆ is_sbin()

bool enum_type_data_t::is_sbin ( ) const
inline

◆ has_lzero()

bool enum_type_data_t::has_lzero ( ) const
inline

◆ set_lzero()

void enum_type_data_t::set_lzero ( bool on)
inline

◆ calc_mask()

uint64 enum_type_data_t::calc_mask ( ) const
inline

◆ store_64bit_values()

bool enum_type_data_t::store_64bit_values ( ) const
inline

◆ is_bf()

bool enum_type_data_t::is_bf ( ) const
inline

is bitmask or ordinary enum?

◆ calc_nbytes()

int enum_type_data_t::calc_nbytes ( ) const
inline

get the width of enum in bytes

◆ set_nbytes()

bool enum_type_data_t::set_nbytes ( int nbytes)
inline

set enum width (nbytes)

◆ get_constant_group()

bool enum_type_data_t::get_constant_group ( size_t * group_start_index,
size_t * group_size,
size_t idx ) const
inline

get group parameters for the constant, valid for bitmask enum

Parameters
[out]group_start_indexindex of the group mask
[out]group_sizegroup size (>=1)
idxconstant index
Returns
success

◆ is_group_mask_at()

bool enum_type_data_t::is_group_mask_at ( size_t idx) const
inline

is the enum member at IDX a non-trivial group mask?

a trivial group consist of one bit and has just one member, which can be considered as a mask or a bitfield constant

Parameters
idxindex
Returns
success

◆ is_valid_group_sizes()

bool enum_type_data_t::is_valid_group_sizes ( ) const
inline

is valid group sizes

◆ find_member() [1/2]

ssize_t enum_type_data_t::find_member ( const char * name,
size_t from = 0,
size_t to = size_t(-1) ) const
inline

find member (constant or bmask) by name

◆ find_member() [2/2]

ssize_t enum_type_data_t::find_member ( uint64 value,
uchar serial,
size_t from = 0,
size_t to = size_t(-1),
uint64 vmask = uint64(-1) ) const
inline

find member (constant or bmask) by value

◆ swap()

void enum_type_data_t::swap ( enum_type_data_t & r)
inline

swap two instances

◆ add_constant()

void enum_type_data_t::add_constant ( const char * name,
uint64 value,
const char * cmt = nullptr )
inline

add constant for regular enum

◆ get_value_repr()

tinfo_code_t enum_type_data_t::get_value_repr ( value_repr_t * repr) const
inline

get enum radix and other representation info

Parameters
reprvalue display info

◆ set_value_repr()

tinfo_code_t enum_type_data_t::set_value_repr ( const value_repr_t & repr)
inline

set enum radix and other representation info

Parameters
reprvalue display info

◆ get_serial()

uchar enum_type_data_t::get_serial ( size_t index) const
inline

returns serial for the constant

◆ get_max_serial()

uchar enum_type_data_t::get_max_serial ( uint64 value) const
inline

return the maximum serial for the value

◆ for_all_constants()

int enum_type_data_t::for_all_constants ( std::function< int(size_t idx, size_t grp_start, int grp_size)> v) const
inline

visit all enum constants not bmasks

◆ for_all_groups()

int enum_type_data_t::for_all_groups ( std::function< int(size_t grp_start, int grp_size)> v,
bool skip_trivial = false ) const
inline

visit all enum groups, for bitmask enum only

Member Data Documentation

◆ group_sizes

intvec_t enum_type_data_t::group_sizes

if present, specifies bitmask group sizes each non-trivial group starts with a mask member

◆ taenum_bits

uint32 enum_type_data_t::taenum_bits = 0

◆ bte

bte_t enum_type_data_t::bte

enum member sizes (shift amount) and style.

do not manually set BTE_BITMASK, use set_enum_is_bitmask()


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