60 Boole CheckAsFollowingBytes(
Int32 HowMany,
const char* FirstChar)
62 for(
Int32 Count = 1; HowMany>Count; Count++)
74 for(
int Counter=31; Counter>=0; Counter--)
76 if ( ((Counter+1)%8)==0 && Counter!=31)
78 if ( (1<<Counter) & IntToPrint )
89 if( (*CurrentCharacter &
High1Bit) == 0)
92 char Results = *CurrentCharacter;
96 for(
Int32 Counter=2; Counter<7; Counter++)
100 if( CheckAsFollowingBytes(Counter-1, CurrentCharacter) )
104 for(
Int32 Remains = 1; Remains<Counter; Remains++)
105 { Results |= (CurrentCharacter[Remains] &
Low6Bit) << (6*(Counter-Remains-1)); }
129 char Ascii = (char)ByteSequence;
130 Destination[0]=Ascii;
145 char* Bytes = (
char*)&Results;
146 Destination[0]=Bytes[1];
147 Destination[1]=Bytes[0];
161 char* Bytes = (
char*)&Results;
162 Destination[0]=Bytes[2];
163 Destination[1]=Bytes[1];
164 Destination[2]=Bytes[0];
179 char* Bytes = (
char*)&Results;
180 Destination[0]=Bytes[3];
181 Destination[1]=Bytes[2];
182 Destination[2]=Bytes[1];
183 Destination[3]=Bytes[0];
int32_t Int32
An 32-bit integer.
This contains simple tools for indexing with UTF8 characters swiftly.
const UInt8 High1Bit
1xxxxxxx - Is used compared against high 2 bits to determine if in middle of byte ...
const Int32 UTF8ByteRange3Max
The maximum Unicode codepoint that can fit into 3 UTF8 bytes. Equal to 2^16-1.
bool Boole
Generally acts a single bit, true or false.
const UInt8 Low4Bit
xxxx1111
const UInt32 UTF8Null3ByteBase
This is the numerical representation 0 in a three UTF8 Sequence. Is equal to 11100000 10000000 100000...
const UInt8 Low6Bit
xx111111
String AsBitString(Int32 IntToPrint)
A helper function that produces a human readable sequence of ' ', '1' and '0' characters.
const UInt8 Low3Bit
xxxxx111
const UInt8 High2Bit
11xxxxxx
const UInt8 IterableLowBits[]
The index of this array corresponds to the amount of low bits that are set.
const UInt8 Low5Bit
xxx11111
const Int32 UTF8ByteRange2Max
The maximum Unicode codepoint that can fit into 2 UTF8 bytes. Equal to 2^11-1.
const UInt8 IterableHighBits[]
The index of this array corresponds to the amount of high bits that are set.
const UInt32 UTF8Null4ByteBase
This is the numerical representation 0 in a four UTF8 Sequence. Is equal to 11110000 10000000 1000000...
Int32 GetIntFromCharacter(Int32 &BytesUsed, const char *CurrentCharacter)
Get a number suitable for using in an index from a character string.
The bulk of the engine components go in this namspace.
const UInt32 UTF8Null2ByteBase
This is the numerical representation 0 in a two UTF8 Sequence. Is equal to 11000000 10000000...
const Int32 UTF8ByteRange4Max
The maximum Unicode codepoint that can fit into 4 UTF8 bytes. Equal to 2^21-1.
const Int32 UTF8ByteRange1Max
The maximum Unicode codepoint that can fit into a single UTF8 byte. Equal to 2^7-1.
std::string String
A datatype used to a series of characters.
Int32 GetCharacterFromInt(char *Destination, Int32 BytesUsable, Int32 ByteSequence)
Convert a number that represents any valid unicode value into its UTF8 representation.