Example #1
0
        public static LocFolder Analyze(LocAnalyzerSettings settings)
        {
            var csvDelimiter = ';';
            var rootFolder   = new LocFolder {
                Name = "Root", FullPath = settings.RootPath
            };
            var arguments = new List <string>();

            arguments.Add("--csv");
            arguments.Add($"--csv-delimiter={csvDelimiter}");
            arguments.Add("--by-file");
            arguments.Add("--quiet");
            bool hasOptionsFile = !string.IsNullOrWhiteSpace(settings.OptionsFile) && File.Exists(settings.OptionsFile);

            if (hasOptionsFile)
            {
                arguments.Add($@"--config=""{settings.OptionsFile}""");
            }
            bool hasIgnoredFile = !string.IsNullOrWhiteSpace(settings.IgnoredFile);

            if (hasIgnoredFile)
            {
                arguments.Add($@"--ignored=""{settings.IgnoredFile}""");
            }
            arguments.Add($@"""{settings.RootPath}""");
            ExecuteCmd(settings.ClocExePath, settings.RootPath, string.Join(" ", arguments), out var lines);
            foreach (var line in lines[2..^ 1])
Example #2
0
        public LocFolder GetOrCreateFolder(string folderName)
        {
            var desiredFolder = Folders.Find(x => x.Name == folderName);

            if (desiredFolder == null)
            {
                desiredFolder = new LocFolder {
                    Name = folderName, FullPath = Path.Combine(FullPath, folderName)
                };
                Folders.Add(desiredFolder);
            }
            return(desiredFolder);
        }