Spinning Topp Logo BlackTopp Studios
inc
Namespaces | Functions | Variables
unicode.h File Reference

This contains simple tools for indexing with UTF8 characters swiftly. More...

#include "datatypes.h"
#include <iostream>
+ Include dependency graph for unicode.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Mezzanine
 The bulk of the engine components go in this namspace.
 
 Mezzanine::Unicode
 A dumping ground for any feature that only relates to unicode work.
 

Functions

String Mezzanine::Unicode::AsBitString (Int32 IntToPrint)
 A helper function that produces a human readable sequence of ' ', '1' and '0' characters. More...
 
Int32 Mezzanine::Unicode::GetCharacterFromInt (char *Destination, Int32 BytesUsable, Int32 ByteSequence)
 Convert a number that represents any valid unicode value into its UTF8 representation. More...
 
Int32 Mezzanine::Unicode::GetIntFromCharacter (Int32 &BytesUsed, const char *CurrentCharacter)
 Get a number suitable for using in an index from a character string. More...
 

Variables

const UInt8 Mezzanine::Unicode::High1Bit = (1<<7)
 1xxxxxxx - Is used compared against high 2 bits to determine if in middle of byte
 
const UInt32 Mezzanine::Unicode::High1bytes = 0xFF000000
 The Highest byte of an integer on this system.
 
const UInt8 Mezzanine::Unicode::High2Bit = High1Bit | (1<<6)
 11xxxxxx
 
const UInt32 Mezzanine::Unicode::High2bytes = 0xFFFF0000
 The Highest 2 bytes of an integer on this system.
 
const UInt8 Mezzanine::Unicode::High3Bit = High2Bit | (1<<5)
 111xxxxx
 
const UInt32 Mezzanine::Unicode::High3bytes = 0xFFFFFF00
 The Highest 3 bytes of an integer on this system.
 
const UInt8 Mezzanine::Unicode::High4Bit = High3Bit | (1<<4)
 1111xxxx
 
const UInt8 Mezzanine::Unicode::High5Bit = High4Bit | (1<<3)
 11111xxx
 
const UInt8 Mezzanine::Unicode::High6Bit = High5Bit | (1<<2)
 111111xx
 
const UInt8 Mezzanine::Unicode::High7Bit = High6Bit | (1<<1)
 1111111x
 
const UInt8 Mezzanine::Unicode::High8Bit = High7Bit | 1
 11111111
 
const UInt8 Mezzanine::Unicode::IterableHighBits [] = {0, High1Bit, High2Bit, High3Bit, High4Bit, High5Bit, High6Bit, High7Bit, High8Bit}
 The index of this array corresponds to the amount of high bits that are set.
 
const UInt8 Mezzanine::Unicode::IterableLowBits [] = {0, Low1Bit, Low2Bit, Low3Bit, Low4Bit, Low5Bit, Low6Bit, Low7Bit, Low8Bit}
 The index of this array corresponds to the amount of low bits that are set.
 
const UInt8 Mezzanine::Unicode::Low1Bit = (1)
 xxxxxxx1
 
const UInt8 Mezzanine::Unicode::Low2Bit = Low1Bit | (1<<1)
 xxxxxx11
 
const UInt8 Mezzanine::Unicode::Low3Bit = Low2Bit | (1<<2)
 xxxxx111
 
const UInt8 Mezzanine::Unicode::Low4Bit = Low3Bit | (1<<3)
 xxxx1111
 
const UInt8 Mezzanine::Unicode::Low5Bit = Low4Bit | (1<<4)
 xxx11111
 
const UInt8 Mezzanine::Unicode::Low6Bit = Low5Bit | (1<<5)
 xx111111
 
const UInt8 Mezzanine::Unicode::Low7Bit = Low6Bit | (1<<6)
 x1111111
 
const UInt8 Mezzanine::Unicode::Low8Bit = Low7Bit | (1<<7)
 11111111
 
const Int32 Mezzanine::Unicode::UTF8ByteRange1Max = 127
 The maximum Unicode codepoint that can fit into a single UTF8 byte. Equal to 2^7-1.
 
const Int32 Mezzanine::Unicode::UTF8ByteRange2Max = 4097
 The maximum Unicode codepoint that can fit into 2 UTF8 bytes. Equal to 2^11-1.
 
const Int32 Mezzanine::Unicode::UTF8ByteRange3Max = 65535
 The maximum Unicode codepoint that can fit into 3 UTF8 bytes. Equal to 2^16-1.
 
const Int32 Mezzanine::Unicode::UTF8ByteRange4Max = 2097151
 The maximum Unicode codepoint that can fit into 4 UTF8 bytes. Equal to 2^21-1.
 
const UInt32 Mezzanine::Unicode::UTF8Null2ByteBase = 49280
 This is the numerical representation 0 in a two UTF8 Sequence. Is equal to 11000000 10000000.
 
const UInt32 Mezzanine::Unicode::UTF8Null3ByteBase = 14712960
 This is the numerical representation 0 in a three UTF8 Sequence. Is equal to 11100000 10000000 10000000.
 
const UInt32 Mezzanine::Unicode::UTF8Null4ByteBase = 4034953344
 This is the numerical representation 0 in a four UTF8 Sequence. Is equal to 11110000 10000000 10000000 10000000.
 

Detailed Description

This contains simple tools for indexing with UTF8 characters swiftly.

Definition in file unicode.h.