IDA SDK

- Main Page
- Header Files
- Classes
- Modules

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Types | List of all members
areaset_t Class Reference

## Detailed Description

An ordered set of non-overlapping address ranges.

## Public Member Functions
| areaset_t (void)
| Constructor.
| areaset_t (const area_t &area)
| Constructor - Initialize set with 'area'.
| areaset_t (const areaset_t &ivs)
| Constructor - Initialize set with 'ivs'.
areaset_t & | operator= (const areaset_t &ivs)
void | swap (areaset_t &r)
| Set this = 'r' and 'r' = this. See qvector::swap()
bool | add (const area_t &area)
| Add an address range to the set. More...
bool | add (ea_t start, ea_t _end)
| Create a new area_t from 'start' and 'end' and add it to the set.
bool | add (const areaset_t &aset)
| Add each element of 'aset' to the set. More...
bool | sub (const area_t &area)
| Subtract an address range from the set. More...
bool | sub (ea_t ea)
| Subtract an ea (an area of size 1) from the set. See sub(const area_t &)
bool | sub (const areaset_t &aset)
| Subtract each area in 'aset' from the set. More...
bool | has_common (const area_t &area) const
| Is there an ea in 'area' that is also in the areaset?
bool | includes (const area_t &area) const
| Is every ea in 'area' contained in the areaset?
size_t | print (char *buf, size_t bufsize) const
| Print each area_t in the areaset.
asize_t | count (void) const
| Size in bytes.
const area_t & | getarea (int idx) const
| Get the area_t at index 'idx'.
const area_t & | lastarea (void) const
| Get the last area_t in the set.
size_t | nareas (void) const
| Get the number of area_t elements in the set.
bool | empty (void) const
| Does the set have zero elements.
void | clear (void)
| Delete all elements from the set. See qvector::clear()
bool | has_common (const areaset_t &aset) const
| Does any element of 'aset' overlap with an element in this areaset?. See area_t::overlaps()
bool | contains (ea_t ea) const
| Does an element of the areaset contain 'ea'? See area_t::contains(ea_t)
bool | contains (const areaset_t &aset) const
| Is every element in 'aset' contained in an element of this areaset?. See area_t::contains(area_t)
bool | intersect (const areaset_t &aset)
| Set the areaset to its intersection with 'aset'. More...
bool | is_subset_of (const areaset_t &aset) const
| Is every element in the areaset contained in an element of 'aset'?
bool | is_equal (const areaset_t &aset) const
| Do this areaset and 'aset' have identical elements?
bool | operator== (const areaset_t &aset) const
| Compare two areasets with '=='.
bool | operator!= (const areaset_t &aset) const
| Compare two areasets with '!='.
const_iterator | begin (void) const
| Get an iterator that points to the first element in the set.
const_iterator | end (void) const
| Get an iterator that points to the end of the set. (This is NOT the last element)
iterator | begin (void)
| Get an iterator that points to the first element in the set. More...
iterator | end (void)
| Get an iterator that points to the end of the set. (This is NOT the last element) More...
const_iterator | lower_bound (ea_t ea) const
| Get the first area that contains at least one ea_t value greater than 'ea'.
const_iterator | upper_bound (ea_t ea) const
| Get the first area such that every ea_t value in this area is strictly greater than 'ea'.
const area_t * | find_area (ea_t ea) const
| Get the element from the set that contains 'ea'. More...
const area_t * | cached_area (void) const
| When searching the areaset, we keep a cached element to help speed up searches. More...
ea_t | next_addr (ea_t ea) const
| Get the smallest ea_t value greater than 'ea' contained in the areaset.
ea_t | prev_addr (ea_t ea) const
| Get the largest ea_t value less than 'ea' contained in the areaset.
ea_t | next_area (ea_t ea) const
| Get the smallest ea_t value greater than 'ea' that is not in the same area as 'ea'.
ea_t | prev_area (ea_t ea) const
| Get the largest ea_t value less than 'ea' that is not in the same area as 'ea'.
int | move_chunk (ea_t from, ea_t to, asize_t size)
| Subtract the address range (from, from+size) and add the range (to, to+size)
int | check_move_args (ea_t from, ea_t to, asize_t size)
| TODO: return code borrowed from va.hpp, same with move_chunk()

## Public Types
typedef areavec_t::iterator | iterator
| Iterator for areasets.
typedef areavec_t::const_iterator | const_iterator
| Const iterator for areasets.

## Member Function Documentation

bool areaset_t::add | ( | const area_t & | area | ) |
| inline

Add an address range to the set.

If 'area' intersects an existing element e, then e is extended to include 'area', and any superfluous elements (subsets of e) are removed.

Parameters

  area | address range to add. can not be empty

Returns
  false if 'area' was not added (the set was unchanged)

bool areaset_t::add | ( | const areaset_t & | aset | ) |
| inline

Add each element of 'aset' to the set.

Returns
  false if no elements were added (the set was unchanged)

bool areaset_t::sub | ( | const area_t & | area | ) |
| inline

Subtract an address range from the set.

All subsets of 'area' will be removed, and all elements that intersect 'area' will be truncated/split so they do not include 'area'.

Parameters

  area | address range to subtract. can not be empty.

Returns
  false if 'area' was not subtracted (the set was unchanged)

bool areaset_t::sub | ( | const areaset_t & | aset | ) |
| inline

Subtract each area in 'aset' from the set.

Returns
  false if nothing was subtracted (the set was unchanged)

bool areaset_t::intersect | ( | const areaset_t & | aset | ) |
| inline

Set the areaset to its intersection with 'aset'.

Returns
  false if the set was unchanged

iterator areaset_t::begin | ( | void |  | ) |
| inline

Get an iterator that points to the first element in the set.

iterator areaset_t::end | ( | void |  | ) |
| inline

Get an iterator that points to the end of the set. (This is NOT the last element)

const area_t* areaset_t::find_area | ( | ea_t | ea | ) | const
| inline

Get the element from the set that contains 'ea'.

Returns
  NULL if there is no such element

const area_t* areaset_t::cached_area | ( | void |  | ) | const
| inline

When searching the areaset, we keep a cached element to help speed up searches.

Returns
  a pointer to the cached element

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

- area.hpp