xapian-core  2.1.0
Enumerations | Functions
Xapian::Unicode::Internal Namespace Reference

Enumerations

enum  { INFO_TOLOWER_MASK = 0x40 , INFO_TOUPPER_MASK = 0x80 }
 

Functions

int get_character_info (unsigned ch) noexcept
 Get information about a Unicode codepoint. More...
 
category get_category (int info)
 
int get_delta (int info)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
private

Bit-masks for case conversion.

If the respective bit is set in the return value of get_character_info() then the delta value also contained in that return values needs adding/subtracting to convert to lower/upper case.

Enumerator
INFO_TOLOWER_MASK 
INFO_TOUPPER_MASK 

Definition at line 278 of file unicode.h.

Function Documentation

◆ get_category()

category Xapian::Unicode::Internal::get_category ( int  info)
inlineprivate

◆ get_character_info()

int Xapian::Unicode::Internal::get_character_info ( unsigned  ch)
privatenoexcept

Get information about a Unicode codepoint.

Extract the information about a character from the Unicode character tables.

Characters outside of the Unicode range (i.e. ch >= 0x110000) are treated as UNASSIGNED with no case variants.

The bottom 5 bits of the returned value are the category code.

The top 24 bits give a signed delta to apply for case changes.

If bit INFO_LOWER_MASK set, add delta to convert to lower case.

If bit INFO_UPPER_MASK set, subtract delta to convert to upper case.

Definition at line 5697 of file unicode-data.cc.

References char_info, p, page, page_map, PAGE_SIZE_BITS, rare, and Xapian::Unicode::UNASSIGNED.

Referenced by Xapian::Unicode::get_category(), Xapian::Unicode::tolower(), and Xapian::Unicode::toupper().

◆ get_delta()

int Xapian::Unicode::Internal::get_delta ( int  info)
inlineprivate

Extract the delta to use for case conversion of a character from its info.

Definition at line 290 of file unicode.h.

Referenced by Xapian::Unicode::tolower(), and Xapian::Unicode::toupper().