diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-21 10:34:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-21 10:34:18 +0300 |
commit | 06c682423a4374536c081a2b5c77446b5aa04d1e (patch) | |
tree | d1e2e6c497a1974e81fcf1489679d8e7180a8fcf /source/blender/blenlib/BLI_string.h | |
parent | 5da3177190254273790043318db7e6a177270d55 (diff) |
BLI_string: add a utility to replace strings using a table
Useful to simplify versioning code when identifiers need updating
in multiple places.
Diffstat (limited to 'source/blender/blenlib/BLI_string.h')
-rw-r--r-- | source/blender/blenlib/BLI_string.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index 096e7818013..5a80680c350 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -68,6 +68,11 @@ char *BLI_str_replaceN(const char *__restrict str, void BLI_str_replace_char(char *string, char src, char dst) ATTR_NONNULL(); +bool BLI_str_replace_table_exact(char *string, + const size_t string_len, + const char *replace_table[][2], + int replace_table_len); + size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format, ...) ATTR_NONNULL(1, 3) ATTR_PRINTF_FORMAT(3, 4); size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format, ...) |