TypePrinter

Detailed Description

Classes

class  BinaryNinja::TypePrinter
 
class  BinaryNinja::CoreTypePrinter
 

Class Documentation

◆ BinaryNinja::TypePrinter

class BinaryNinja::TypePrinter

Public Member Functions

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, const TypeContainer &types, const QualifiedName &name, int lineWidth=80, bool collapsed=false, BNTokenEscapingType escaping=NoTokenEscapingType)=0
 Generate a multi-line representation of a type. More...
 
virtual std::string PrintAllTypes (const std::vector< std::pair< QualifiedName, Ref< Type > > > &types, Ref< BinaryView > data, int lineWidth=80, BNTokenEscapingType escaping=NoTokenEscapingType)
 Print all types to a single big string, including headers, sections, etc. More...
 
std::string DefaultPrintAllTypes (const std::vector< std::pair< QualifiedName, Ref< Type > > > &types, Ref< BinaryView > data, int lineWidth=80, BNTokenEscapingType escaping=NoTokenEscapingType)
 Default implementation of PrintAllTypes Print all types to a single big string, including headers, sections, etc. More...
 
- Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNTypePrinter >
 StaticCoreRefCountObject ()
 
virtual ~StaticCoreRefCountObject ()
 
BNTypePrinterGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Static Public Member Functions

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 BNTypePrinterGetObject (StaticCoreRefCountObject *obj)
 

Protected Member Functions

 TypePrinter (const std::string &name)
 
 TypePrinter (BNTypePrinter *printer)
 

Static Protected Member Functions

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, BNTypeContainer *types, BNQualifiedName *name, int lineWidth, bool collapsed, BNTokenEscapingType escaping, BNTypeDefinitionLine **result, size_t *resultCount)
 
static bool PrintAllTypesCallback (void *ctxt, BNQualifiedName *names, BNType **types, size_t typeCount, BNBinaryView *data, int lineWidth, BNTokenEscapingType escaping, char **result)
 
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)
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNTypePrinter >
std::atomic< int > m_refs
 
BNTypePrinterm_object
 

Constructor & Destructor Documentation

◆ TypePrinter() [1/2]

TypePrinter::TypePrinter ( const std::string &  name)
explicitprotected

◆ TypePrinter() [2/2]

TypePrinter::TypePrinter ( BNTypePrinter printer)
protected

Member Function Documentation

◆ GetTypeTokensCallback()

bool TypePrinter::GetTypeTokensCallback ( void *  ctxt,
BNType type,
BNPlatform platform,
BNQualifiedName name,
uint8_t  baseConfidence,
BNTokenEscapingType  escaping,
BNInstructionTextToken **  result,
size_t *  resultCount 
)
staticprotected

◆ GetTypeTokensBeforeNameCallback()

bool TypePrinter::GetTypeTokensBeforeNameCallback ( void *  ctxt,
BNType type,
BNPlatform platform,
uint8_t  baseConfidence,
BNType parentType,
BNTokenEscapingType  escaping,
BNInstructionTextToken **  result,
size_t *  resultCount 
)
staticprotected

◆ GetTypeTokensAfterNameCallback()

bool TypePrinter::GetTypeTokensAfterNameCallback ( void *  ctxt,
BNType type,
BNPlatform platform,
uint8_t  baseConfidence,
BNType parentType,
BNTokenEscapingType  escaping,
BNInstructionTextToken **  result,
size_t *  resultCount 
)
staticprotected

◆ GetTypeStringCallback()

bool TypePrinter::GetTypeStringCallback ( void *  ctxt,
BNType type,
BNPlatform platform,
BNQualifiedName name,
BNTokenEscapingType  escaping,
char **  result 
)
staticprotected

◆ GetTypeStringBeforeNameCallback()

bool TypePrinter::GetTypeStringBeforeNameCallback ( void *  ctxt,
BNType type,
BNPlatform platform,
BNTokenEscapingType  escaping,
char **  result 
)
staticprotected

◆ GetTypeStringAfterNameCallback()

bool TypePrinter::GetTypeStringAfterNameCallback ( void *  ctxt,
BNType type,
BNPlatform platform,
BNTokenEscapingType  escaping,
char **  result 
)
staticprotected

◆ GetTypeLinesCallback()

bool TypePrinter::GetTypeLinesCallback ( void *  ctxt,
BNType type,
BNTypeContainer types,
BNQualifiedName name,
int  lineWidth,
bool  collapsed,
BNTokenEscapingType  escaping,
BNTypeDefinitionLine **  result,
size_t *  resultCount 
)
staticprotected

◆ PrintAllTypesCallback()

bool TypePrinter::PrintAllTypesCallback ( void *  ctxt,
BNQualifiedName names,
BNType **  types,
size_t  typeCount,
BNBinaryView data,
int  lineWidth,
BNTokenEscapingType  escaping,
char **  result 
)
staticprotected

◆ FreeTokensCallback()

void TypePrinter::FreeTokensCallback ( void *  ctxt,
BNInstructionTextToken tokens,
size_t  count 
)
staticprotected

◆ FreeStringCallback()

void TypePrinter::FreeStringCallback ( void *  ctxt,
char *  string 
)
staticprotected

◆ FreeLinesCallback()

void TypePrinter::FreeLinesCallback ( void *  ctxt,
BNTypeDefinitionLine lines,
size_t  count 
)
staticprotected

◆ Register()

void TypePrinter::Register ( TypePrinter printer)
static

◆ GetList()

std::vector< Ref< TypePrinter > > TypePrinter::GetList ( )
static

◆ GetByName()

Ref< TypePrinter > TypePrinter::GetByName ( const std::string &  name)
static

◆ GetDefault()

Ref< TypePrinter > TypePrinter::GetDefault ( )
static

◆ GetTypeTokens()

std::vector< InstructionTextToken > TypePrinter::GetTypeTokens ( Ref< Type type,
Ref< Platform platform,
const QualifiedName name,
uint8_t  baseConfidence = 255,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
virtual

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 in BinaryNinja::CoreTypePrinter.

◆ GetTypeTokensBeforeName()

virtual std::vector< InstructionTextToken > BinaryNinja::TypePrinter::GetTypeTokensBeforeName ( Ref< Type type,
Ref< Platform platform,
uint8_t  baseConfidence = 255,
Ref< Type parentType = nullptr,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
pure virtual

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

Implemented in BinaryNinja::CoreTypePrinter.

◆ GetTypeTokensAfterName()

virtual std::vector< InstructionTextToken > BinaryNinja::TypePrinter::GetTypeTokensAfterName ( Ref< Type type,
Ref< Platform platform,
uint8_t  baseConfidence = 255,
Ref< Type parentType = nullptr,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
pure virtual

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

Implemented in BinaryNinja::CoreTypePrinter.

◆ GetTypeString()

std::string TypePrinter::GetTypeString ( Ref< Type type,
Ref< Platform platform,
const QualifiedName name,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
virtual

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 in BinaryNinja::CoreTypePrinter.

◆ GetTypeStringBeforeName()

std::string TypePrinter::GetTypeStringBeforeName ( Ref< Type type,
Ref< Platform platform,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
virtual

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 in BinaryNinja::CoreTypePrinter.

◆ GetTypeStringAfterName()

std::string TypePrinter::GetTypeStringAfterName ( Ref< Type type,
Ref< Platform platform,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
virtual

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 in BinaryNinja::CoreTypePrinter.

◆ GetTypeLines()

virtual std::vector< TypeDefinitionLine > BinaryNinja::TypePrinter::GetTypeLines ( Ref< Type type,
const TypeContainer types,
const QualifiedName name,
int  lineWidth = 80,
bool  collapsed = false,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
pure virtual

Generate a multi-line representation of a type.

Parameters
typeType to print
typesType Container 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

Implemented in BinaryNinja::CoreTypePrinter.

◆ PrintAllTypes()

std::string TypePrinter::PrintAllTypes ( const std::vector< std::pair< QualifiedName, Ref< Type > > > &  types,
Ref< BinaryView data,
int  lineWidth = 80,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)
virtual

Print all types to a single big string, including headers, sections, etc.

Parameters
typesAll types to print
dataBinary View in which all the types are defined
lineWidthMaximum width of lines, in characters
escapingStyle of escaping literals which may not be parsable
Returns
All the types in a string

Reimplemented in BinaryNinja::CoreTypePrinter.

◆ DefaultPrintAllTypes()

std::string TypePrinter::DefaultPrintAllTypes ( const std::vector< std::pair< QualifiedName, Ref< Type > > > &  types,
Ref< BinaryView data,
int  lineWidth = 80,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)

Default implementation of PrintAllTypes Print all types to a single big string, including headers, sections, etc.

Parameters
typesAll types to print
dataBinary View in which all the types are defined
lineWidthMaximum width of lines, in characters
escapingStyle of escaping literals which may not be parsable
Returns
All the types in a string

◆ BinaryNinja::CoreTypePrinter

class BinaryNinja::CoreTypePrinter

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, const TypeContainer &types, const QualifiedName &name, int lineWidth, bool collapsed, BNTokenEscapingType escaping) override
 Generate a multi-line representation of a type. More...
 
virtual std::string PrintAllTypes (const std::vector< std::pair< QualifiedName, Ref< Type > > > &types, Ref< BinaryView > data, int lineWidth, BNTokenEscapingType escaping) override
 Print all types to a single big string, including headers, sections, etc. More...
 
- Public Member Functions inherited from BinaryNinja::TypePrinter
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, const TypeContainer &types, const QualifiedName &name, int lineWidth=80, bool collapsed=false, BNTokenEscapingType escaping=NoTokenEscapingType)=0
 Generate a multi-line representation of a type. More...
 
virtual std::string PrintAllTypes (const std::vector< std::pair< QualifiedName, Ref< Type > > > &types, Ref< BinaryView > data, int lineWidth=80, BNTokenEscapingType escaping=NoTokenEscapingType)
 Print all types to a single big string, including headers, sections, etc. More...
 
std::string DefaultPrintAllTypes (const std::vector< std::pair< QualifiedName, Ref< Type > > > &types, Ref< BinaryView > data, int lineWidth=80, BNTokenEscapingType escaping=NoTokenEscapingType)
 Default implementation of PrintAllTypes Print all types to a single big string, including headers, sections, etc. More...
 
- Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNTypePrinter >
 StaticCoreRefCountObject ()
 
virtual ~StaticCoreRefCountObject ()
 
BNTypePrinterGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

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 BNTypePrinterGetObject (StaticCoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNTypePrinter >
std::atomic< int > m_refs
 
BNTypePrinterm_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, BNTypeContainer *types, BNQualifiedName *name, int lineWidth, bool collapsed, BNTokenEscapingType escaping, BNTypeDefinitionLine **result, size_t *resultCount)
 
static bool PrintAllTypesCallback (void *ctxt, BNQualifiedName *names, BNType **types, size_t typeCount, BNBinaryView *data, int lineWidth, BNTokenEscapingType escaping, char **result)
 
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

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ GetTypeLines()

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

Generate a multi-line representation of a type.

Parameters
typeType to print
typesType Container 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.

◆ PrintAllTypes()

std::string CoreTypePrinter::PrintAllTypes ( const std::vector< std::pair< QualifiedName, Ref< Type > > > &  types,
Ref< BinaryView data,
int  lineWidth,
BNTokenEscapingType  escaping 
)
overridevirtual

Print all types to a single big string, including headers, sections, etc.

Parameters
typesAll types to print
dataBinary View in which all the types are defined
lineWidthMaximum width of lines, in characters
escapingStyle of escaping literals which may not be parsable
Returns
All the types in a string

Reimplemented from BinaryNinja::TypePrinter.