Package ghidra.program.model.data
Interface Array
-
- All Superinterfaces:
DataType
- All Known Implementing Classes:
ArrayDataType
public interface Array extends DataType
Array interface
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ARRAY_LABEL_PREFIX
-
Fields inherited from interface ghidra.program.model.data.DataType
CONFLICT_SUFFIX, DEFAULT, NO_LAST_CHANGE_TIME, NO_SOURCE_SYNC_TIME, VOID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.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 java.lang.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 java.lang.String
getArrayRepresentation(MemBuffer buf, Settings settings, int length)
Get the representation which corresponds to an array in memory.default java.lang.Object
getArrayValue(MemBuffer buf, Settings settings, int length)
Get the value object which corresponds to an array in memory.default java.lang.Class<?>
getArrayValueClass(Settings settings)
Get the value Class of a specific arrayDt with settings ( seegetArrayValueClass(Settings)
).DataType
getDataType()
Returns the dataType of the elements in the array.int
getElementLength()
Returns the length of an element in the array.int
getNumElements()
Returns the number of elements in the array-
Methods inherited from interface ghidra.program.model.data.DataType
addParent, clone, copy, dataTypeAlignmentChanged, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, encodeRepresentation, encodeValue, getAlignment, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getDocs, getLastChangeTime, getLastChangeTimeInSourceArchive, getLength, getMnemonic, getName, getParents, getPathName, getRepresentation, getSettingsDefinitions, getSourceArchive, getUniversalID, getValue, getValueClass, hasLanguageDependantLength, isDeleted, isEncodable, isEquivalent, isNotYetDefined, isZeroLength, removeParent, replaceWith, setCategoryPath, setDefaultSettings, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setName, setNameAndCategory, setSourceArchive
-
-
-
-
Field Detail
-
ARRAY_LABEL_PREFIX
static final java.lang.String ARRAY_LABEL_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 java.lang.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 java.lang.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
default java.lang.String getArrayRepresentation(MemBuffer buf, Settings settings, int length)
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
default java.lang.Object getArrayValue(MemBuffer buf, Settings settings, int length)
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
default java.lang.Class<?> getArrayValueClass(Settings settings)
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).
-
-