diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
commit | 9e365069afe156f33fadfad9705e1325f894cd54 (patch) | |
tree | 78373044d029feb51f987b45208e0c1a36958625 /source/blender/blenlib/intern/string_utils.c | |
parent | d8b42751625c915113b64f5a2d9c72f19f009fee (diff) |
Cleanup: move public doc-strings into headers for 'blenlib'
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
Diffstat (limited to 'source/blender/blenlib/intern/string_utils.c')
-rw-r--r-- | source/blender/blenlib/intern/string_utils.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/source/blender/blenlib/intern/string_utils.c b/source/blender/blenlib/intern/string_utils.c index b62b9c3bc7a..21162904dbd 100644 --- a/source/blender/blenlib/intern/string_utils.c +++ b/source/blender/blenlib/intern/string_utils.c @@ -38,20 +38,6 @@ # pragma GCC diagnostic error "-Wsign-conversion" #endif -/** - * 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" - * - * \param left: Where to return copy of part preceding delim - * \param nr: Where to return value of numeric suffix - * \param name: String to split - * \param delim: Delimiter character - * \return Length of \a left - */ size_t BLI_split_name_num(char *left, int *nr, const char *name, const char delim) { const size_t name_len = strlen(name); @@ -102,10 +88,6 @@ static bool is_char_sep(const char c) return ELEM(c, '.', ' ', '-', '_'); } -/** - * based on `BLI_split_dirfile()` / `os.path.splitext()`, - * `"a.b.c"` -> (`"a.b"`, `".c"`). - */ void BLI_string_split_suffix(const char *string, char *r_body, char *r_suf, const size_t str_len) { size_t len = BLI_strnlen(string, str_len); @@ -124,9 +106,6 @@ void BLI_string_split_suffix(const char *string, char *r_body, char *r_suf, cons memcpy(r_body, string, len + 1); } -/** - * `"a.b.c"` -> (`"a."`, `"b.c"`) - */ void BLI_string_split_prefix(const char *string, char *r_pre, char *r_body, const size_t str_len) { size_t len = BLI_strnlen(string, str_len); @@ -146,17 +125,6 @@ void BLI_string_split_prefix(const char *string, char *r_pre, char *r_body, cons BLI_strncpy(r_body, string, len); } -/** - * Finds the best possible flipped (left/right) name. - * For renaming; check for unique names afterwards. - * - * \param r_name: flipped name, - * assumed to be a pointer to a string of at least \a name_len size. - * \param from_name: original name, - * assumed to be a pointer to a string of at least \a name_len size. - * \param strip_number: If set, remove number extensions. - * \return The number of bytes written into \a r_name. - */ size_t BLI_string_flip_side_name(char *r_name, const char *from_name, const bool strip_number, @@ -278,18 +246,6 @@ size_t BLI_string_flip_side_name(char *r_name, /* Unique name utils. */ -/** - * Ensures name is unique (according to criteria specified by caller in unique_check callback), - * incrementing its numeric suffix as necessary. Returns true if name had to be adjusted. - * - * \param unique_check: Return true if name is not unique - * \param arg: Additional arg to unique_check--meaning is up to caller - * \param defname: To initialize name if latter is empty - * \param delim: Delimits numeric suffix in name - * \param name: Name to be ensured unique - * \param name_len: Maximum length of name area - * \return true if there if the name was changed - */ bool BLI_uniquename_cb(UniquenameCheckCallback unique_check, void *arg, const char *defname, @@ -366,17 +322,6 @@ static bool uniquename_unique_check(void *arg, const char *name) return uniquename_find_dupe(data->lb, data->vlink, name, data->name_offset); } -/** - * Ensures that the specified block has a unique name within the containing list, - * incrementing its numeric suffix as necessary. Returns true if name had to be adjusted. - * - * \param list: List containing the block - * \param vlink: The block to check the name for - * \param defname: To initialize block name if latter is empty - * \param delim: Delimits numeric suffix in name - * \param name_offset: Offset of name within block structure - * \param name_len: Maximum length of name area - */ bool BLI_uniquename( ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len) { @@ -432,9 +377,6 @@ char *BLI_string_join_array(char *result, return c; } -/** - * A version of #BLI_string_join that takes a separator which can be any character including '\0'. - */ char *BLI_string_join_array_by_sep_char( char *result, size_t result_len, char sep, const char *strings[], uint strings_len) { @@ -455,9 +397,6 @@ char *BLI_string_join_array_by_sep_char( return c; } -/** - * Join an array of strings into a newly allocated, null terminated string. - */ char *BLI_string_join_arrayN(const char *strings[], uint strings_len) { uint total_len = 1; @@ -474,9 +413,6 @@ char *BLI_string_join_arrayN(const char *strings[], uint strings_len) return result; } -/** - * A version of #BLI_string_joinN that takes a separator which can be any character including '\0'. - */ char *BLI_string_join_array_by_sep_charN(char sep, const char *strings[], uint strings_len) { uint total_len = 0; @@ -501,10 +437,6 @@ char *BLI_string_join_array_by_sep_charN(char sep, const char *strings[], uint s return result; } -/** - * 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. - */ char *BLI_string_join_array_by_sep_char_with_tableN(char sep, char *table[], const char *strings[], |