Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
Convenience functions

Higher level convenience functions are defined in ua.hpp. More...

Functions

idaman THREAD_SAFE void ida_export tag_addr (qstring *buf, ea_t ea, bool ins=false)
 Insert an address mark into a string. More...
 
idaman THREAD_SAFE const char *ida_export tag_advance (const char *line, int cnt)
 Move pointer to a 'line' to 'cnt' positions right. More...
 
idaman THREAD_SAFE const char *ida_export tag_skipcodes (const char *line)
 Move the pointer past all color codes. More...
 
idaman THREAD_SAFE const char *ida_export tag_skipcode (const char *line)
 Skip one color code. More...
 
idaman THREAD_SAFE ssize_t ida_export tag_strlen (const char *line)
 Calculate length of a colored string This function computes the length in unicode codepoints of a line. More...
 
idaman THREAD_SAFE ssize_t ida_export tag_remove (qstring *buf, const char *str, int init_level=0)
 Remove color escape sequences from a string. More...
 
THREAD_SAFE ssize_t idaapi tag_remove (qstring *buf, const qstring &str, int init_level=0)
 
THREAD_SAFE ssize_t idaapi tag_remove (qstring *buf, int init_level=0)
 

Detailed Description

Higher level convenience functions are defined in ua.hpp.

Please use the following functions only if functions from ua.hpp are not useful in your case.

Function Documentation

◆ tag_addr()

idaman THREAD_SAFE void ida_export tag_addr ( qstring buf,
ea_t  ea,
bool  ins = false 
)

Insert an address mark into a string.

Parameters
bufpointer to the output buffer; the tag will be appended or inserted into it
eaaddress to include
insif true, the tag will be inserted at the beginning of the buffer

◆ tag_advance()

idaman THREAD_SAFE const char *ida_export tag_advance ( const char *  line,
int  cnt 
)

Move pointer to a 'line' to 'cnt' positions right.

Take into account escape sequences.

Parameters
linepointer to string
cntnumber of positions to move right
Returns
moved pointer

◆ tag_skipcodes()

idaman THREAD_SAFE const char *ida_export tag_skipcodes ( const char *  line)

Move the pointer past all color codes.

Parameters
linecan't be nullptr
Returns
moved pointer, can't be nullptr

◆ tag_skipcode()

idaman THREAD_SAFE const char *ida_export tag_skipcode ( const char *  line)

Skip one color code.

This function should be used if you are interested in color codes and want to analyze all of them. Otherwise tag_skipcodes() function is better since it will skip all colors at once. This function will skip the current color code if there is one. If the current symbol is not a color code, it will return the input.

Returns
moved pointer

◆ tag_strlen()

idaman THREAD_SAFE ssize_t ida_export tag_strlen ( const char *  line)

Calculate length of a colored string This function computes the length in unicode codepoints of a line.

Returns
the number of codepoints in the line, or -1 on error

◆ tag_remove()

idaman THREAD_SAFE ssize_t ida_export tag_remove ( qstring buf,
const char *  str,
int  init_level = 0 
)

Remove color escape sequences from a string.

Parameters
bufoutput buffer with the string, cannot be nullptr.
strinput string, cannot be nullptr.
init_levelused to verify that COLOR_ON and COLOR_OFF tags are balanced
Returns
length of resulting string, -1 if error