Blender V5.3
string.cc File Reference
#include <algorithm>
#include <cctype>
#include <cinttypes>
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_string.hh"
#include "BLI_utildefines.hh"
#include "BLI_strict_flags.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define CASE_PAIR(value_src, value_dst)

Functions

String Duplicate/Copy
char * blender::BLI_strdupn (const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * blender::BLI_strdup (const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * blender::BLI_strdup_null (const char *str) ATTR_WARN_UNUSED_RESULT ATTR_MALLOC
char * blender::BLI_strdupcat (const char *__restrict str1, const char *__restrict str2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * blender::BLI_strncpy (char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char char * blender::BLI_strncpy_ensure_pad (char *__restrict dst, const char *__restrict src, char pad, size_t dst_maxncpy) ATTR_NONNULL(1
char char size_t blender::BLI_strncpy_rlen (char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
String Append
char char size_t char * blender::BLI_strncat (char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
String Printing
size_t blender::BLI_vsnprintf (char *__restrict dst, size_t dst_maxncpy, const char *__restrict format, va_list arg) ATTR_PRINTF_FORMAT(3
size_t size_t blender::BLI_vsnprintf_rlen (char *__restrict dst, size_t dst_maxncpy, const char *__restrict format, va_list arg) ATTR_PRINTF_FORMAT(3
size_t blender::BLI_snprintf (char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
size_t blender::BLI_snprintf_rlen (char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
size_t size_t char * blender::BLI_sprintfN_with_buffer (char *fixed_buf, size_t fixed_buf_maxncpy, size_t *result_len, const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * blender::BLI_vsprintfN_with_buffer (char *fixed_buf, size_t fixed_buf_maxncpy, size_t *result_len, const char *__restrict format, va_list args) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * blender::BLI_sprintfN (const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char char * blender::BLI_vsprintfN (const char *__restrict format, va_list args) ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
String Escape/Un-Escape
char char size_t blender::BLI_str_escape (char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
std::string blender::BLI_str_escape (StringRef str)
BLI_INLINE bool blender::str_unescape_pair (char c_next, char *r_out)
size_t blender::BLI_str_unescape_ex (char *__restrict dst, const char *__restrict src, size_t src_len, size_t dst_maxncpy, bool *r_is_complete) ATTR_NONNULL(1
size_t size_t blender::BLI_str_unescape (char *__restrict dst, const char *__restrict src, size_t src_len) ATTR_NONNULL(1
size_t size_t const char * blender::BLI_str_escape_find_quote (const char *str) ATTR_NONNULL(1)
String Quote/Un-Quote
bool blender::BLI_str_quoted_substr_range (const char *__restrict str, const char *__restrict prefix, int *__restrict r_start, int *__restrict r_end) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
bool bool blender::BLI_str_quoted_substr (const char *__restrict str, const char *__restrict prefix, char *result, size_t result_maxncpy)
String Comparison/Matching
int blender::BLI_strcaseeq (const char *a, const char *b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int char * blender::BLI_strcasestr (const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int bool bool bool size_t size_t size_t int blender::BLI_string_max_possible_word_count (int str_len) ATTR_WARN_UNUSED_RESULT
bool blender::BLI_string_has_word_prefix (const char *haystack, const char *needle, size_t needle_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
bool bool blender::BLI_string_all_words_matched (const char *name, const char *str, int(*words)[2], int words_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int char char * blender::BLI_strncasestr (const char *s, const char *find, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int char char int blender::BLI_strcasecmp (const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int char char int int blender::BLI_strncasecmp (const char *s1, const char *s2, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
static int blender::left_number_strcmp (const char *s1, const char *s2, int *tiebreaker)
int char char int int int blender::BLI_strcasecmp_natural (const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int char char int int int int blender::BLI_strcmp_ignore_pad (const char *str1, const char *str2, char pad) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
String Comparison at Start/End
int blender::BLI_str_index_in_array_n (const char *__restrict str, const char **__restrict str_array, int str_array_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int blender::BLI_str_index_in_array (const char *__restrict str, const char **__restrict str_array) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int bool blender::BLI_str_startswith (const char *__restrict str, const char *__restrict start) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int bool bool bool blender::BLI_strn_endswith (const char *__restrict str, const char *__restrict end, size_t str_len) ATTR_NONNULL(1
int bool bool blender::BLI_str_endswith (const char *__restrict str, const char *__restrict end) ATTR_NONNULL(1
String Length
int char char int int int int size_t blender::BLI_strnlen (const char *str, size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
String Scanning
char char size_t char const char * blender::BLI_strchr_or_end (const char *str, char ch) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1)
String Case Conversion
char blender::BLI_tolower_ascii (const char c) ATTR_WARN_UNUSED_RESULT
char blender::BLI_toupper_ascii (const char c) ATTR_WARN_UNUSED_RESULT
void blender::BLI_str_tolower_ascii (char *str, size_t len) ATTR_NONNULL(1)
void blender::BLI_str_toupper_ascii (char *str, size_t len) ATTR_NONNULL(1)
String Stripping
void blender::BLI_str_rstrip (char *str) ATTR_NONNULL(1)
int blender::BLI_str_rstrip_float_zero (char *str, char pad) ATTR_NONNULL(1)
int blender::BLI_str_rstrip_digits (char *str) ATTR_NONNULL()
String Split (Partition)
int bool bool bool size_t blender::BLI_str_partition (const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL(1
int bool bool bool size_t size_t blender::BLI_str_rpartition (const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL(1
int bool bool bool size_t size_t size_t blender::BLI_str_partition_ex (const char *str, const char *end, const char delim[], const char **sep, const char **suf, bool from_right) ATTR_NONNULL(1
bool bool int blender::BLI_string_find_split_words (const char *str, size_t str_maxlen, char delim, int r_words[][2], int words_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
bool bool int bool blender::BLI_string_elem_split_by_delim (const char *haystack, const char delim, const char *needle) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
String Formatting (Numeric)
static size_t blender::BLI_str_format_int_grouped_ex (char *src, char *dst, int num_len)
size_t blender::BLI_str_format_int_grouped (char dst[BLI_STR_FORMAT_INT32_GROUPED_SIZE], int num) ATTR_NONNULL(1)
size_t blender::BLI_str_format_uint64_grouped (char dst[BLI_STR_FORMAT_UINT64_GROUPED_SIZE], uint64_t num) ATTR_NONNULL(1)
size_t blender::BLI_str_format_int64_grouped (char dst[BLI_STR_FORMAT_INT64_GROUPED_SIZE], int64_t num) ATTR_NONNULL(1)
void blender::BLI_str_format_byte_unit (char dst[BLI_STR_FORMAT_INT64_BYTE_UNIT_SIZE], long long int bytes, bool base_10) ATTR_NONNULL(1)
void blender::BLI_str_format_byte_unit_compact (char dst[BLI_STR_FORMAT_INT64_BYTE_UNIT_COMPACT_SIZE], long long int bytes, bool base_10) ATTR_NONNULL(1)
void blender::BLI_str_format_decimal_unit (char dst[BLI_STR_FORMAT_INT32_DECIMAL_UNIT_SIZE], int number_to_format) ATTR_NONNULL(1)
void blender::BLI_str_format_integer_unit (char dst[BLI_STR_FORMAT_INT32_INTEGER_UNIT_SIZE], int number_to_format) ATTR_NONNULL(1)

Macro Definition Documentation

◆ CASE_PAIR

#define CASE_PAIR ( value_src,
value_dst )
Value:
case value_src: { \
*r_out = value_dst; \
return true; \
}

Referenced by blender::gpu::reversed(), and blender::str_unescape_pair().