예제 #1
0
                public static bool TryParseUInt64(ReadOnlySpan <char> text, out ulong value)
                {
                    int consumed;
                    var byteSpan = text.Cast <char, byte>();

                    return(PrimitiveParser.TryParseUInt64(byteSpan, out value, out consumed, EncodingData.InvariantUtf16, 'X'));
                }
예제 #2
0
                public unsafe static bool TryParseUInt64(char *text, int length, out ulong value)
                {
                    int consumed;
                    var span = new ReadOnlySpan <byte>(text, length * sizeof(char));

                    return(PrimitiveParser.TryParseUInt64(span, out value, out consumed, EncodingData.InvariantUtf16, 'X'));
                }
                public unsafe static bool TryParseInt32(byte *text, int length, out int value)
                {
                    int consumed;
                    var span = new ReadOnlySpan <byte>(text, length);

                    return(PrimitiveParser.TryParseInt32(span, out value, out consumed, EncodingData.InvariantUtf8, 'X'));
                }
예제 #4
0
                public static bool TryParseUInt64(ReadOnlySpan <char> text, out ulong value, out int charactersConsumed)
                {
                    var  byteSpan = text.Cast <char, byte>();
                    int  bytesConsumed;
                    bool result = PrimitiveParser.TryParseUInt64(byteSpan, out value, out bytesConsumed, EncodingData.InvariantUtf16, 'X');

                    charactersConsumed = bytesConsumed / sizeof(char);
                    return(result);
                }
예제 #5
0
                public unsafe static bool TryParseUInt64(char *text, int length, out ulong value, out int charactersConsumed)
                {
                    var  span = new ReadOnlySpan <byte>(text, length * sizeof(char));
                    int  bytesConsumed;
                    bool result = PrimitiveParser.TryParseUInt64(span, out value, out bytesConsumed, EncodingData.InvariantUtf16, 'X');

                    charactersConsumed = bytesConsumed / sizeof(char);
                    return(result);
                }
 public static bool TryParseInt32(ReadOnlySpan <byte> text, out int value, out int bytesConsumed)
 {
     return(PrimitiveParser.TryParseInt32(text, out value, out bytesConsumed, EncodingData.InvariantUtf8, 'X'));
 }
예제 #7
0
                public static bool TryParseSByte(ReadOnlySpan <byte> text, out sbyte value)
                {
                    int consumed;

                    return(PrimitiveParser.TryParseSByte(text, out value, out consumed, EncodingData.InvariantUtf8, 'X'));
                }
예제 #8
0
                public unsafe static bool TryParseSByte(byte *text, int length, out sbyte value, out int bytesConsumed)
                {
                    var span = new ReadOnlySpan <byte>(text, length);

                    return(PrimitiveParser.TryParseSByte(span, out value, out bytesConsumed, EncodingData.InvariantUtf8, 'X'));
                }
            public static bool TryParseUInt32(ReadOnlySpan <byte> text, out uint value)
            {
                int consumed;

                return(PrimitiveParser.TryParseUInt32(text, out value, out consumed, EncodingData.InvariantUtf8));
            }