Package ghidra.program.model.data
Interface Array
- All Superinterfaces:
DataType
- All Known Implementing Classes:
ArrayDataType
Array interface
-
Field Summary
Fields inherited from interface ghidra.program.model.data.DataType
CONFLICT_SUFFIX, DEFAULT, NO_LAST_CHANGE_TIME, NO_SOURCE_SYNC_TIME, TYPEDEF_ATTRIBUTE_PREFIX, TYPEDEF_ATTRIBUTE_SUFFIX, VOID
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
getArrayDefaultLabelPrefix
(MemBuffer buf, Settings settings, int len, DataTypeDisplayOptions options) Get the appropriate string to use as the label prefix for an array, taking into account the actual data at the memory location.default String
getArrayDefaultOffcutLabelPrefix
(MemBuffer buf, Settings settings, int len, DataTypeDisplayOptions options, int offcutLength) Get the appropriate string to use as the offcut label prefix for an array, taking into account the actual data at the memory location.default String
getArrayRepresentation
(MemBuffer buf, Settings settings, int length) Get the representation which corresponds to an array in memory.default Object
getArrayValue
(MemBuffer buf, Settings settings, int length) Get the value object which corresponds to an array in memory.default Class
<?> getArrayValueClass
(Settings settings) Get the value Class of a specific arrayDt with settings ( seegetArrayValueClass(Settings)
).Returns the dataType of the elements in the array.int
Returns the length of an element in the array.int
Returns the number of elements in the arrayMethods inherited from interface ghidra.program.model.data.DataType
addParent, clone, copy, dataTypeAlignmentChanged, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, encodeRepresentation, encodeValue, getAlignedLength, getAlignment, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getDocs, getLastChangeTime, getLastChangeTimeInSourceArchive, getLength, getMnemonic, getName, getParents, getPathName, getRepresentation, getSettingsDefinitions, getSourceArchive, getTypeDefSettingsDefinitions, getUniversalID, getValue, getValueClass, hasLanguageDependantLength, isDeleted, isEncodable, isEquivalent, isNotYetDefined, isZeroLength, removeParent, replaceWith, setCategoryPath, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setName, setNameAndCategory, setSourceArchive
-
Field Details
-
ARRAY_LABEL_PREFIX
- See Also:
-
-
Method Details
-
getNumElements
int getNumElements()Returns the number of elements in the array- Returns:
- the number of elements in the array
-
getElementLength
int getElementLength()Returns the length of an element in the array. In the case of a Dynamic base datatype, this element length will have been explicitly specified at the time of construction. For a zero-length base type an element length of 1 will be reported withDataType.getLength()
returning the number of elements.- Returns:
- the length of one element in the array.
-
getDataType
DataType getDataType()Returns the dataType of the elements in the array.- Returns:
- the dataType of the elements in the array
-
getArrayDefaultLabelPrefix
default String getArrayDefaultLabelPrefix(MemBuffer buf, Settings settings, int len, DataTypeDisplayOptions options) Get the appropriate string to use as the label prefix for an array, taking into account the actual data at the memory location.See also
DataType.getDefaultLabelPrefix()
- Parameters:
buf
- memory buffer containing the bytes.settings
- the Settings objectlen
- the length of the data.options
- options for how to format the default label prefix.- Returns:
- the label prefix or null if not applicable
-
getArrayDefaultOffcutLabelPrefix
default String getArrayDefaultOffcutLabelPrefix(MemBuffer buf, Settings settings, int len, DataTypeDisplayOptions options, int offcutLength) Get the appropriate string to use as the offcut label prefix for an array, taking into account the actual data at the memory location.See also
DataType.getDefaultLabelPrefix()
- Parameters:
buf
- memory buffer containing the bytes.settings
- the Settings objectlen
- the length of the data.options
- options for how to format the default label prefix.offcutLength
- offcut offset from start of buf- Returns:
- the offcut label prefix or null if not applicable
-
getArrayRepresentation
Get the representation which corresponds to an array in memory. This will either be a String for the ArrayStringable case, "??" for uninitialized data, or the empty string if it is not.- Parameters:
buf
- data buffersettings
- data settingslength
- length of array- Returns:
- a String if it is an array of chars; otherwise empty string, never null.
-
getArrayValue
Get the value object which corresponds to an array in memory. This will either be a String for the ArrayStringable case or null.- Parameters:
buf
- data buffersettings
- data settingslength
- length of array- Returns:
- a String if it is an array of chars; otherwise null.
-
getArrayValueClass
Get the value Class of a specific arrayDt with settings ( seegetArrayValueClass(Settings)
).- Parameters:
settings
- the relevant settings to use or null for default.- Returns:
- Class of the value to be returned by the array or null if it can vary or is unspecified (String or Array class will be returned).
-