public LinesOfCode(string path) { _language = GetLanguageFromFileExtention(path); initDictionaries(); GetFileInfo(path); ParseLines(); }
public LineCalculator(string filePath) { _specification = LanguageSpecificationFactory.GetLanguageSpecification(Path.GetExtension(filePath)); if (_specification == null || !File.Exists(filePath)) { throw new Exception("Некорректный файл."); } _lines = File.ReadLines(filePath); }
/// <summary> /// Create a <see cref="ModelConverter"/> for a custom <see cref="ILanguageSpecification"/>. /// </summary> public ModelConverter CreateConverterForTemplate(ILanguageSpecification language) { var converter = new ModelConverter(this, language); return(converter); }
public LinesOfCode(string path, ILanguageSpecification languageSpec) : this(path) { _language = languageSpec; }
public static InvalidOperationException DuplicateLanguageSpecification(ILanguageSpecification lang) => new InvalidOperationException($@"The language specification '{lang.Language} - V{lang.Version}' is already present.");
/// <summary> /// The amount of <see cref="Models"/> found in the given <see cref="Assembly"/>. /// </summary> public ModelConverter(ConversionKernel kernel, ILanguageSpecification language) { Language = language; _kernel = kernel; }
/// <summary> /// The amount of <see cref="Models"/> found in the given <see cref="Assembly"/>. /// </summary> public ModelConverter(Converter converter, ILanguageSpecification language) { Language = language; _converter = converter; }