LibreOffice Module i18nutil (master) 1
Macros | Functions
unicode.cxx File Reference
#include <com/sun/star/i18n/UnicodeType.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <i18nlangtag/languagetag.hxx>
#include <i18nlangtag/languagetagicu.hxx>
#include <i18nutil/unicode.hxx>
#include <sal/log.hxx>
#include <unicode/numfmt.h>
#include "unicode_data.h"
#include <rtl/character.hxx>
#include <o3tl/string_view.hxx>
#include <memory>
Include dependency graph for unicode.cxx:

Go to the source code of this file.

Macros

#define bit(name)   (1U << name)
 
#define UPPERMASK   bit(UnicodeType::UPPERCASE_LETTER)
 
#define LOWERMASK   bit(UnicodeType::LOWERCASE_LETTER)
 
#define TITLEMASK   bit(UnicodeType::TITLECASE_LETTER)
 
#define ALPHAMASK
 
#define SPACEMASK
 
#define CONTROLMASK
 
#define IsType(func, mask)
 
#define CONTROLSPACE
 

Functions

template<class L , typename T >
static T getScriptType (const sal_Unicode ch, const L *typeList, T unknownType)
 
 IsType (unicode::isControl, CONTROLMASK) IsType(unicode
 

Macro Definition Documentation

◆ ALPHAMASK

#define ALPHAMASK
Value:
bit(UnicodeType::MODIFIER_LETTER)|\
bit(UnicodeType::OTHER_LETTER)
#define TITLEMASK
Definition: unicode.cxx:105
#define LOWERMASK
Definition: unicode.cxx:103
#define UPPERMASK
Definition: unicode.cxx:101

Definition at line 107 of file unicode.cxx.

◆ bit

#define bit (   name)    (1U << name)

Definition at line 99 of file unicode.cxx.

◆ CONTROLMASK

#define CONTROLMASK
Value:
bit(UnicodeType::CONTROL)|\
bit(UnicodeType::FORMAT)|\
bit(UnicodeType::LINE_SEPARATOR)|\
bit(UnicodeType::PARAGRAPH_SEPARATOR)
#define bit(name)
Definition: unicode.cxx:99

Definition at line 115 of file unicode.cxx.

◆ CONTROLSPACE

#define CONTROLSPACE
Value:
bit(0x09)|bit(0x0a)|bit(0x0b)|bit(0x0c)|bit(0x0d)|\
bit(0x1c)|bit(0x1d)|bit(0x1e)|bit(0x1f)

◆ IsType

#define IsType (   func,
  mask 
)
Value:
bool func( const sal_Unicode ch) {\
return (bit(getUnicodeType(ch)) & (mask)) != 0;\
}
sal_uInt16 sal_Unicode

Definition at line 120 of file unicode.cxx.

◆ LOWERMASK

#define LOWERMASK   bit(UnicodeType::LOWERCASE_LETTER)

Definition at line 103 of file unicode.cxx.

◆ SPACEMASK

#define SPACEMASK
Value:
bit(UnicodeType::SPACE_SEPARATOR)|\
bit(UnicodeType::LINE_SEPARATOR)|\
bit(UnicodeType::PARAGRAPH_SEPARATOR)

Definition at line 111 of file unicode.cxx.

◆ TITLEMASK

#define TITLEMASK   bit(UnicodeType::TITLECASE_LETTER)

Definition at line 105 of file unicode.cxx.

◆ UPPERMASK

#define UPPERMASK   bit(UnicodeType::UPPERCASE_LETTER)

Definition at line 101 of file unicode.cxx.

Function Documentation

◆ getScriptType()

template<class L , typename T >
static T getScriptType ( const sal_Unicode  ch,
const L *  typeList,
unknownType 
)
static

◆ IsType()

IsType ( unicode::isControl  ,
CONTROLMASK   
)

Definition at line 125 of file unicode.cxx.

References bit, ch, CONTROLSPACE, and unicode::isSpace().