BinaryNinja::CoreTypePrinter Class Reference

Public Member Functions

 CoreTypePrinter (BNTypePrinter *printer)
 
virtual ~CoreTypePrinter ()
 
virtual std::vector< InstructionTextTokenGetTypeTokens (Ref< Type > type, Ref< Platform > platform, const QualifiedName &name, uint8_t baseConfidence, BNTokenEscapingType escaping) override
 Generate a single-line text representation of a type. More...
 
virtual std::vector< InstructionTextTokenGetTypeTokensBeforeName (Ref< Type > type, Ref< Platform > platform, uint8_t baseConfidence, Ref< Type > parentType, BNTokenEscapingType escaping) override
 In a single-line text representation of a type, generate the tokens that should be printed before the type's name. More...
 
virtual std::vector< InstructionTextTokenGetTypeTokensAfterName (Ref< Type > type, Ref< Platform > platform, uint8_t baseConfidence, Ref< Type > parentType, BNTokenEscapingType escaping) override
 In a single-line text representation of a type, generate the tokens that should be printed after the type's name. More...
 
virtual std::string GetTypeString (Ref< Type > type, Ref< Platform > platform, const QualifiedName &name, BNTokenEscapingType escaping) override
 Generate a single-line text representation of a type. More...
 
virtual std::string GetTypeStringBeforeName (Ref< Type > type, Ref< Platform > platform, BNTokenEscapingType escaping) override
 In a single-line text representation of a type, generate the string that should be printed before the type's name. More...
 
virtual std::string GetTypeStringAfterName (Ref< Type > type, Ref< Platform > platform, BNTokenEscapingType escaping) override
 In a single-line text representation of a type, generate the string that should be printed after the type's name. More...
 
virtual std::vector< TypeDefinitionLineGetTypeLines (Ref< Type > type, Ref< BinaryView > data, const QualifiedName &name, int lineWidth, bool collapsed, BNTokenEscapingType escaping) override
 Generate a multi-line representation of a type. More...
 
virtual std::vector< InstructionTextTokenGetTypeTokens (Ref< Type > type, Ref< Platform > platform, const QualifiedName &name, uint8_t baseConfidence=255, BNTokenEscapingType escaping=NoTokenEscapingType)
 Generate a single-line text representation of a type. More...
 
virtual std::vector< InstructionTextTokenGetTypeTokensBeforeName (Ref< Type > type, Ref< Platform > platform, uint8_t baseConfidence=255, Ref< Type > parentType=nullptr, BNTokenEscapingType escaping=NoTokenEscapingType)=0
 In a single-line text representation of a type, generate the tokens that should be printed before the type's name. More...
 
virtual std::vector< InstructionTextTokenGetTypeTokensAfterName (Ref< Type > type, Ref< Platform > platform, uint8_t baseConfidence=255, Ref< Type > parentType=nullptr, BNTokenEscapingType escaping=NoTokenEscapingType)=0
 In a single-line text representation of a type, generate the tokens that should be printed after the type's name. More...
 
virtual std::string GetTypeString (Ref< Type > type, Ref< Platform > platform, const QualifiedName &name, BNTokenEscapingType escaping=NoTokenEscapingType)
 Generate a single-line text representation of a type. More...
 
virtual std::string GetTypeStringBeforeName (Ref< Type > type, Ref< Platform > platform, BNTokenEscapingType escaping=NoTokenEscapingType)
 In a single-line text representation of a type, generate the string that should be printed before the type's name. More...
 
virtual std::string GetTypeStringAfterName (Ref< Type > type, Ref< Platform > platform, BNTokenEscapingType escaping=NoTokenEscapingType)
 In a single-line text representation of a type, generate the string that should be printed after the type's name. More...
 
virtual std::vector< TypeDefinitionLineGetTypeLines (Ref< Type > type, Ref< BinaryView > data, const QualifiedName &name, int lineWidth=80, bool collapsed=false, BNTokenEscapingType escaping=NoTokenEscapingType)=0
 Generate a multi-line representation of a type. More...
 
- Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNTypePrinter >
 StaticCoreRefCountObject ()
 
virtual ~StaticCoreRefCountObject ()
 
BNTypePrinter * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::TypePrinter
static void Register (TypePrinter *printer)
 
static std::vector< Ref< TypePrinter > > GetList ()
 
static Ref< TypePrinterGetByName (const std::string &name)
 
static Ref< TypePrinterGetDefault ()
 
- Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNTypePrinter >
static BNTypePrinter * GetObject (StaticCoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNTypePrinter >
std::atomic< int > m_refs
 
BNTypePrinter * m_object
 
- Protected Member Functions inherited from BinaryNinja::TypePrinter
 TypePrinter (const std::string &name)
 
 TypePrinter (BNTypePrinter *printer)
 
- Static Protected Member Functions inherited from BinaryNinja::TypePrinter
static bool GetTypeTokensCallback (void *ctxt, BNType *type, BNPlatform *platform, BNQualifiedName *name, uint8_t baseConfidence, BNTokenEscapingType escaping, BNInstructionTextToken **result, size_t *resultCount)
 
static bool GetTypeTokensBeforeNameCallback (void *ctxt, BNType *type, BNPlatform *platform, uint8_t baseConfidence, BNType *parentType, BNTokenEscapingType escaping, BNInstructionTextToken **result, size_t *resultCount)
 
static bool GetTypeTokensAfterNameCallback (void *ctxt, BNType *type, BNPlatform *platform, uint8_t baseConfidence, BNType *parentType, BNTokenEscapingType escaping, BNInstructionTextToken **result, size_t *resultCount)
 
static bool GetTypeStringCallback (void *ctxt, BNType *type, BNPlatform *platform, BNQualifiedName *name, BNTokenEscapingType escaping, char **result)
 
static bool GetTypeStringBeforeNameCallback (void *ctxt, BNType *type, BNPlatform *platform, BNTokenEscapingType escaping, char **result)
 
static bool GetTypeStringAfterNameCallback (void *ctxt, BNType *type, BNPlatform *platform, BNTokenEscapingType escaping, char **result)
 
static bool GetTypeLinesCallback (void *ctxt, BNType *type, BNBinaryView *data, BNQualifiedName *name, int lineWidth, bool collapsed, BNTokenEscapingType escaping, BNTypeDefinitionLine **result, size_t *resultCount)
 
static void FreeTokensCallback (void *ctxt, BNInstructionTextToken *tokens, size_t count)
 
static void FreeStringCallback (void *ctxt, char *string)
 
static void FreeLinesCallback (void *ctxt, BNTypeDefinitionLine *lines, size_t count)
 

Constructor & Destructor Documentation

◆ CoreTypePrinter()

CoreTypePrinter::CoreTypePrinter ( BNTypePrinter *  printer)

◆ ~CoreTypePrinter()

virtual BinaryNinja::CoreTypePrinter::~CoreTypePrinter ( )
inlinevirtual

Member Function Documentation

◆ GetTypeLines()

std::vector< TypeDefinitionLine > CoreTypePrinter::GetTypeLines ( Ref< Type type,
Ref< BinaryView data,
const QualifiedName name,
int  lineWidth,
bool  collapsed,
BNTokenEscapingType  escaping 
)
overridevirtual

Generate a multi-line representation of a type.

Parameters
typeType to print
dataBinary View in which the type is defined
nameName of the type
lineWidthMaximum width of lines, in characters
collapsedWhether to collapse structure/enum blocks
escapingStyle of escaping literals which may not be parsable
Returns
List of type definition lines

Implements BinaryNinja::TypePrinter.

◆ GetTypeString()

std::string CoreTypePrinter::GetTypeString ( Ref< Type type,
Ref< Platform platform,
const QualifiedName name,
BNTokenEscapingType  escaping 
)
overridevirtual

Generate a single-line text representation of a type.

Parameters
typeType to print
platformPlatform responsible for this type
nameName of the type
escapingStyle of escaping literals which may not be parsable
Returns
String representing the type

Reimplemented from BinaryNinja::TypePrinter.

◆ GetTypeStringAfterName()

std::string CoreTypePrinter::GetTypeStringAfterName ( Ref< Type type,
Ref< Platform platform,
BNTokenEscapingType  escaping 
)
overridevirtual

In a single-line text representation of a type, generate the string that should be printed after the type's name.

Parameters
typeType to print
platformPlatform responsible for this type
escapingStyle of escaping literals which may not be parsable
Returns
String representing the type

Reimplemented from BinaryNinja::TypePrinter.

◆ GetTypeStringBeforeName()

std::string CoreTypePrinter::GetTypeStringBeforeName ( Ref< Type type,
Ref< Platform platform,
BNTokenEscapingType  escaping 
)
overridevirtual

In a single-line text representation of a type, generate the string that should be printed before the type's name.

Parameters
typeType to print
platformPlatform responsible for this type
escapingStyle of escaping literals which may not be parsable
Returns
String representing the type

Reimplemented from BinaryNinja::TypePrinter.

◆ GetTypeTokens()

std::vector< InstructionTextToken > CoreTypePrinter::GetTypeTokens ( Ref< Type type,
Ref< Platform platform,
const QualifiedName name,
uint8_t  baseConfidence,
BNTokenEscapingType  escaping 
)
overridevirtual

Generate a single-line text representation of a type.

Parameters
typeType to print
platformPlatform responsible for this type
nameName of the type
baseConfidenceConfidence to use for tokens created for this type
escapingStyle of escaping literals which may not be parsable
Returns
List of text tokens representing the type

Reimplemented from BinaryNinja::TypePrinter.

◆ GetTypeTokensAfterName()

std::vector< InstructionTextToken > CoreTypePrinter::GetTypeTokensAfterName ( Ref< Type type,
Ref< Platform platform,
uint8_t  baseConfidence,
Ref< Type parentType,
BNTokenEscapingType  escaping 
)
overridevirtual

In a single-line text representation of a type, generate the tokens that should be printed after the type's name.

Parameters
typeType to print
platformPlatform responsible for this type
baseConfidenceConfidence to use for tokens created for this type
parentTypeType of the parent of this type, or nullptr
escapingStyle of escaping literals which may not be parsable
Returns
List of text tokens representing the type

Implements BinaryNinja::TypePrinter.

◆ GetTypeTokensBeforeName()

std::vector< InstructionTextToken > CoreTypePrinter::GetTypeTokensBeforeName ( Ref< Type type,
Ref< Platform platform,
uint8_t  baseConfidence,
Ref< Type parentType,
BNTokenEscapingType  escaping 
)
overridevirtual

In a single-line text representation of a type, generate the tokens that should be printed before the type's name.

Parameters
typeType to print
platformPlatform responsible for this type
baseConfidenceConfidence to use for tokens created for this type
parentTypeType of the parent of this type, or nullptr
escapingStyle of escaping literals which may not be parsable
Returns
List of text tokens representing the type

Implements BinaryNinja::TypePrinter.


The documentation for this class was generated from the following files: