Ejemplo n.º 1
0
        private static ImmutableArray <CppCheckLocation> ParseLocationsSubtree(XmlReader reader, CppCheckStrings strings)
        {
            ImmutableArray <CppCheckLocation> .Builder 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);
        }
Ejemplo n.º 2
0
        private static ImmutableArray <CppCheckLocation> ParseLocationsSubtree(XmlReader reader, CppCheckStrings strings)
        {
            ImmutableArray <CppCheckLocation> .Builder locationBuilder = ImmutableArray.CreateBuilder <CppCheckLocation>();

            if (!reader.IsEmptyElement)
            {
                int startingDepth = reader.Depth;
                reader.Read();
                while (reader.Depth > startingDepth)
                {
                    if (reader.NodeType == XmlNodeType.Whitespace)
                    {
                        reader.Read();
                    }
                    else
                    {
                        if (!reader.LocalName.Equals("location", StringComparison.OrdinalIgnoreCase))
                        {
                            reader.Read();
                            continue;
                        }

                        locationBuilder.Add(CppCheckLocation.Parse(reader, strings));
                    }
                }
            }

            return(locationBuilder.ToImmutable());
        }
Ejemplo n.º 3
0
 private static CppCheckLocation Parse(XmlReader xml)
 {
     return(CppCheckLocation.Parse(xml, new CppCheckStrings(xml.NameTable)));
 }