functions that manipulate strings
◆ add_spaces()
idaman THREAD_SAFE char *ida_export add_spaces |
( |
char * |
str, |
|
|
size_t |
bufsize, |
|
|
ssize_t |
len |
|
) |
| |
Add space characters to the colored string so that its length will be at least 'len' characters.
Don't trim the string if it is longer than 'len'.
- Parameters
-
str | pointer to colored string to modify (may not be nullptr) |
bufsize | size of the buffer with the string |
len | the desired length of the string |
- Returns
- pointer to the end of input string
◆ trim()
Remove trailing space characters from a string.
- Parameters
-
str | pointer to string to modify (may be nullptr) |
- Returns
- pointer to input string
◆ skip_spaces() [1/2]
idaman THREAD_SAFE const char *ida_export skip_spaces |
( |
const char * |
ptr | ) |
|
Skip whitespaces in the string.
- Returns
- pointer to first non-whitespace char in given string
◆ skip_spaces() [2/2]
char * skip_spaces |
( |
char * |
ptr | ) |
|
|
inline |
- Parameters
-
- Returns
- pointer to first non-whitespace char in given string
◆ qcleanline()
Performs some cleanup operations to a line.
- Parameters
-
buf | string to modify |
cmt_char | character that denotes the start of a comment:
- the entire text is removed if the line begins with this character (ignoring leading spaces)
- all text after (and including) this character is removed if flag CLNL_FINDCMT is set
|
flags | a combination of line cleanup flags. defaults to CLNL_TRIM |
- Returns
- length of line
◆ strarray()
idaman THREAD_SAFE const char *ida_export strarray |
( |
const strarray_t * |
array, |
|
|
size_t |
array_size, |
|
|
int |
code |
|
) |
| |
Find a line with the specified code in the strarray_t array.
If the last element of the array has code==0 then it is considered as the default entry.
If no default entry exists and the code is not found, strarray() returns "".