Package ghidra.program.model.data
Class StringRenderBuilder
- java.lang.Object
- 
- ghidra.program.model.data.StringRenderBuilder
 
- 
 public class StringRenderBuilder extends java.lang.ObjectHelper class used to build up a formatted (for human consumption) string representation returned by Unicode and String data types.Call toString()to retrieve the formatted string.Example (quotes are part of result): "Test\tstring",01,02,"Second\npart",00
- 
- 
Field SummaryFields Modifier and Type Field Description static charDOUBLE_QUOTEstatic charSINGLE_QUOTE
 - 
Constructor SummaryConstructors Constructor Description StringRenderBuilder(int charSize)StringRenderBuilder(int charSize, char quoteChar)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddByteSeq(byte[] bytes)Add byte values, shown as numeric hex values.voidaddCodePointChar(int codePoint)Add a single character.voidaddCodePointValue(int codePoint)Add a single character that needs to be shown as a numeric hex value.voidaddEscapedChar(char ch)Append the specified char after an escaping backslash "\", ie "x" -> "\x";voidaddEscapedCodePoint(int codePoint)Add an unicode codepoint as its escaped hex value, with a escape character prefix of 'x', 'u' or 'U' depending on the magnitude of the codePoint value.voidaddString(java.lang.String str)Append the characters in the specified string.java.lang.StringtoString()Example (quotes are part of result):"Test\tstring",01,02,"Second\npart",00
 
- 
- 
- 
Field Detail- 
DOUBLE_QUOTEpublic static final char DOUBLE_QUOTE - See Also:
- Constant Field Values
 
 - 
SINGLE_QUOTEpublic static final char SINGLE_QUOTE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
addStringpublic void addString(java.lang.String str) Append the characters in the specified string. The added characters will be shown in a quoted text region.- Parameters:
- str- String to add
 
 - 
addEscapedCharpublic void addEscapedChar(char ch) Append the specified char after an escaping backslash "\", ie "x" -> "\x";- Parameters:
- ch-
 
 - 
addCodePointCharpublic void addCodePointChar(int codePoint) Add a single character. It will be shown in a quoted text region.- Parameters:
- codePoint- Character to add
 
 - 
addCodePointValuepublic void addCodePointValue(int codePoint) Add a single character that needs to be shown as a numeric hex value.- Parameters:
- codePoint- Character to add
 
 - 
addByteSeqpublic void addByteSeq(byte[] bytes) Add byte values, shown as numeric hex values.{ 0, 1, 2 } -> 00,01,02 - Parameters:
- bytes-
 
 - 
addEscapedCodePointpublic void addEscapedCodePoint(int codePoint) Add an unicode codepoint as its escaped hex value, with a escape character prefix of 'x', 'u' or 'U' depending on the magnitude of the codePoint value.codePoint 15 -> '\' 'x' "0F" 
 codePoint 65535 -> '\' 'u' "FFFF"
 codePoint 65536 -> '\' 'U' "10000"- Parameters:
- codePoint- int value
 
 - 
toStringpublic java.lang.String toString() Example (quotes are part of result):"Test\tstring",01,02,"Second\npart",00- Overrides:
- toStringin class- java.lang.Object
- Returns:
- Formatted string
 
 
- 
 
-