Beispiel #1
0
        public static LocStat ErstelleLoCStat(string Dateiname, string[] Zeilen)
        {
            var regExp = new System.Text.RegularExpressions.Regex(@"^\s+$|^\s*\/\/", System.Text.RegularExpressions.RegexOptions.Multiline);

            var locStat = new LocStat()
            {
                Filename = Dateiname, TotalLines = Zeilen.Length
            };
            var matches = regExp.Matches(string.Join("\r\n", Zeilen));

            locStat.LinesOfCode = locStat.TotalLines - matches.Count;

            return(locStat);
        }
 internal void ShowLocStat(LocStat currentLoc)
 {
     totalSum += currentLoc.TotalLines;
     LocSum   += currentLoc.LinesOfCode;
     Console.WriteLine($"{currentLoc.Filename}\t->{currentLoc.TotalLines}\t->{currentLoc.LinesOfCode}");
 }