Package ghidra.program.model.data
Interface DataTypeWithCharset
- All Superinterfaces:
DataType
- All Known Implementing Classes:
AbstractStringDataType
,CharDataType
,PascalString255DataType
,PascalStringDataType
,PascalUnicodeDataType
,SignedCharDataType
,StringDataType
,StringUTF8DataType
,TerminatedStringDataType
,TerminatedUnicode32DataType
,TerminatedUnicodeDataType
,Unicode32DataType
,UnicodeDataType
,UnsignedCharDataType
,WideChar16DataType
,WideChar32DataType
,WideCharDataType
-
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 byte[]
encodeCharacterRepresentation
(String repr, MemBuffer buf, Settings settings) Utility for character data types to encode a representation.default byte[]
encodeCharacterValue
(Object value, MemBuffer buf, Settings settings) Utility for character data types to encode a value.default String
getCharsetName
(Settings settings) Get the character set for a specific data type and settingsMethods 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
-
Method Details
-
encodeCharacterValue
default byte[] encodeCharacterValue(Object value, MemBuffer buf, Settings settings) throws DataTypeEncodeException Utility for character data types to encode a value.- Parameters:
value
- the character value to encode.buf
- a buffer representing the eventual destination of the bytes.settings
- the settings to use.- Returns:
- the encoded value
- Throws:
DataTypeEncodeException
- if the value cannot be encoded
-
encodeCharacterRepresentation
default byte[] encodeCharacterRepresentation(String repr, MemBuffer buf, Settings settings) throws DataTypeEncodeException Utility for character data types to encode a representation.- Parameters:
repr
- the single-character string to encode.buf
- a buffer representing the eventual destination of the bytes.settings
- the settings to use.- Returns:
- the encoded value
- Throws:
DataTypeEncodeException
- if the value cannot be encoded
-
getCharsetName
Get the character set for a specific data type and settings- Parameters:
settings
- data instance settings- Returns:
- Charset for this datatype and settings
-