MySQL 8.4.0
Source Code Documentation
mysql::collation Namespace Reference

Classes

class  Name
 Normalizes character set/collation names. More...
 

Functions

MYSQL_STRINGS_EXPORT void initialize (const char *charset_dir=nullptr, MY_CHARSET_LOADER *loader=nullptr)
 Initialize character set/collation library. More...
 
MYSQL_STRINGS_EXPORT void shutdown ()
 Shutdown character set/collation library. More...
 
MYSQL_STRINGS_EXPORT const CHARSET_INFOfind_by_name (const Name &name)
 Find collation by its name. More...
 
const CHARSET_INFOfind_by_name (const char *name)
 Find collation by its name. More...
 
MYSQL_STRINGS_EXPORT const CHARSET_INFOfind_by_id (unsigned id)
 Find collation by its number. More...
 
MYSQL_STRINGS_EXPORT const CHARSET_INFOfind_primary (Name cs_name)
 Find primary collation by its character set name. More...
 
const CHARSET_INFOfind_primary (const char *cs_name)
 Find primary collation by its character set name. More...
 
MYSQL_STRINGS_EXPORT const CHARSET_INFOfind_default_binary (const Name &cs_name)
 Find binary collation by its character set name. More...
 
const CHARSET_INFOfind_default_binary (const char *cs_name)
 Find binary collation by its character set name. More...
 

Function Documentation

◆ find_by_id()

const CHARSET_INFO * mysql::collation::find_by_id ( unsigned  id)

Find collation by its number.

Parameters
idCollation id (hardcoded in library sources or specified in Index.xml)
Returns
pointer to a collation object on success, nullptr if not found

◆ find_by_name() [1/2]

const CHARSET_INFO * mysql::collation::find_by_name ( const char *  name)
inline

Find collation by its name.

Parameters
name'\0'-terminated string of collation name (not normalized name is fine)
Returns
pointer to a collation object on success, nullptr if not found

◆ find_by_name() [2/2]

const CHARSET_INFO * mysql::collation::find_by_name ( const Name name)

Find collation by its name.

Parameters
nameCollation name
Returns
pointer to a collation object on success, nullptr if not found

◆ find_default_binary() [1/2]

const CHARSET_INFO * mysql::collation::find_default_binary ( const char *  cs_name)
inline

Find binary collation by its character set name.

Parameters
cs_name'\0'-terminated character set name (not normalized name is fine)
Returns
pointer to a collation object on success, nullptr if not found

◆ find_default_binary() [2/2]

const CHARSET_INFO * mysql::collation::find_default_binary ( const Name cs_name)

Find binary collation by its character set name.

Parameters
cs_nameCharacter set name
Returns
pointer to a collation object on success, nullptr if not found

◆ find_primary() [1/2]

const CHARSET_INFO * mysql::collation::find_primary ( const char *  cs_name)
inline

Find primary collation by its character set name.

Parameters
cs_name'\0'-terminated string of character set name (not normalized name is fine)
Returns
pointer to a collation object on success, nullptr if not found

◆ find_primary() [2/2]

const CHARSET_INFO * mysql::collation::find_primary ( Name  cs_name)

Find primary collation by its character set name.

Parameters
cs_nameCharacter set name
Returns
pointer to a collation object on success, nullptr if not found

◆ initialize()

void mysql::collation::initialize ( const char *  charset_dir = nullptr,
MY_CHARSET_LOADER loader = nullptr 
)

Initialize character set/collation library.

Note
initialize() after shutdown() is UB (untested).
Parameters
charset_dirOptional "/\0"-terminated path to the directory containing Index.xml
loaderOptional user-specified hooks to the character set/collation parser/initializer.

◆ shutdown()

void mysql::collation::shutdown ( )

Shutdown character set/collation library.

This call is mainly necessary in ASAN etc. builds.

Note
initialize() after shutdown() is UB (untested).