Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
A common base class for data-type filters that tests for a size range. More...
#include <modelrules.hh>
Public Member Functions | |
SizeRestrictedFilter (void) | |
Constructor for use with decode() | |
SizeRestrictedFilter (int4 min, int4 max) | |
Constructor. | |
bool | filterOnSize (Datatype *dt) const |
Enforce any size bounds on a given data-type. | |
virtual DatatypeFilter * | clone (void) const |
Make a copy of this filter. | |
virtual bool | filter (Datatype *dt) const |
Test whether the given data-type belongs to this filter's data-type class. | |
virtual void | decode (Decoder &decoder) |
Configure details of the data-type class being filtered from the given stream. | |
![]() | |
virtual | ~DatatypeFilter (void) |
Destructor. | |
Protected Attributes | |
int4 | minSize |
Minimum size of the data-type in bytes. | |
int4 | maxSize |
Maximum size of the data-type in bytes. | |
Additional Inherited Members | |
![]() | |
static DatatypeFilter * | decodeFilter (Decoder &decoder) |
Instantiate a filter from the given stream. | |
A common base class for data-type filters that tests for a size range.
Any filter that inherits from this, can use ATTRIB_MINSIZE and ATTRIB_MAXSIZE to place bounds on the possible sizes of data-types. The bounds are enforced by calling filterOnSize() within the inheriting classes filter() method.
|
inlinevirtual |
Make a copy of this filter.
Implements ghidra::DatatypeFilter.
Reimplemented in ghidra::MetaTypeFilter, and ghidra::HomogeneousAggregate.
References maxSize, minSize, and SizeRestrictedFilter().
|
virtual |
Configure details of the data-type class being filtered from the given stream.
decoder | is the given stream decoder |
Implements ghidra::DatatypeFilter.
References ghidra::Decoder::getNextAttributeId(), maxSize, minSize, and ghidra::Decoder::readUnsignedInteger().
|
inlinevirtual |
Test whether the given data-type belongs to this filter's data-type class.
dt | is the given data-type to test |
Implements ghidra::DatatypeFilter.
Reimplemented in ghidra::MetaTypeFilter, and ghidra::HomogeneousAggregate.
References filterOnSize().
bool ghidra::SizeRestrictedFilter::filterOnSize | ( | Datatype * | dt | ) | const |
Enforce any size bounds on a given data-type.
If maxSize is not zero, the data-type is checked to see if its size in bytes falls between minSize and maxSize inclusive.
dt | is the data-type to test |
References ghidra::Datatype::getSize(), maxSize, and minSize.
Referenced by filter(), and ghidra::MetaTypeFilter::filter().