Class GoVarlenString
java.lang.Object
ghidra.app.util.bin.format.golang.rtti.GoVarlenString
- All Implemented Interfaces:
StructureReader<GoVarlenString>
A pascal-ish string, using a LEB128 (or a uint16 in pre-1.16) value as the length of the
following bytes.
Used mainly in lower-level RTTI structures, this class is a ghidra'ism used to parse the golang rtti data and does not have a counterpart in the golang src.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes()
Returns the raw bytes of the stringReturns the string value.int
Returns the string's lengthReturns the data type that is needed to hold the string length field.int
Returns the size of the string length field.Returns the data type that holds the raw string value.void
Called after an instance has been created and its context has been initialized.toString()
-
Constructor Details
-
GoVarlenString
public GoVarlenString()
-
-
Method Details
-
readStructure
Description copied from interface:StructureReader
Called after an instance has been created and its context has been initialized.- Specified by:
readStructure
in interfaceStructureReader<GoVarlenString>
- Throws:
IOException
-
getStrlen
public int getStrlen()Returns the string's length- Returns:
- string's length
-
getStrlenLen
public int getStrlenLen()Returns the size of the string length field.- Returns:
- size of the string length field
-
getBytes
public byte[] getBytes()Returns the raw bytes of the string- Returns:
- raw bytes of the string
-
getString
Returns the string value.- Returns:
- string value
-
getStrlenDataType
Returns the data type that is needed to hold the string length field.- Returns:
- data type needed to hold the string length field
-
getValueDataType
Returns the data type that holds the raw string value.- Returns:
- data type that holds the raw string value.
-
toString
-