Blender V4.3
BLI_string_utils.hh File Reference
#include <stdarg.h>
#include <string>
#include "BLI_compiler_attrs.h"
#include "BLI_function_ref.hh"
#include "BLI_string_ref.hh"
#include "BLI_utildefines.h"

Go to the source code of this file.

Macros

#define BLI_string_join_by_sep_char_with_tableN(sep, table, ...)
 
#define _BLI_STRING_ARGS_1   _BLI_STRING_ARGS_0 const char *a
 
#define _BLI_STRING_ARGS_2   _BLI_STRING_ARGS_1, const char *b
 
#define _BLI_STRING_ARGS_3   _BLI_STRING_ARGS_2, const char *c
 
#define _BLI_STRING_ARGS_4   _BLI_STRING_ARGS_3, const char *d
 
#define _BLI_STRING_ARGS_5   _BLI_STRING_ARGS_4, const char *e
 
#define _BLI_STRING_ARGS_6   _BLI_STRING_ARGS_5, const char *f
 
#define _BLI_STRING_ARGS_7   _BLI_STRING_ARGS_6, const char *g
 
#define _BLI_STRING_ARGS_8   _BLI_STRING_ARGS_7, const char *h
 
#define _BLI_STRING_ARGS_9   _BLI_STRING_ARGS_8, const char *i
 
#define _BLI_STRING_ARGS_10   _BLI_STRING_ARGS_9, const char *j
 

Typedefs

using UniquenameCheckCallback = bool (*)(void *arg, const char *name)
 

Functions

void void char * BLI_string_join_array_by_sep_char_with_tableN (char sep, char *table[], const char *strings[], uint strings_num) ATTR_NONNULL(2
 
size_t BLI_string_flip_side_name (char *name_dst, const char *name_src, bool strip_number, size_t name_dst_maxncpy) ATTR_NONNULL(1
 
size_t void BLI_uniquename_cb (UniquenameCheckCallback unique_check, void *arg, const char *defname, char delim, char *name, size_t name_maxncpy) ATTR_NONNULL(1
 
size_t void std::string BLI_uniquename_cb (blender::FunctionRef< bool(blender::StringRef)> unique_check, char delim, blender::StringRef name)
 
void BLI_uniquename (const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
 
void size_t BLI_string_len_array (const char *strings[], uint strings_num) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
 
String Split
size_t BLI_string_split_name_number (const char *name, char delim, char *r_name_left, int *r_number) ATTR_NONNULL(1
 
size_t bool BLI_string_is_decimal (const char *string) ATTR_NONNULL(1)
 
void BLI_string_split_suffix (const char *string, size_t string_maxlen, char *r_body, char *r_suf) ATTR_NONNULL(1
 
void void BLI_string_split_prefix (const char *string, size_t string_maxlen, char *r_pre, char *r_body) ATTR_NONNULL(1
 

Implement: <tt>BLI_string_join_by_sep_charN(..)</tt>

#define _BLI_STRING_ARGS_0   char *__restrict dst, const size_t dst_len,
 
#define _BLI_STRING_ARGS_0
 
#define _BLI_STRING_ARGS_0   char *__restrict dst, const size_t dst_len, const char sep,
 
#define BLI_string_join_by_sep_charN(...)    VA_NARGS_CALL_OVERLOAD(_BLI_string_join_by_sep_charN_, __VA_ARGS__)
 
#define _BLI_STRING_ARGS_0   const char sep,
 
char * BLI_string_join_array_by_sep_charN (char sep, const char *strings[], uint strings_num) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_2 (_BLI_STRING_ARGS_1) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_3 (_BLI_STRING_ARGS_2) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_4 (_BLI_STRING_ARGS_3) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_5 (_BLI_STRING_ARGS_4) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_6 (_BLI_STRING_ARGS_5) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_7 (_BLI_STRING_ARGS_6) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_8 (_BLI_STRING_ARGS_7) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_9 (_BLI_STRING_ARGS_8) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_10 (_BLI_STRING_ARGS_9) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_join_by_sep_charN_11 (_BLI_STRING_ARGS_10) ATTR_NONNULL()
 

Implement: <tt>BLI_string_join(..)</tt>

#define BLI_string_join(...)   VA_NARGS_CALL_OVERLOAD(_BLI_string_join_, __VA_ARGS__)
 
size_t BLI_string_join_array (char *result, size_t result_maxncpy, const char *strings[], uint strings_num) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_3 (_BLI_STRING_ARGS_1) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_4 (_BLI_STRING_ARGS_2) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_5 (_BLI_STRING_ARGS_3) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_6 (_BLI_STRING_ARGS_4) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_7 (_BLI_STRING_ARGS_5) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_8 (_BLI_STRING_ARGS_6) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_9 (_BLI_STRING_ARGS_7) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_10 (_BLI_STRING_ARGS_8) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_11 (_BLI_STRING_ARGS_9) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_12 (_BLI_STRING_ARGS_10) ATTR_NONNULL()
 

Implement: <tt>BLI_string_joinN(..)</tt>

#define BLI_string_joinN(...)   VA_NARGS_CALL_OVERLOAD(_BLI_string_joinN_, __VA_ARGS__)
 
char * BLI_string_join_arrayN (const char *strings[], uint strings_num) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_1 (_BLI_STRING_ARGS_1) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_2 (_BLI_STRING_ARGS_2) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_3 (_BLI_STRING_ARGS_3) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_4 (_BLI_STRING_ARGS_4) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_5 (_BLI_STRING_ARGS_5) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_6 (_BLI_STRING_ARGS_6) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_7 (_BLI_STRING_ARGS_7) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_8 (_BLI_STRING_ARGS_8) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_9 (_BLI_STRING_ARGS_9) ATTR_NONNULL()
 
BLI_INLINE char * _BLI_string_joinN_10 (_BLI_STRING_ARGS_10) ATTR_NONNULL()
 

Implement: <tt>BLI_string_join_by_sep_char(..)</tt>

#define BLI_string_join_by_sep_char(...)    VA_NARGS_CALL_OVERLOAD(_BLI_string_join_by_sep_char_, __VA_ARGS__)
 
size_t BLI_string_join_array_by_sep_char (char *result, size_t result_maxncpy, char sep, const char *strings[], uint strings_num) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_4 (_BLI_STRING_ARGS_1) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_5 (_BLI_STRING_ARGS_2) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_6 (_BLI_STRING_ARGS_3) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_7 (_BLI_STRING_ARGS_4) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_8 (_BLI_STRING_ARGS_5) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_9 (_BLI_STRING_ARGS_6) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_10 (_BLI_STRING_ARGS_7) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_11 (_BLI_STRING_ARGS_8) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_12 (_BLI_STRING_ARGS_9) ATTR_NONNULL()
 
BLI_INLINE size_t _BLI_string_join_by_sep_char_13 (_BLI_STRING_ARGS_10) ATTR_NONNULL()
 

String Replace

char ATTR_MALLOC
 
char * BLI_string_replaceN (const char *__restrict str, const char *__restrict substr_old, const char *__restrict substr_new) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
 
void BLI_string_replace_char (char *str, char src, char dst) ATTR_NONNULL(1)
 
bool BLI_string_replace_table_exact (char *string, size_t string_len, const char *replace_table[][2], int replace_table_len)
 
size_t BLI_string_replace_range (char *string, size_t string_maxncpy, int src_beg, int src_end, const char *dst)
 

Macro Definition Documentation

◆ _BLI_STRING_ARGS_0 [1/4]

#define _BLI_STRING_ARGS_0   char *__restrict dst, const size_t dst_len,

Definition at line 210 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_0 [2/4]

#define _BLI_STRING_ARGS_0

Definition at line 210 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_0 [3/4]

#define _BLI_STRING_ARGS_0   char *__restrict dst, const size_t dst_len, const char sep,

Definition at line 210 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_0 [4/4]

#define _BLI_STRING_ARGS_0   const char sep,

Definition at line 210 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_1

#define _BLI_STRING_ARGS_1   _BLI_STRING_ARGS_0 const char *a

Definition at line 195 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_10

#define _BLI_STRING_ARGS_10   _BLI_STRING_ARGS_9, const char *j

Definition at line 204 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_2

#define _BLI_STRING_ARGS_2   _BLI_STRING_ARGS_1, const char *b

Definition at line 196 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_3

#define _BLI_STRING_ARGS_3   _BLI_STRING_ARGS_2, const char *c

Definition at line 197 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_4

#define _BLI_STRING_ARGS_4   _BLI_STRING_ARGS_3, const char *d

Definition at line 198 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_5

#define _BLI_STRING_ARGS_5   _BLI_STRING_ARGS_4, const char *e

Definition at line 199 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_6

#define _BLI_STRING_ARGS_6   _BLI_STRING_ARGS_5, const char *f

Definition at line 200 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_7

#define _BLI_STRING_ARGS_7   _BLI_STRING_ARGS_6, const char *g

Definition at line 201 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_8

#define _BLI_STRING_ARGS_8   _BLI_STRING_ARGS_7, const char *h

Definition at line 202 of file BLI_string_utils.hh.

◆ _BLI_STRING_ARGS_9

#define _BLI_STRING_ARGS_9   _BLI_STRING_ARGS_8, const char *i

Definition at line 203 of file BLI_string_utils.hh.

◆ BLI_string_join

◆ BLI_string_join_by_sep_char

#define BLI_string_join_by_sep_char ( ...)     VA_NARGS_CALL_OVERLOAD(_BLI_string_join_by_sep_char_, __VA_ARGS__)

Definition at line 382 of file BLI_string_utils.hh.

◆ BLI_string_join_by_sep_char_with_tableN

#define BLI_string_join_by_sep_char_with_tableN ( sep,
table,
... )
Value:
sep, table, ((const char *[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
void void char * BLI_string_join_array_by_sep_char_with_tableN(char sep, char *table[], const char *strings[], uint strings_num) ATTR_NONNULL(2
#define VA_NARGS_COUNT(...)

Definition at line 122 of file BLI_string_utils.hh.

◆ BLI_string_join_by_sep_charN

#define BLI_string_join_by_sep_charN ( ...)     VA_NARGS_CALL_OVERLOAD(_BLI_string_join_by_sep_charN_, __VA_ARGS__)

Definition at line 475 of file BLI_string_utils.hh.

Referenced by pyrna_struct_anim_args_parse_no_resolve().

◆ BLI_string_joinN

Typedef Documentation

◆ UniquenameCheckCallback

using UniquenameCheckCallback = bool (*)(void *arg, const char *name)

Definition at line 21 of file BLI_string_utils.hh.

Function Documentation

◆ _BLI_string_join_10()

BLI_INLINE size_t _BLI_string_join_10 ( _BLI_STRING_ARGS_8 )

Definition at line 268 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array(), and e.

◆ _BLI_string_join_11()

BLI_INLINE size_t _BLI_string_join_11 ( _BLI_STRING_ARGS_9 )

Definition at line 273 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array(), and e.

◆ _BLI_string_join_12()

BLI_INLINE size_t _BLI_string_join_12 ( _BLI_STRING_ARGS_10 )

Definition at line 278 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array(), and e.

◆ _BLI_string_join_3()

BLI_INLINE size_t _BLI_string_join_3 ( _BLI_STRING_ARGS_1 )

Definition at line 233 of file BLI_string_utils.hh.

References ARRAY_SIZE, and BLI_string_join_array().

◆ _BLI_string_join_4()

BLI_INLINE size_t _BLI_string_join_4 ( _BLI_STRING_ARGS_2 )

Definition at line 238 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array().

◆ _BLI_string_join_5()

BLI_INLINE size_t _BLI_string_join_5 ( _BLI_STRING_ARGS_3 )

Definition at line 243 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array().

◆ _BLI_string_join_6()

BLI_INLINE size_t _BLI_string_join_6 ( _BLI_STRING_ARGS_4 )

Definition at line 248 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array().

◆ _BLI_string_join_7()

BLI_INLINE size_t _BLI_string_join_7 ( _BLI_STRING_ARGS_5 )

Definition at line 253 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array(), and e.

◆ _BLI_string_join_8()

BLI_INLINE size_t _BLI_string_join_8 ( _BLI_STRING_ARGS_6 )

Definition at line 258 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array(), and e.

◆ _BLI_string_join_9()

BLI_INLINE size_t _BLI_string_join_9 ( _BLI_STRING_ARGS_7 )

Definition at line 263 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array(), and e.

◆ _BLI_string_join_by_sep_char_10()

BLI_INLINE size_t _BLI_string_join_by_sep_char_10 ( _BLI_STRING_ARGS_7 )

Definition at line 434 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_char(), and e.

◆ _BLI_string_join_by_sep_char_11()

BLI_INLINE size_t _BLI_string_join_by_sep_char_11 ( _BLI_STRING_ARGS_8 )

Definition at line 440 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_char(), and e.

◆ _BLI_string_join_by_sep_char_12()

BLI_INLINE size_t _BLI_string_join_by_sep_char_12 ( _BLI_STRING_ARGS_9 )

Definition at line 446 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_char(), and e.

◆ _BLI_string_join_by_sep_char_13()

BLI_INLINE size_t _BLI_string_join_by_sep_char_13 ( _BLI_STRING_ARGS_10 )

Definition at line 452 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_char(), and e.

◆ _BLI_string_join_by_sep_char_4()

BLI_INLINE size_t _BLI_string_join_by_sep_char_4 ( _BLI_STRING_ARGS_1 )

Definition at line 398 of file BLI_string_utils.hh.

References ARRAY_SIZE, and BLI_string_join_array_by_sep_char().

◆ _BLI_string_join_by_sep_char_5()

BLI_INLINE size_t _BLI_string_join_by_sep_char_5 ( _BLI_STRING_ARGS_2 )

Definition at line 404 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array_by_sep_char().

◆ _BLI_string_join_by_sep_char_6()

BLI_INLINE size_t _BLI_string_join_by_sep_char_6 ( _BLI_STRING_ARGS_3 )

Definition at line 410 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array_by_sep_char().

◆ _BLI_string_join_by_sep_char_7()

BLI_INLINE size_t _BLI_string_join_by_sep_char_7 ( _BLI_STRING_ARGS_4 )

Definition at line 416 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array_by_sep_char().

◆ _BLI_string_join_by_sep_char_8()

BLI_INLINE size_t _BLI_string_join_by_sep_char_8 ( _BLI_STRING_ARGS_5 )

Definition at line 422 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_char(), and e.

◆ _BLI_string_join_by_sep_char_9()

BLI_INLINE size_t _BLI_string_join_by_sep_char_9 ( _BLI_STRING_ARGS_6 )

Definition at line 428 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_char(), and e.

◆ _BLI_string_join_by_sep_charN_10()

BLI_INLINE char * _BLI_string_join_by_sep_charN_10 ( _BLI_STRING_ARGS_9 )

Definition at line 531 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_charN(), and e.

◆ _BLI_string_join_by_sep_charN_11()

BLI_INLINE char * _BLI_string_join_by_sep_charN_11 ( _BLI_STRING_ARGS_10 )

Definition at line 536 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_charN(), and e.

◆ _BLI_string_join_by_sep_charN_2()

BLI_INLINE char * _BLI_string_join_by_sep_charN_2 ( _BLI_STRING_ARGS_1 )

Definition at line 491 of file BLI_string_utils.hh.

References ARRAY_SIZE, and BLI_string_join_array_by_sep_charN().

◆ _BLI_string_join_by_sep_charN_3()

BLI_INLINE char * _BLI_string_join_by_sep_charN_3 ( _BLI_STRING_ARGS_2 )

Definition at line 496 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array_by_sep_charN().

◆ _BLI_string_join_by_sep_charN_4()

BLI_INLINE char * _BLI_string_join_by_sep_charN_4 ( _BLI_STRING_ARGS_3 )

Definition at line 501 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array_by_sep_charN().

◆ _BLI_string_join_by_sep_charN_5()

BLI_INLINE char * _BLI_string_join_by_sep_charN_5 ( _BLI_STRING_ARGS_4 )

Definition at line 506 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_array_by_sep_charN().

◆ _BLI_string_join_by_sep_charN_6()

BLI_INLINE char * _BLI_string_join_by_sep_charN_6 ( _BLI_STRING_ARGS_5 )

Definition at line 511 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_charN(), and e.

◆ _BLI_string_join_by_sep_charN_7()

BLI_INLINE char * _BLI_string_join_by_sep_charN_7 ( _BLI_STRING_ARGS_6 )

Definition at line 516 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_charN(), and e.

◆ _BLI_string_join_by_sep_charN_8()

BLI_INLINE char * _BLI_string_join_by_sep_charN_8 ( _BLI_STRING_ARGS_7 )

Definition at line 521 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_charN(), and e.

◆ _BLI_string_join_by_sep_charN_9()

BLI_INLINE char * _BLI_string_join_by_sep_charN_9 ( _BLI_STRING_ARGS_8 )

Definition at line 526 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_array_by_sep_charN(), and e.

◆ _BLI_string_joinN_1()

BLI_INLINE char * _BLI_string_joinN_1 ( _BLI_STRING_ARGS_1 )

Definition at line 313 of file BLI_string_utils.hh.

References ARRAY_SIZE, and BLI_string_join_arrayN().

◆ _BLI_string_joinN_10()

BLI_INLINE char * _BLI_string_joinN_10 ( _BLI_STRING_ARGS_10 )

Definition at line 358 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_arrayN(), and e.

◆ _BLI_string_joinN_2()

BLI_INLINE char * _BLI_string_joinN_2 ( _BLI_STRING_ARGS_2 )

Definition at line 318 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_arrayN().

◆ _BLI_string_joinN_3()

BLI_INLINE char * _BLI_string_joinN_3 ( _BLI_STRING_ARGS_3 )

Definition at line 323 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_arrayN().

◆ _BLI_string_joinN_4()

BLI_INLINE char * _BLI_string_joinN_4 ( _BLI_STRING_ARGS_4 )

Definition at line 328 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, and BLI_string_join_arrayN().

◆ _BLI_string_joinN_5()

BLI_INLINE char * _BLI_string_joinN_5 ( _BLI_STRING_ARGS_5 )

Definition at line 333 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_arrayN(), and e.

◆ _BLI_string_joinN_6()

BLI_INLINE char * _BLI_string_joinN_6 ( _BLI_STRING_ARGS_6 )

Definition at line 338 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_arrayN(), and e.

◆ _BLI_string_joinN_7()

BLI_INLINE char * _BLI_string_joinN_7 ( _BLI_STRING_ARGS_7 )

Definition at line 343 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_arrayN(), and e.

◆ _BLI_string_joinN_8()

BLI_INLINE char * _BLI_string_joinN_8 ( _BLI_STRING_ARGS_8 )

Definition at line 348 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_arrayN(), and e.

◆ _BLI_string_joinN_9()

BLI_INLINE char * _BLI_string_joinN_9 ( _BLI_STRING_ARGS_9 )

Definition at line 353 of file BLI_string_utils.hh.

References ARRAY_SIZE, b, BLI_string_join_arrayN(), and e.

◆ BLI_string_flip_side_name()

size_t BLI_string_flip_side_name ( char * name_dst,
const char * name_src,
bool strip_number,
size_t name_dst_maxncpy )

Finds the best possible flipped (left/right) name. For renaming; check for unique names afterwards.

Parameters
name_dstflipped name, assumed to be a pointer to a string of at least name_maxncpy size.
name_srcoriginal name, assumed to be a pointer to a string of at least name_maxncpy size.
strip_numberIf set, remove number extensions.
Returns
The number of bytes written into name.

Referenced by action_flip_pchan(), action_flip_pchan_rna_paths(), add_verts_to_dgroups(), armature_duplicate_selected_exec(), armature_symmetrize_exec(), BKE_object_defgroup_flip_index(), BKE_object_defgroup_flip_map_single(), BKE_object_defgroup_mirror_selection(), BKE_pose_channel_get_mirrored(), bpy_flip_name(), ED_armature_bones_flip_names(), ED_armature_ebone_get_mirrored(), ED_wpaint_mirror_vgroup_ensure(), flip_names(), object_defgroup_unlocked_flip_map_ex(), blender::ed::object::object_select_mirror_exec(), pose_bone_do_paste(), updateDuplicateCustomBoneShapes(), and updateDuplicateSubtarget().

◆ BLI_string_is_decimal()

size_t bool BLI_string_is_decimal ( const char * string)

Definition at line 198 of file string_utils.cc.

Referenced by ED_text_is_syntax_highlight_supported(), and TEST().

◆ BLI_string_join_array()

◆ BLI_string_join_array_by_sep_char()

◆ BLI_string_join_array_by_sep_char_with_tableN()

void void char * BLI_string_join_array_by_sep_char_with_tableN ( char sep,
char * table[],
const char * strings[],
uint strings_num )

A version of BLI_string_join_array_by_sep_charN that takes a table array. The new location of each string is written into this array.

◆ BLI_string_join_array_by_sep_charN()

◆ BLI_string_join_arrayN()

◆ BLI_string_len_array()

void size_t BLI_string_len_array ( const char * strings[],
uint strings_num )

◆ BLI_string_replace_char()

◆ BLI_string_replace_range()

size_t BLI_string_replace_range ( char * string,
size_t string_maxncpy,
int src_beg,
int src_end,
const char * dst )

Write dst into the range between src_beg & src_end, resize within string_maxncpy limits, ensure null terminated.

Returns
the length of string.

Definition at line 114 of file string_utils.cc.

References BLI_assert, int, and UNLIKELY.

Referenced by BLI_path_frame(), and BLI_path_frame_range().

◆ BLI_string_replace_table_exact()

bool BLI_string_replace_table_exact ( char * string,
size_t string_len,
const char * replace_table[][2],
int replace_table_len )

Simple exact-match string replacement.

Parameters
replace_tableArray of source, destination pairs.
Note
Larger tables should use a hash table.

Definition at line 98 of file string_utils.cc.

References BLI_string_debug_size_after_nil, BLI_strncpy(), and STREQ.

Referenced by BKE_workspace_tool_id_replace_table(), and blo_do_versions_userdef().

◆ BLI_string_replaceN()

char * BLI_string_replaceN ( const char *__restrict str,
const char *__restrict substr_old,
const char *__restrict substr_new )

string with all instances of substr_old replaced with substr_new, Returns a copy of the c-string str into a newly MEM_mallocN'd and returns it.

Note
A rather wasteful string-replacement utility, though this shall do for now. Feel free to replace this with an even safe + nicer alternative
Parameters
strThe string to replace occurrences of substr_old in
substr_oldThe text in the string to find and replace
substr_newThe text in the string to find and replace
Return values
Returnsthe duplicated string

Referenced by BKE_image_get_tile_strformat(), do_versions_sequencer_speed_effect_recursive(), blender::nodes::node_fn_replace_string_cc::replace_all(), replace_bbone_easing_rnapath(), and updateDuplicateActionConstraintSettings().

◆ BLI_string_split_name_number()

size_t BLI_string_split_name_number ( const char * name,
char delim,
char * r_name_left,
int * r_number )

Looks for a numeric suffix preceded by delim character on the end of name, puts preceding part into *left and value of suffix into *nr. Returns the length of *left.

Foo.001 -> "Foo", 1 Returning the length of "Foo"

Parameters
leftWhere to return copy of part preceding delim.
nrWhere to return value of numeric suffix. \param name: String to split.
delimDelimiter character`.
Returns
Length of left.

Referenced by BKE_id_new_name_validate(), BKE_main_namemap_get_name(), BKE_mball_basis_find(), BKE_mball_is_same_group(), BKE_mball_properties_copy(), init_meta(), main_namemap_populate(), and namemap_remove_name().

◆ BLI_string_split_prefix()

void void BLI_string_split_prefix ( const char * string,
size_t string_maxlen,
char * r_pre,
char * r_body )

"a.b.c" -> ("a.", "b.c").

Referenced by select_similar_prefix().

◆ BLI_string_split_suffix()

void BLI_string_split_suffix ( const char * string,
size_t string_maxlen,
char * r_body,
char * r_suf )

Based on BLI_path_split_dir_file() / os.path.splitext(), "a.b.c" -> ("a.b", ".c").

Referenced by blender::io::usd::get_in_memory_texture_filename(), and select_similar_suffix().

◆ BLI_uniquename()

void BLI_uniquename ( const struct ListBase * list,
void * vlink,
const char * defname,
char delim,
int name_offset,
size_t name_maxncpy )

Ensures that the specified block has a unique name within the containing list, incrementing its numeric suffix as necessary.

Parameters
listList containing the block
vlinkThe block to check the name for
defnameTo initialize block name if latter is empty
delimDelimits numeric suffix in name
name_offsetOffset of name within block structure
name_maxncpyMaximum length of name area

Referenced by action_groups_add_new(), AnimationImporter::add_bone_fcurve(), add_to_modifier_list(), BKE_asset_metadata_tag_add(), BKE_collection_exporter_name_set(), BKE_constraint_unique_name(), BKE_fmodifier_name_set(), BKE_freestyle_lineset_unique_name(), BKE_gpencil_layer_addnew(), BKE_gpencil_palette_addnew(), BKE_gpencil_palettecolor_addnew(), BKE_keyblock_add(), BKE_keyingset_add(), BKE_mask_layer_unique_name(), BKE_modifier_unique_name(), BKE_nla_action_stash(), BKE_nlatrack_insert_after(), BKE_nlatrack_insert_before(), BKE_pose_add_group(), BKE_preferences_asset_library_name_set(), BKE_preferences_extension_repo_module_set(), BKE_preferences_extension_repo_name_set(), BKE_scene_add_render_view(), BKE_shaderfx_unique_name(), BKE_tracking_object_unique_name(), BKE_tracking_plane_track_unique_name(), BKE_tracking_track_unique_name(), BKE_view_layer_add(), BKE_view_layer_rename(), do_versions_after_linking_300(), do_versions_nodetree_customnodes(), do_versions_theme(), driver_add_new_variable(), driver_variable_unique_name(), fcurve_add_to_list(), blender::ed::outliner::namebutton_fn(), blender::bke::node_unique_name(), psys_unique_name(), SEQ_modifier_list_copy(), SEQ_modifier_unique_name(), tracks_map_merge(), viewlayer_aov_make_name_unique(), viewlayer_lightgroup_make_name_unique(), and workspace_layout_name_set().

◆ BLI_uniquename_cb() [1/2]

size_t void std::string BLI_uniquename_cb ( blender::FunctionRef< bool(blender::StringRef)> unique_check,
char delim,
blender::StringRef name )

Ensures name is unique (according to criteria specified by caller in unique_check callback), incrementing its numeric suffix as necessary.

Parameters
unique_checkReturn true if name is not unique
delimDelimits numeric suffix in name
nameName to be ensured unique

Definition at line 430 of file string_utils.cc.

References BLI_snprintf(), BLI_string_split_name_number(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), and len.

◆ BLI_uniquename_cb() [2/2]

size_t void BLI_uniquename_cb ( UniquenameCheckCallback unique_check,
void * arg,
const char * defname,
char delim,
char * name,
size_t name_maxncpy )

Variable Documentation

◆ ATTR_MALLOC

char ATTR_MALLOC

Definition at line 43 of file BLI_string_utils.hh.