MySQL 9.1.0
Source Code Documentation
my_uca_scanner Class Reference

Unicode Collation Algorithm: Collation element (weight) scanner, for consequent scan of collations weights from a string. More...

Inheritance diagram for my_uca_scanner:
[legend]

Public Member Functions

unsigned get_weight_level () const
 Get the level the scanner is currently working on. More...
 

Protected Member Functions

 my_uca_scanner (const CHARSET_INFO *cs_arg, const uint8_t *str, size_t length)
 
const uint16_t * contraction_find (my_wc_t wc0, size_t *chars_skipped)
 Find a contraction in the input stream and return its weight array. More...
 
const uint16_t * previous_context_find (my_wc_t wc0, my_wc_t wc1)
 Find weight for contraction with previous context and return its weight array. More...
 

Protected Attributes

unsigned weight_lv {0}
 
const uint16_t * wbeg
 
unsigned wbeg_stride {0}
 
const uint8_t * sbeg
 
const uint8_t * send
 
const MY_UCA_INFOuca {nullptr}
 
uint16_t implicit [10] {}
 
my_wc_t prev_char {0}
 
const CHARSET_INFOcs
 
unsigned num_of_ce_left {0}
 
const uint8_t * sbeg_dup
 

Detailed Description

Unicode Collation Algorithm: Collation element (weight) scanner, for consequent scan of collations weights from a string.

Only meant as a base class; instantiate uca_scanner_any or uca_scanner_900 instead of this.

Constructor & Destructor Documentation

◆ my_uca_scanner()

my_uca_scanner::my_uca_scanner ( const CHARSET_INFO cs_arg,
const uint8_t *  str,
size_t  length 
)
inlineprotected

Member Function Documentation

◆ contraction_find()

const uint16_t * my_uca_scanner::contraction_find ( my_wc_t  wc0,
size_t *  chars_skipped 
)
protected

Find a contraction in the input stream and return its weight array.

Scan input code points to find a longest path in contraction trie which contains all these code points. If the ending node of this path is end of contraction, return the weight array.

Parameters
wc0The first code point of the contraction (which should have the MY_UCA_CNT_HEAD flag).
[out]chars_skippedHow many code points where skipped in the contraction we found. Only makes sense if we actually found one.
Returns
Weight array
Return values
NULLno contraction found
ptrcontraction weight array

◆ get_weight_level()

unsigned my_uca_scanner::get_weight_level ( ) const
inline

Get the level the scanner is currently working on.

The string can be scanned multiple times (if the collation requires multi-level comparisons, e.g. for accent or case sensitivity); first to get primary weights, then from the start again for secondary, etc.

◆ previous_context_find()

ALWAYS_INLINE const uint16_t * my_uca_scanner::previous_context_find ( my_wc_t  wc0,
my_wc_t  wc1 
)
inlineprotected

Find weight for contraction with previous context and return its weight array.

Parameters
wc0Previous code point
wc1Current code point
Returns
Weight array
Return values
NULL- no contraction with context found
ptr- contraction weight array

Member Data Documentation

◆ cs

const CHARSET_INFO* my_uca_scanner::cs
protected

◆ implicit

uint16_t my_uca_scanner::implicit[10] {}
protected

◆ num_of_ce_left

unsigned my_uca_scanner::num_of_ce_left {0}
protected

◆ prev_char

my_wc_t my_uca_scanner::prev_char {0}
protected

◆ sbeg

const uint8_t* my_uca_scanner::sbeg
protected

◆ sbeg_dup

const uint8_t* my_uca_scanner::sbeg_dup
protected

◆ send

const uint8_t* my_uca_scanner::send
protected

◆ uca

const MY_UCA_INFO* my_uca_scanner::uca {nullptr}
protected

◆ wbeg

const uint16_t* my_uca_scanner::wbeg
protected

◆ wbeg_stride

unsigned my_uca_scanner::wbeg_stride {0}
protected

◆ weight_lv

unsigned my_uca_scanner::weight_lv {0}
protected

The documentation for this class was generated from the following file: