Summary

Class:System.Buffers.Text.ParserHelpers
Assembly:System.Memory
File(s):C:\GitHub\corefx\src\System.Memory\src\System\Buffers\Text\Utf8Parser\ParserHelpers.cs
Covered lines:22
Uncovered lines:0
Coverable lines:22
Total lines:55
Line coverage:100%

Metrics

MethodCyclomatic complexity NPath complexity Sequence coverage Branch coverage
IsDigit(...)10100100
.cctor()10100100

File(s)

C:\GitHub\corefx\src\System.Memory\src\System\Buffers\Text\Utf8Parser\ParserHelpers.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3// See the LICENSE file in the project root for more information.
 4
 5using System.Runtime.CompilerServices;
 6
 7namespace System.Buffers.Text
 8{
 9    internal static class ParserHelpers
 10    {
 11        public const int ByteOverflowLength = 3;
 12        public const int ByteOverflowLengthHex = 2;
 13        public const int UInt16OverflowLength = 5;
 14        public const int UInt16OverflowLengthHex = 4;
 15        public const int UInt32OverflowLength = 10;
 16        public const int UInt32OverflowLengthHex = 8;
 17        public const int UInt64OverflowLength = 20;
 18        public const int UInt64OverflowLengthHex = 16;
 19
 20        public const int SByteOverflowLength = 3;
 21        public const int SByteOverflowLengthHex = 2;
 22        public const int Int16OverflowLength = 5;
 23        public const int Int16OverflowLengthHex = 4;
 24        public const int Int32OverflowLength = 10;
 25        public const int Int32OverflowLengthHex = 8;
 26        public const int Int64OverflowLength = 19;
 27        public const int Int64OverflowLengthHex = 16;
 28
 129        public static readonly byte[] s_hexLookup =
 130        {
 131            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 132            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 133            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 134            0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,                       
 135            0xFF, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,                   
 136            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 137            0xFF, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,                   
 138            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 139            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 140            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 141            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 142            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 143            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 144            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 145            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,             
 146            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF              
 147        };
 48
 49        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 50        public static bool IsDigit(int i)
 151        {
 152            return (uint)(i - '0') <= ('9' - '0');
 153        }
 54    }
 55}

Methods/Properties

.cctor()
IsDigit(System.Int32)