Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-07-04 16:14:06 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-07-04 16:14:06 +0400
commite3c8cf0a9ea00ef6c7a63b5fc8351f5f9be1ac8f (patch)
treeada2dce46e6e94aebb24cab35aed7c5e2a30fc98 /source/blender/blenlib/BLI_string_utf8.h
parent85c4feab027238bb9dbf7fa727cb608052ec79d5 (diff)
Add (r)partition funcs to BLI_string, to get left-most/right-most first occurence of delimiters.
Inspired by Python (r)partition str functions. Also added some Gtest cases for those new funcs. Reviewed by Campbell Barton, many thanks!
Diffstat (limited to 'source/blender/blenlib/BLI_string_utf8.h')
-rw-r--r--source/blender/blenlib/BLI_string_utf8.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h
index 4aef2318683..89754be25ba 100644
--- a/source/blender/blenlib/BLI_string_utf8.h
+++ b/source/blender/blenlib/BLI_string_utf8.h
@@ -66,6 +66,10 @@ int BLI_wcswidth(const wchar_t *pwcs, size_t n) ATTR_NONNULL();
int BLI_str_utf8_char_width(const char *p) ATTR_NONNULL(); /* warning, can return -1 on bad chars */
int BLI_str_utf8_char_width_safe(const char *p) ATTR_NONNULL();
+size_t BLI_str_partition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) ATTR_NONNULL();
+size_t BLI_str_rpartition_utf8(const char *str, const unsigned int delim[], char **sep, char **suf) ATTR_NONNULL();
+size_t BLI_str_partition_ex_utf8(const char *str, const unsigned int delim[], char **sep, char **suf, const bool from_right) ATTR_NONNULL();
+
#define BLI_UTF8_MAX 6 /* mem */
#define BLI_UTF8_WIDTH_MAX 2 /* columns */
#define BLI_UTF8_ERR ((unsigned int)-1)