UString  0.1.0
UTF-8 C++11 string library
Public Types | Public Member Functions | Static Public Member Functions | List of all members
UChar Class Reference

#include <UChar.h>

Public Types

enum  Category {
  MarkNonSpacing, MarkSpacingCombining, MarkEnclosing, NumberDecimalDigit,
  NumberLetter, NumberOther, SeparatorSpace, SeparatorLine,
  SeparatorParagraph, OtherControl, OtherFormat, OtherSurrogate,
  OtherPrivateUse, OtherNotAssigned, LetterUppercase, LetterLowercase,
  LetterTitlecase, LetterModifier, LetterOther, PunctuationConnector,
  PunctuationDash, PunctuationOpen, PunctuationClose, PunctuationInitialQuote,
  PunctuationFinalQuote, PunctuationOther, SymbolMath, SymbolCurrency,
  SymbolModifier, SymbolOther, CatInvalid
}
 
enum  Direction {
  DirL, DirR, DirEN, DirES,
  DirET, DirAN, DirCS, DirB,
  DirS, DirWS, DirON, DirLRE,
  DirLRO, DirAL, DirRLE, DirRLO,
  DirPDF, DirNSM, DirBN, DirLRI,
  DirRLI, DirFSI, DirPDI, DirInvalid
}
 
enum  Case {
  CaseNone, CaseUpper, CaseLower, CaseTitle,
  CaseInvalid
}
 
typedef std::uint32_t ValueType
 

Public Member Functions

 UChar () USTRING_NOEXCEPT
 
 UChar (ValueType codePoint) USTRING_NOEXCEPT
 
Category getCategory () const
 
Direction getDirection () const
 
Case getCase () const
 
UCharassign (UChar codePoint)
 
UCharoperator= (UChar codePoint)
 
const bool operator== (UChar codePoint) const
 
const bool operator== (int codePoint) const
 
const bool operator!= (UChar codePoint) const
 
UChar toUpper () const
 
UChar toLower () const
 
UChar toTitleCase () const
 
bool isUpper ()
 
bool isLower ()
 
bool isTitleCase ()
 
bool isSpace () const
 
bool isLetter () const
 
bool isControl () const
 
bool isSurrogate () const
 
bool isPunctuation () const
 
bool isSymbol () const
 
bool isLineBreak () const
 
bool isNumber () const
 
bool isNull () const
 
 operator ValueType ()
 

Static Public Member Functions

static Category getCategory (ValueType ch)
 
static Direction getDirection (ValueType ch)
 
static Case getCase (ValueType ch)
 
static UChar toUpper (ValueType codePoint)
 
static UChar toLower (ValueType codePoint)
 
static UChar toTitleCase (ValueType codePoint)
 
static bool isNull (ValueType codePoint)
 
static bool isSpace (ValueType codePoint)
 
static bool isLetter (ValueType codePoint)
 
static bool isControl (ValueType codePoint)
 
static bool isSurrogate (ValueType codePoint)
 
static bool isPunctuation (ValueType codePoint)
 
static bool isSymbol (ValueType codePoint)
 
static bool isLineBreak (ValueType codePoint)
 
static bool isNumber (ValueType codePoint)
 
static bool isUpper (ValueType codePoint)
 
static bool isLower (ValueType codePoint)
 
static bool isTitleCase (ValueType codePoint)
 

Detailed Description

UChar is used to represent a UTF-8 character

Member Enumeration Documentation

Unicode text case

Unicode categoiry types

Enumerator
MarkNonSpacing 

Mn.

MarkSpacingCombining 

Mc.

MarkEnclosing 

Me.

NumberDecimalDigit 

Nd.

NumberLetter 

Nl.

NumberOther 

No.

SeparatorSpace 

Zs.

SeparatorLine 

Zl.

SeparatorParagraph 

Zp.

OtherControl 

Cc.

OtherFormat 

Cf.

OtherSurrogate 

Cs.

OtherPrivateUse 

Co.

OtherNotAssigned 

Cn.

LetterUppercase 

Lu.

LetterLowercase 

Ll.

LetterTitlecase 

Lt.

LetterModifier 

Lm.

LetterOther 

Lo.

PunctuationConnector 

Pc.

PunctuationDash 

Pd.

PunctuationOpen 

Ps.

PunctuationClose 

Pe.

PunctuationInitialQuote 

Pi.

PunctuationFinalQuote 

Pf.

PunctuationOther 

Po.

SymbolMath 

Sm.

SymbolCurrency 

Sc.

SymbolModifier 

Sk.

SymbolOther 

So.

CatInvalid 

Internal.

Unicode text direction

Enumerator
DirL 

Left-to-Right.

DirR 

Right-to-Left.

DirEN 

European Number.

DirES 

European Number Separator.

DirET 

European Number Terminator.

DirAN 

Arabic Number.

DirCS 

Common Number Separator.

DirB 

Paragraph Separator.

DirS 

Segment Separator.

DirWS 

Whitespace.

DirON 

Other Neutrals.

DirLRE 

Left-to-Right Embedding.

DirLRO 

Left-to-Right Override.

DirAL 

Right-to-Left Arabic.

DirRLE 

Right-to-Left Embedding.

DirRLO 

Right-to-Left Override.

DirPDF 

Pop Directional Format.

DirNSM 

Non-Spacing Mark.

DirBN 

Boundary Neutral.

DirLRI 

Left-to-Right Isolate.

DirRLI 

Right-to-Left Isolate.

DirFSI 

First Strong Isolate.

DirPDI 

Pop Directional Isolate.

DirInvalid 

Internal.

Constructor & Destructor Documentation

UChar::UChar ( )

Create a character with a Null value

UChar::UChar ( ValueType  codePoint)

Create a character from the given code-point

Parameters
codePoinThe UTF-8 code-point

Member Function Documentation

UChar& UChar::assign ( UChar  codePoint)

Assign another UChar to this one

Returns
A reference to this object
static Case UChar::getCase ( ValueType  ch)
static

Get the unicode Case of a given code-point

Parameters
chThe code-point
Returns
The unicode Case
Case UChar::getCase ( ) const
inline

Get the unicode Case of this char

Returns
The unicode Case
static Category UChar::getCategory ( ValueType  ch)
static

Get the unicode Category of a given code-point

Parameters
chThe code-point
Returns
The unicode Category
Category UChar::getCategory ( ) const
inline

Get the unicode Category of this char

Returns
The unicode Category
static Direction UChar::getDirection ( ValueType  ch)
static

Get the unicode Direction of a given code-point

Parameters
chThe code-point
Returns
The unicode Direction
Direction UChar::getDirection ( ) const
inline

Get the unicode Direction of this char

Returns
The unicode Direction
const bool UChar::operator!= ( UChar  codePoint) const
inline

Compare this character to another

Returns
True if it is not equal, False if it is equal
UChar& UChar::operator= ( UChar  codePoint)

Assign another UChar to this one

Returns
A reference to this object
const bool UChar::operator== ( UChar  codePoint) const
inline

Compare this character to another

Returns
True if it is equal, False if it isn't
const bool UChar::operator== ( int  codePoint) const
inline

Compare this character to another

Returns
True if it is equal, False if it isn't
static UChar UChar::toLower ( ValueType  codePoint)
static

Convert a code point to the lower case version

Parameters
codePointThe code-point to convert
Returns
A Uchar containing the lowercase version
UChar UChar::toLower ( ) const
inline

Return a new UChar containing a lowercase version of this

Returns
A Uchar containing the lowercase version
static UChar UChar::toTitleCase ( ValueType  codePoint)
static

Convert a code point to the title case version

Parameters
codePointThe code-point to convert
Returns
A Uchar containing the titlecase version
UChar UChar::toTitleCase ( ) const
inline

Return a new UChar containing a titlecase version of this

Returns
A Uchar containing the titlecase version
static UChar UChar::toUpper ( ValueType  codePoint)
static

Convert a code point to the upper case version

Parameters
codePointThe code-point to convert
Returns
A Uchar containing the uppercase version
UChar UChar::toUpper ( ) const
inline

Return a new UChar containing a uppercase version of this

Returns
A Uchar containing the uppercase version

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