MySQL 8.4.2
Source Code Documentation
my_strchr.cc File Reference
#include <cstddef>
#include "mysql/strings/m_ctype.h"

Functions

size_t my_strcspn (const CHARSET_INFO *cs, const char *str, const char *str_end, const char *reject, size_t reject_length)
 Calculate the length of the initial segment of 'str' which consists entirely of characters not in 'reject'. More...
 

Function Documentation

◆ my_strcspn()

size_t my_strcspn ( const CHARSET_INFO cs,
const char *  str,
const char *  str_end,
const char *  reject,
size_t  reject_length 
)

Calculate the length of the initial segment of 'str' which consists entirely of characters not in 'reject'.

Parameters
csPointer to charset info.
strPointer to multi-byte string.
str_endPointer to end of multi-byte string.
rejectPointer to start of single-byte reject string.
reject_lengthLength of single-byte reject string.
Returns
Length of segment of multi-byte string that doesn't contain any character of the single-byte reject string or zero if an invalid encoding of a character of the multi-byte string is found.
Note
The reject string points to single-byte characters so it is only possible to find the first occurrence of a single-byte character. Multi-byte characters in 'str' are treated as not matching any character in the reject string. This method returns zero if an invalid encoding of any character in the string 'str' using charset 'cs' is found.