System.Globalization.CharUnicodeInfo.InternalGetDigitValues C# (CSharp) Method

InternalGetDigitValues() static private method

static private InternalGetDigitValues ( int ch ) : DigitValues*
ch int
return DigitValues*
        internal unsafe static DigitValues* InternalGetDigitValues(int ch) {
            BCLDebug.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range.");
            // Get the level 2 item from the highest 12 bit (8 - 19) of ch.
            ushort index = m_pNumericLevel1Index[ch >> 8];
            // Get the level 2 WORD offset from the 4 - 7 bit of ch.  This provides the base offset of the level 3 table.
            // The offset is referred to an float item in m_pNumericFloatData.
            // Note that & has the lower precedence than addition, so don't forget the parathesis.
            index = m_pNumericLevel1Index[index + ((ch >> 4) & 0x000f)];
            byte* pBytePtr = (byte*)&(m_pNumericLevel1Index[index]);
            // Get the result from the 0 -3 bit of ch.
            return &(m_pDigitValues[pBytePtr[(ch & 0x000f)]]);
        }

Usage Example

Example #1
0
 internal static unsafe sbyte InternalGetDigitValue(int ch)
 {
     return(CharUnicodeInfo.InternalGetDigitValues(ch)->digit);
 }
All Usage Examples Of System.Globalization.CharUnicodeInfo::InternalGetDigitValues