HexNumberToUInt64() private static method

private static HexNumberToUInt64 ( NumberBuffer &number, UInt64 &value ) : Boolean
number NumberBuffer
value UInt64
return Boolean
Ejemplo n.º 1
0
        private static bool HexNumberToInt64(ref Number.NumberBuffer number, ref long value)
        {
            ulong num1 = 0;
            int   num2 = Number.HexNumberToUInt64(ref number, ref num1) ? 1 : 0;

            value = (long)num1;
            return(num2 != 0);
        }
Ejemplo n.º 2
0
        // Token: 0x06001096 RID: 4246 RVA: 0x000316C8 File Offset: 0x0002F8C8
        private static bool HexNumberToInt64(ref Number.NumberBuffer number, ref long value)
        {
            ulong num    = 0UL;
            bool  result = Number.HexNumberToUInt64(ref number, ref num);

            value = (long)num;
            return(result);
        }
Ejemplo n.º 3
0
        internal static unsafe ulong ParseUInt64(string value, NumberStyles options, NumberFormatInfo numfmt)
        {
            byte *stackBuffer = stackalloc byte[Number.NumberBuffer.NumberBufferBytes];

            Number.NumberBuffer number = new Number.NumberBuffer(stackBuffer);
            ulong num = 0;

            Number.StringToNumber(value, options, ref number, numfmt, false);
            if ((options & NumberStyles.AllowHexSpecifier) != NumberStyles.None)
            {
                if (!Number.HexNumberToUInt64(ref number, ref num))
                {
                    throw new OverflowException(Environment.GetResourceString("Overflow_UInt64"));
                }
            }
            else if (!Number.NumberToUInt64(ref number, ref num))
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt64"));
            }
            return(num);
        }
Ejemplo n.º 4
0
        internal static unsafe bool TryParseUInt64(string s, NumberStyles style, NumberFormatInfo info, out ulong result)
        {
            byte *stackBuffer = stackalloc byte[Number.NumberBuffer.NumberBufferBytes];

            Number.NumberBuffer number = new Number.NumberBuffer(stackBuffer);
            result = 0UL;
            if (!Number.TryStringToNumber(s, style, ref number, info, false))
            {
                return(false);
            }
            if ((style & NumberStyles.AllowHexSpecifier) != NumberStyles.None)
            {
                if (!Number.HexNumberToUInt64(ref number, ref result))
                {
                    return(false);
                }
            }
            else if (!Number.NumberToUInt64(ref number, ref result))
            {
                return(false);
            }
            return(true);
        }