Microsoft.CodeAnalysis.Sarif.Converters.CppCheckError.ParseLocationsSubtree C# (CSharp) Method

ParseLocationsSubtree() private static method

private static ParseLocationsSubtree ( XmlReader reader, CppCheckStrings strings ) : ImmutableArray
reader System.Xml.XmlReader
strings CppCheckStrings
return ImmutableArray
        private static ImmutableArray<CppCheckLocation> ParseLocationsSubtree(XmlReader reader, CppCheckStrings strings)
        {
            var locationBuilder = ImmutableArray.CreateBuilder<CppCheckLocation>();

            if (!reader.IsEmptyElement)
            {
                int startingDepth = reader.Depth;
                reader.Read();
                while (reader.Depth > startingDepth)
                {
                    Debug.Assert(reader.Depth == startingDepth + 1);
                    if (reader.NodeType == XmlNodeType.Whitespace)
                    {
                        reader.Read();
                    }
                    else
                    {
                        locationBuilder.Add(CppCheckLocation.Parse(reader, strings));
                    }
                }
            }

            ImmutableArray<CppCheckLocation> locations = locationBuilder.ToImmutable();
            return locations;
        }