コード例 #1
0
 public LinesOfCode(string path)
 {
     _language = GetLanguageFromFileExtention(path);
     initDictionaries();
     GetFileInfo(path);
     ParseLines();
 }
コード例 #2
0
        public LineCalculator(string filePath)
        {
            _specification = LanguageSpecificationFactory.GetLanguageSpecification(Path.GetExtension(filePath));

            if (_specification == null || !File.Exists(filePath))
            {
                throw new Exception("Некорректный файл.");
            }

            _lines = File.ReadLines(filePath);
        }
コード例 #3
0
ファイル: ConversionKernel.cs プロジェクト: villawad/Sushi
        /// <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);
        }
コード例 #4
0
 public LinesOfCode(string path, ILanguageSpecification languageSpec) : this(path)
 {
     _language = languageSpec;
 }
コード例 #5
0
 public static InvalidOperationException DuplicateLanguageSpecification(ILanguageSpecification lang)
 => new InvalidOperationException($@"The language specification '{lang.Language} - V{lang.Version}' is already present.");
コード例 #6
0
ファイル: ModelConverter.cs プロジェクト: villawad/Sushi
 /// <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;
 }
コード例 #7
0
ファイル: ModelConverter.cs プロジェクト: jvorssel/Sushi
 /// <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;
 }