Blender V4.3
BLI_string_cursor_utf8.h File Reference

Go to the source code of this file.

Typedefs

typedef enum eStrCursorJumpType eStrCursorJumpType
 
typedef enum eStrCursorJumpDirection eStrCursorJumpDirection
 

Enumerations

enum  eStrCursorJumpType { STRCUR_JUMP_NONE , STRCUR_JUMP_DELIM , STRCUR_JUMP_ALL }
 
enum  eStrCursorJumpDirection { STRCUR_DIR_PREV , STRCUR_DIR_NEXT }
 

Functions

bool BLI_str_cursor_step_next_utf8 (const char *str, int str_maxlen, int *pos)
 
bool BLI_str_cursor_step_prev_utf8 (const char *str, int str_maxlen, int *pos)
 
bool BLI_str_cursor_step_next_utf32 (const char32_t *str, int str_maxlen, int *pos)
 
bool BLI_str_cursor_step_prev_utf32 (const char32_t *str, int str_maxlen, int *pos)
 
void BLI_str_cursor_step_utf8 (const char *str, int str_maxlen, int *pos, eStrCursorJumpDirection direction, eStrCursorJumpType jump, bool use_init_step)
 
void BLI_str_cursor_step_utf32 (const char32_t *str, int str_maxlen, int *pos, eStrCursorJumpDirection direction, eStrCursorJumpType jump, bool use_init_step)
 
void BLI_str_cursor_step_bounds_utf8 (const char *str, int str_maxlen, int pos, int *r_start, int *r_end)
 
void BLI_str_cursor_step_bounds_utf32 (const char32_t *str, int str_maxlen, int pos, int *r_start, int *r_end)
 

Typedef Documentation

◆ eStrCursorJumpDirection

◆ eStrCursorJumpType

Enumeration Type Documentation

◆ eStrCursorJumpDirection

Enumerator
STRCUR_DIR_PREV 
STRCUR_DIR_NEXT 

Definition at line 21 of file BLI_string_cursor_utf8.h.

◆ eStrCursorJumpType

Enumerator
STRCUR_JUMP_NONE 
STRCUR_JUMP_DELIM 
STRCUR_JUMP_ALL 

Definition at line 15 of file BLI_string_cursor_utf8.h.

Function Documentation

◆ BLI_str_cursor_step_bounds_utf32()

void BLI_str_cursor_step_bounds_utf32 ( const char32_t * str,
int str_maxlen,
int pos,
int * r_start,
int * r_end )

◆ BLI_str_cursor_step_bounds_utf8()

void BLI_str_cursor_step_bounds_utf8 ( const char * str,
int str_maxlen,
int pos,
int * r_start,
int * r_end )

Given a position within a string, return the start and end of the closest sequence of delimited characters. Typically a word, but can be a sequence of characters (including spaces).

Note
When used for word-selection the caller should set the cursor to r_end (by convention).
Parameters
strThe string with a cursor position
str_maxlenThe maximum characters to consider
posThe starting cursor position.
r_startreturned start of word/sequence boundary (0-based)
r_endreturned end of word/sequence boundary (0-based)

Definition at line 372 of file string_cursor_utf8.c.

References BLI_assert, BLI_str_cursor_step_utf8(), cursor_delim_type_utf8(), next, pos, str, STRCUR_DELIM_NONE, STRCUR_DIR_NEXT, STRCUR_DIR_PREV, and STRCUR_JUMP_DELIM.

Referenced by console_selectword_invoke(), text_select_word_exec(), and ui_do_but_textedit().

◆ BLI_str_cursor_step_next_utf32()

bool BLI_str_cursor_step_next_utf32 ( const char32_t * str,
int str_maxlen,
int * pos )

◆ BLI_str_cursor_step_next_utf8()

bool BLI_str_cursor_step_next_utf8 ( const char * str,
int str_maxlen,
int * pos )

◆ BLI_str_cursor_step_prev_utf32()

bool BLI_str_cursor_step_prev_utf32 ( const char32_t * str,
int str_maxlen,
int * pos )

◆ BLI_str_cursor_step_prev_utf8()

◆ BLI_str_cursor_step_utf32()

◆ BLI_str_cursor_step_utf8()