ParseUInt32() static private method

static private ParseUInt32 ( String value, NumberStyles options, NumberFormatInfo numfmt ) : UInt32
value String
options NumberStyles
numfmt NumberFormatInfo
return UInt32
示例#1
0
 public static uint Parse(string s)
 {
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo));
 }
示例#2
0
 public static uint Parse(string s, IFormatProvider?provider)
 {
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider)));
 }
示例#3
0
 public static uint Parse(string s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s, style, NumberFormatInfo.CurrentInfo));
 }
示例#4
0
 public static uint Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     if (s == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
     }
     return(Number.ParseUInt32(s.AsReadOnlySpan(), style, NumberFormatInfo.GetInstance(provider)));
 }
示例#5
0
        public static ushort Parse(String s, NumberStyles style)
        {
            NumberFormatInfo.ValidateParseStyle(style);
            uint i = Number.ParseUInt32(s, style);

            if (i > MaxValue)
            {
                throw new OverflowException("Overflow_UInt16");
            }
            return((ushort)i);
        }
示例#6
0
 public unsafe static UIntPtr Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyle(style);
     if (sizeof(UIntPtr) == 4)
     {
         return(Number.ParseUInt32(s, style));
     }
     else
     {
         return(Number.ParseUInt64(s, style));
     }
 }
示例#7
0
        public static ushort Parse(String s, NumberStyles style, IFormatProvider provider)
        {
            NumberFormatInfo info = NumberFormatInfo.GetInstance(provider);

            NumberFormatInfo.ValidateParseStyle(style);
            uint i = Number.ParseUInt32(s, style, info);

            if (i > MaxValue)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)i);
        }
示例#8
0
        private static ushort Parse(String s, NumberStyles style, NumberFormatInfo info)
        {
            uint i = 0;

            try {
                i = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException e) {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), e);
            }

            if (i > MaxValue)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)i);
        }
        // Token: 0x060014EF RID: 5359 RVA: 0x0003DECC File Offset: 0x0003C0CC
        private static ushort Parse(string s, NumberStyles style, NumberFormatInfo info)
        {
            uint num = 0U;

            try
            {
                num = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException innerException)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), innerException);
            }
            if (num > 65535U)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)num);
        }
示例#10
0
        private static ushort Parse(string s, NumberStyles style, NumberFormatInfo info)
        {
            uint uint32;

            try
            {
                uint32 = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException ex)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), (Exception)ex);
            }
            if (uint32 > (uint)ushort.MaxValue)
            {
                throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
            }
            return((ushort)uint32);
        }
示例#11
0
文件: UInt16.cs 项目: wecing/coreclr
        private static ushort Parse(ReadOnlySpan <char> s, NumberStyles style, NumberFormatInfo info)
        {
            uint i = 0;

            try
            {
                i = Number.ParseUInt32(s, style, info);
            }
            catch (OverflowException e)
            {
                throw new OverflowException(SR.Overflow_UInt16, e);
            }

            if (i > MaxValue)
            {
                throw new OverflowException(SR.Overflow_UInt16);
            }
            return((ushort)i);
        }
示例#12
0
 public static uint Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt32(s, style, NumberFormatInfo.CurrentInfo));
 }
示例#13
0
 public static uint Parse(String s)
 {
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo));
 }
示例#14
0
 public static uint Parse(ReadOnlySpan <char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider?provider = null)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt32(s, style, NumberFormatInfo.GetInstance(provider)));
 }
示例#15
0
 public static uint Parse(String s, IFormatProvider provider)
 {
     return(Number.ParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider)));
 }
示例#16
0
 public static uint Parse(String s, NumberStyles style, IFormatProvider provider)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.ParseUInt32(s, style, NumberFormatInfo.GetInstance(provider)));
 }
示例#17
0
 public static UIntPtr Parse(String s, NumberStyles style)
 {
     NumberFormatInfo.ValidateParseStyle(style);
     return(Number.ParseUInt32(s, style));
 }