mirror of
https://github.com/chylex/Code-Statistics.git
synced 2025-07-26 04:59:07 +02:00
Rework abstract handlers into interfaces
This commit is contained in:
parent
ab62b6e676
commit
f27f4aed5e
CodeStatistics
@ -74,12 +74,14 @@
|
||||
<Compile Include="Handlers\Objects\Java\Tabs\JavaNamesTab.cs" />
|
||||
<Compile Include="Handlers\Objects\Java\Tabs\JavaPrimitivesTab.cs" />
|
||||
<Compile Include="Handlers\Objects\Java\Tabs\JavaSyntaxTab.cs" />
|
||||
<Compile Include="Handling\IFolderHandler.cs" />
|
||||
<Compile Include="Handling\General\AssetHandler.cs" />
|
||||
<Compile Include="Handling\General\UnknownHandler.cs" />
|
||||
<Compile Include="Handling\Languages\JavaHandler.cs" />
|
||||
<Compile Include="Handling\ParseUtils.cs" />
|
||||
<Compile Include="Handlers\ProjectAnalyzer.cs" />
|
||||
<Compile Include="Handling\FileHandler.cs" />
|
||||
<Compile Include="Handling\IFileHandler.cs" />
|
||||
<Compile Include="Handling\HandlerList.cs" />
|
||||
<Compile Include="Handling\Variables.cs" />
|
||||
<Compile Include="Input\File.cs" />
|
||||
<Compile Include="Input\FileSearch.cs" />
|
||||
|
@ -1,13 +0,0 @@
|
||||
using CodeStatistics.Input;
|
||||
|
||||
namespace CodeStatistics.Handling{
|
||||
abstract class FileHandler{
|
||||
public abstract int Weight { get; }
|
||||
|
||||
public bool IsFileValid(File file){
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract void Process(File file, Variables.Root variables);
|
||||
}
|
||||
}
|
16
CodeStatistics/Handling/HandlerList.cs
Normal file
16
CodeStatistics/Handling/HandlerList.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using CodeStatistics.Handling.General;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CodeStatistics.Handling{
|
||||
class HandlerList{
|
||||
public interface IWeightedEntry{
|
||||
int Weight { get; }
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string,IFileHandler> fileHandlers = new Dictionary<string,IFileHandler>(8);
|
||||
private static readonly List<IFolderHandler> folderHandlers = new List<IFolderHandler>(1);
|
||||
|
||||
static HandlerList(){
|
||||
}
|
||||
}
|
||||
}
|
8
CodeStatistics/Handling/IFileHandler.cs
Normal file
8
CodeStatistics/Handling/IFileHandler.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using CodeStatistics.Input;
|
||||
|
||||
namespace CodeStatistics.Handling{
|
||||
interface IFileHandler : HandlerList.IWeightedEntry{
|
||||
bool IsFileValid(File file);
|
||||
void Process(File file, Variables.Root variables);
|
||||
}
|
||||
}
|
5
CodeStatistics/Handling/IFolderHandler.cs
Normal file
5
CodeStatistics/Handling/IFolderHandler.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace CodeStatistics.Handling{
|
||||
interface IFolderHandler : HandlerList.IWeightedEntry{
|
||||
void Process(string folder, Variables.Root variables);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user