|
Ghidra 11.4.2
Ghidra internal decompiler documentation.
|
A base class for data-type filters that tests for either a range or an enumerated list of sizes. More...
#include <modelrules.hh>
Public Member Functions | |
| SizeRestrictedFilter (void) | |
| Constructor for use with decode() | |
| SizeRestrictedFilter (int4 min, int4 max) | |
| Constructor. | |
| SizeRestrictedFilter (const SizeRestrictedFilter &op2) | |
| Copy 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. | |
Public Member Functions inherited from ghidra::DatatypeFilter | |
| virtual | ~DatatypeFilter (void) |
| Destructor. | |
Protected Member Functions | |
| void | initFromSizeList (const string &str) |
| Initialize filter from enumerated list of sizes. | |
Protected Attributes | |
| int4 | minSize |
| Minimum size of the data-type in bytes. | |
| int4 | maxSize |
| Maximum size of the data-type in bytes. | |
| set< int4 > | sizes |
| An enumerated list of sizes (if not empty) | |
Additional Inherited Members | |
Static Public Member Functions inherited from ghidra::DatatypeFilter | |
| static DatatypeFilter * | decodeFilter (Decoder &decoder) |
| Instantiate a filter from the given stream. | |
A base class for data-type filters that tests for either a range or an enumerated list of sizes.
Any filter that inherits from this, can use ATTRIB_MINSIZE, ATTRIB_MAXSIZE, or ATTRIB_SIZES 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 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(), initFromSizeList(), maxSize, minSize, ghidra::Decoder::readString(), ghidra::Decoder::readUnsignedInteger(), and sizes.
|
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. If enumerated sizes are present, also check that the particular size is in the enumerated set.
| dt | is the data-type to test |
References ghidra::Datatype::getSize(), maxSize, minSize, and sizes.
Referenced by filter(), and ghidra::MetaTypeFilter::filter().
|
protected |