diff --git a/CodeStatistics.sln b/CodeStatistics.sln index 2ef5965..deaf8e7 100644 --- a/CodeStatistics.sln +++ b/CodeStatistics.sln @@ -6,10 +6,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeStatistics", "CodeStati EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeStatisticsTests", "CodeStatisticsTests\CodeStatisticsTests.csproj", "{BD148062-5858-49E7-B11B-20FC6E7114DD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeStatisticsCore", "CodeStatisticsCore\CodeStatisticsCore.csproj", "{6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Mono|Any CPU = Mono|Any CPU + Release|Any CPU = Release|Any CPU Windows|Any CPU = Windows|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution @@ -17,12 +20,24 @@ Global {B1BC156C-AAA8-40EB-B90B-AEE950870D62}.Debug|Any CPU.Build.0 = Debug|Any CPU {B1BC156C-AAA8-40EB-B90B-AEE950870D62}.Mono|Any CPU.ActiveCfg = Mono|Any CPU {B1BC156C-AAA8-40EB-B90B-AEE950870D62}.Mono|Any CPU.Build.0 = Mono|Any CPU + {B1BC156C-AAA8-40EB-B90B-AEE950870D62}.Release|Any CPU.ActiveCfg = Windows|Any CPU + {B1BC156C-AAA8-40EB-B90B-AEE950870D62}.Release|Any CPU.Build.0 = Windows|Any CPU {B1BC156C-AAA8-40EB-B90B-AEE950870D62}.Windows|Any CPU.ActiveCfg = Windows|Any CPU {B1BC156C-AAA8-40EB-B90B-AEE950870D62}.Windows|Any CPU.Build.0 = Windows|Any CPU {BD148062-5858-49E7-B11B-20FC6E7114DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BD148062-5858-49E7-B11B-20FC6E7114DD}.Debug|Any CPU.Build.0 = Debug|Any CPU {BD148062-5858-49E7-B11B-20FC6E7114DD}.Mono|Any CPU.ActiveCfg = Mono|Any CPU + {BD148062-5858-49E7-B11B-20FC6E7114DD}.Release|Any CPU.ActiveCfg = Windows|Any CPU + {BD148062-5858-49E7-B11B-20FC6E7114DD}.Release|Any CPU.Build.0 = Windows|Any CPU {BD148062-5858-49E7-B11B-20FC6E7114DD}.Windows|Any CPU.ActiveCfg = Windows|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Mono|Any CPU.ActiveCfg = Release|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Mono|Any CPU.Build.0 = Release|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Release|Any CPU.Build.0 = Release|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Windows|Any CPU.ActiveCfg = Release|Any CPU + {6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}.Windows|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CodeStatistics/CodeStatistics.csproj b/CodeStatistics/CodeStatistics.csproj index 7451f74..68d8a4c 100644 --- a/CodeStatistics/CodeStatistics.csproj +++ b/CodeStatistics/CodeStatistics.csproj @@ -66,12 +66,6 @@ <Reference Include="WindowsBase" /> </ItemGroup> <ItemGroup> - <Compile Include="Collections\AnonymousDictionary.cs" /> - <Compile Include="Collections\BiDictionary.cs" /> - <Compile Include="Collections\CharacterRangeSet.cs" /> - <Compile Include="Collections\CounterDictionary.cs" /> - <Compile Include="Collections\EnumDictionary.cs" /> - <Compile Include="Collections\TopElementList.cs" /> <Compile Include="Data\Lang.cs" /> <Compile Include="Forms\AboutForm.cs"> <SubType>Form</SubType> @@ -79,7 +73,6 @@ <Compile Include="Forms\AboutForm.Designer.cs"> <DependentUpon>AboutForm.cs</DependentUpon> </Compile> - <Compile Include="Forms\FormUtils.cs" /> <Compile Include="Forms\GitHubForm.cs"> <SubType>Form</SubType> </Compile> @@ -92,12 +85,9 @@ <Compile Include="Forms\ProjectDebugForm.Designer.cs"> <DependentUpon>ProjectDebugForm.cs</DependentUpon> </Compile> - <Compile Include="Handling\General\AbstractFileHandler.cs" /> - <Compile Include="Handling\IFolderHandler.cs" /> <Compile Include="Handling\General\AssetHandler.cs" /> <Compile Include="Handling\General\FolderHandler.cs" /> <Compile Include="Handling\General\UnknownHandler.cs" /> - <Compile Include="Handling\Languages\AbstractLanguageFileHandler.cs" /> <Compile Include="Handling\Languages\JavaHandler.cs" /> <Compile Include="Handling\Languages\Java\Elements\Annotation.cs" /> <Compile Include="Handling\Languages\Java\Elements\Field.cs" /> @@ -117,20 +107,10 @@ <Compile Include="Handling\Languages\Java\JavaFileInfo.cs" /> <Compile Include="Handling\Languages\Java\Utils\JavaParseUtils.cs" /> <Compile Include="Handling\Languages\Java\JavaState.cs" /> - <Compile Include="Handling\Utils\CodeParser.cs" /> - <Compile Include="Handling\Utils\FileIntValue.cs" /> - <Compile Include="Handling\Utils\ParseUtils.cs" /> - <Compile Include="Handling\Utils\StringUtils.cs" /> - <Compile Include="Handling\IFileHandler.cs" /> <Compile Include="Handling\HandlerList.cs" /> <Compile Include="Handling\Project.cs" /> - <Compile Include="Handling\Utils\VariableUtils.cs" /> - <Compile Include="Handling\Variables.cs" /> - <Compile Include="Input\File.cs" /> <Compile Include="Input\FileSearch.cs" /> <Compile Include="Input\FileSearchData.cs" /> - <Compile Include="Input\IOEntry.cs" /> - <Compile Include="Input\IOUtils.cs" /> <Compile Include="Input\Methods\ArchiveExtraction.cs" /> <Compile Include="Input\Methods\DummyInputMethod.cs" /> <Compile Include="Input\Methods\GitHub.cs" /> @@ -205,6 +185,12 @@ <ItemGroup> <None Include="Resources\about.rtf" /> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\CodeStatisticsCore\CodeStatisticsCore.csproj"> + <Project>{6e9bf33e-c035-4a44-ae11-6c2cfb029c0b}</Project> + <Name>CodeStatisticsCore</Name> + </ProjectReference> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PostBuildEvent>if $(ConfigurationName) == Mono xbuild.bat /p:Configuration=Mono /p:PostBuildEvent= "$(SolutionPath)"</PostBuildEvent> diff --git a/CodeStatistics/Data/Lang.cs b/CodeStatistics/Data/Lang.cs index 965dbb6..b8daf31 100644 --- a/CodeStatistics/Data/Lang.cs +++ b/CodeStatistics/Data/Lang.cs @@ -23,9 +23,6 @@ namespace CodeStatistics.Data{ { "ErrorInvalidArgsFolderNotFound", "Folder not found: $1" }, { "ErrorInvalidArgsGitHub", "Invalid GitHub repository, correct format is <username/repo[/branch]>: $1" }, - { "ErrorArgumentEqualLargerOne", "Argument must be equal to or larger than 1." }, - { "ErrorArgumentArrayAtLeastOne", "Array must contain at least one element." }, - { "MenuProjectFromFolder", "Project From Folder" }, { "MenuProjectFromGitHub", "Project From GitHub" }, { "MenuProjectFromArchive", "Project From Archive" }, diff --git a/CodeStatistics/Forms/AboutForm.cs b/CodeStatistics/Forms/AboutForm.cs index a63076e..466a2c7 100644 --- a/CodeStatistics/Forms/AboutForm.cs +++ b/CodeStatistics/Forms/AboutForm.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System; namespace CodeStatistics.Forms{ - public sealed partial class AboutForm : Form{ + sealed partial class AboutForm : Form{ private static Dictionary<string,string> AboutFormData{ get{ return new Dictionary<string,string>{ diff --git a/CodeStatistics/Forms/GitHubForm.cs b/CodeStatistics/Forms/GitHubForm.cs index afad9f5..dc834e0 100644 --- a/CodeStatistics/Forms/GitHubForm.cs +++ b/CodeStatistics/Forms/GitHubForm.cs @@ -2,9 +2,10 @@ using CodeStatistics.Input.Methods; using System; using System.Windows.Forms; +using CodeStatisticsCore.Forms; namespace CodeStatistics.Forms{ - public sealed partial class GitHubForm : Form{ + sealed partial class GitHubForm : Form{ public GitHub GitHub { get; private set; } private readonly Timer timer = new Timer{ diff --git a/CodeStatistics/Forms/MainForm.cs b/CodeStatistics/Forms/MainForm.cs index 71e68d3..33c4852 100644 --- a/CodeStatistics/Forms/MainForm.cs +++ b/CodeStatistics/Forms/MainForm.cs @@ -6,10 +6,11 @@ using CodeStatistics.Input.Methods; using CodeStatistics.Input; using CodeStatistics.Input.Helpers; using System.Drawing; +using CodeStatisticsCore.Input; namespace CodeStatistics.Forms{ - public sealed partial class MainForm : Form{ - public IInputMethod InputMethod{ get; private set; } + sealed partial class MainForm : Form{ + public IInputMethod InputMethod { get; private set; } public MainForm(){ InitializeComponent(); diff --git a/CodeStatistics/Forms/ProjectDebugForm.cs b/CodeStatistics/Forms/ProjectDebugForm.cs index 7318bc9..fbdf497 100644 --- a/CodeStatistics/Forms/ProjectDebugForm.cs +++ b/CodeStatistics/Forms/ProjectDebugForm.cs @@ -1,16 +1,17 @@ using CodeStatistics.Handling; using System.Windows.Forms; -using CodeStatistics.Input; using System; using System.Runtime.InteropServices; -using CodeStatistics.Handling.Languages; using PathIO = System.IO.Path; using CodeStatistics.Data; using System.Diagnostics; using System.Collections.Generic; +using CodeStatisticsCore.Handling; +using CodeStatisticsCore.Handling.Files; +using CodeStatisticsCore.Input; namespace CodeStatistics.Forms{ - sealed partial class ProjectDebugForm : Form{ + partial class ProjectDebugForm : Form{ #if WINDOWS [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern IntPtr SendMessage(IntPtr handle, int message, IntPtr wParam, int[] lParam); diff --git a/CodeStatistics/Forms/ProjectLoadForm.cs b/CodeStatistics/Forms/ProjectLoadForm.cs index def95d7..d01ec8e 100644 --- a/CodeStatistics/Forms/ProjectLoadForm.cs +++ b/CodeStatistics/Forms/ProjectLoadForm.cs @@ -9,9 +9,11 @@ using System.Globalization; using CodeStatistics.Data; using CodeStatistics.Input.Methods; using System.IO; +using CodeStatisticsCore.Forms; +using CodeStatisticsCore.Handling; namespace CodeStatistics.Forms{ - public sealed partial class ProjectLoadForm : Form{ + sealed partial class ProjectLoadForm : Form{ private readonly IInputMethod inputMethod; private FileSearch search; private Project project; diff --git a/CodeStatistics/Handling/General/AssetHandler.cs b/CodeStatistics/Handling/General/AssetHandler.cs index 87660a8..6850b4d 100644 --- a/CodeStatistics/Handling/General/AssetHandler.cs +++ b/CodeStatistics/Handling/General/AssetHandler.cs @@ -1,6 +1,8 @@ -using CodeStatistics.Input; -using System; +using System; using System.Collections.Generic; +using CodeStatisticsCore.Handling; +using CodeStatisticsCore.Handling.Files; +using CodeStatisticsCore.Input; namespace CodeStatistics.Handling.General{ class AssetHandler : AbstractFileHandler{ diff --git a/CodeStatistics/Handling/General/FolderHandler.cs b/CodeStatistics/Handling/General/FolderHandler.cs index 996daa7..df7d54f 100644 --- a/CodeStatistics/Handling/General/FolderHandler.cs +++ b/CodeStatistics/Handling/General/FolderHandler.cs @@ -1,4 +1,6 @@ -namespace CodeStatistics.Handling.General{ +using CodeStatisticsCore.Handling; + +namespace CodeStatistics.Handling.General{ class FolderHandler : IFolderHandler{ public int Weight{ get { return 1; } diff --git a/CodeStatistics/Handling/General/UnknownHandler.cs b/CodeStatistics/Handling/General/UnknownHandler.cs index 629a97e..1eb38e7 100644 --- a/CodeStatistics/Handling/General/UnknownHandler.cs +++ b/CodeStatistics/Handling/General/UnknownHandler.cs @@ -1,4 +1,6 @@ -using CodeStatistics.Input; +using CodeStatisticsCore.Handling; +using CodeStatisticsCore.Handling.Files; +using CodeStatisticsCore.Input; namespace CodeStatistics.Handling.General{ class UnknownHandler : AbstractFileHandler{ diff --git a/CodeStatistics/Handling/HandlerList.cs b/CodeStatistics/Handling/HandlerList.cs index 6c67101..7c6787c 100644 --- a/CodeStatistics/Handling/HandlerList.cs +++ b/CodeStatistics/Handling/HandlerList.cs @@ -3,13 +3,11 @@ using CodeStatistics.Handling.Languages; using CodeStatistics.Input; using System.Collections.Generic; using System.Linq; +using CodeStatisticsCore.Handling; +using CodeStatisticsCore.Input; namespace CodeStatistics.Handling{ static class HandlerList{ - public interface IWeightedEntry{ - int Weight { get; } - } - private static readonly Dictionary<string,IFileHandler> FileHandlers = new Dictionary<string,IFileHandler>(8); private static readonly IFileHandler UnknownFileHandler; diff --git a/CodeStatistics/Handling/IFolderHandler.cs b/CodeStatistics/Handling/IFolderHandler.cs deleted file mode 100644 index e8968b0..0000000 --- a/CodeStatistics/Handling/IFolderHandler.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace CodeStatistics.Handling{ - interface IFolderHandler : HandlerList.IWeightedEntry{ - void Process(string folder, Variables.Root variables); - } -} diff --git a/CodeStatistics/Handling/Languages/Java/Elements/Modifiers.cs b/CodeStatistics/Handling/Languages/Java/Elements/Modifiers.cs index 69a2b3b..8b39050 100644 --- a/CodeStatistics/Handling/Languages/Java/Elements/Modifiers.cs +++ b/CodeStatistics/Handling/Languages/Java/Elements/Modifiers.cs @@ -1,6 +1,6 @@ using System; -using CodeStatistics.Collections; using System.Collections.Generic; +using CodeStatisticsCore.Collections; namespace CodeStatistics.Handling.Languages.Java.Elements{ [Flags] diff --git a/CodeStatistics/Handling/Languages/Java/Elements/Primitives.cs b/CodeStatistics/Handling/Languages/Java/Elements/Primitives.cs index 4455cf6..71a8b59 100644 --- a/CodeStatistics/Handling/Languages/Java/Elements/Primitives.cs +++ b/CodeStatistics/Handling/Languages/Java/Elements/Primitives.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using CodeStatistics.Collections; +using CodeStatisticsCore.Collections; namespace CodeStatistics.Handling.Languages.Java.Elements{ public enum Primitives{ diff --git a/CodeStatistics/Handling/Languages/Java/JavaCodeBlockParser.cs b/CodeStatistics/Handling/Languages/Java/JavaCodeBlockParser.cs index 674284a..f79d9f4 100644 --- a/CodeStatistics/Handling/Languages/Java/JavaCodeBlockParser.cs +++ b/CodeStatistics/Handling/Languages/Java/JavaCodeBlockParser.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using CodeStatistics.Handling.Languages.Java.Utils; -using CodeStatistics.Handling.Utils; using System.Linq; +using CodeStatisticsCore.Handling.Utils; namespace CodeStatistics.Handling.Languages.Java{ public class JavaCodeBlockParser : CodeParser{ diff --git a/CodeStatistics/Handling/Languages/Java/JavaCodeParser.cs b/CodeStatistics/Handling/Languages/Java/JavaCodeParser.cs index c3474d4..ee34722 100644 --- a/CodeStatistics/Handling/Languages/Java/JavaCodeParser.cs +++ b/CodeStatistics/Handling/Languages/Java/JavaCodeParser.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using CodeStatistics.Handling.Languages.Java.Elements; -using CodeStatistics.Handling.Utils; using System.Text; using CodeStatistics.Handling.Languages.Java.Utils; +using CodeStatisticsCore.Handling.Utils; namespace CodeStatistics.Handling.Languages.Java{ public class JavaCodeParser : CodeParser{ diff --git a/CodeStatistics/Handling/Languages/Java/JavaGlobalInfo.cs b/CodeStatistics/Handling/Languages/Java/JavaGlobalInfo.cs index 8df0eea..24bc54e 100644 --- a/CodeStatistics/Handling/Languages/Java/JavaGlobalInfo.cs +++ b/CodeStatistics/Handling/Languages/Java/JavaGlobalInfo.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -using CodeStatistics.Collections; using CodeStatistics.Handling.Languages.Java.Elements; +using CodeStatisticsCore.Collections; namespace CodeStatistics.Handling.Languages.Java{ class JavaGlobalInfo{ diff --git a/CodeStatistics/Handling/Languages/Java/JavaState.cs b/CodeStatistics/Handling/Languages/Java/JavaState.cs index 8f32819..cc34f33 100644 --- a/CodeStatistics/Handling/Languages/Java/JavaState.cs +++ b/CodeStatistics/Handling/Languages/Java/JavaState.cs @@ -1,7 +1,7 @@ -using CodeStatistics.Input; -using System.Collections.Generic; +using System.Collections.Generic; using CodeStatistics.Handling.Languages.Java.Elements; using CodeStatistics.Handling.Languages.Java.Utils; +using CodeStatisticsCore.Input; namespace CodeStatistics.Handling.Languages.Java{ class JavaState{ diff --git a/CodeStatistics/Handling/Languages/Java/Utils/JavaCharacters.cs b/CodeStatistics/Handling/Languages/Java/Utils/JavaCharacters.cs index cccd29d..0cee415 100644 --- a/CodeStatistics/Handling/Languages/Java/Utils/JavaCharacters.cs +++ b/CodeStatistics/Handling/Languages/Java/Utils/JavaCharacters.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using CodeStatistics.Collections; +using CodeStatisticsCore.Collections; namespace CodeStatistics.Handling.Languages.Java.Utils{ static class JavaCharacters{ diff --git a/CodeStatistics/Handling/Languages/JavaHandler.cs b/CodeStatistics/Handling/Languages/JavaHandler.cs index 6767d1e..99d28d1 100644 --- a/CodeStatistics/Handling/Languages/JavaHandler.cs +++ b/CodeStatistics/Handling/Languages/JavaHandler.cs @@ -1,14 +1,16 @@ using System; using System.IO; using System.Linq; -using CodeStatistics.Handling.Utils; -using File = CodeStatistics.Input.File; +using File = CodeStatisticsCore.Input.File; using CodeStatistics.Handling.Languages.Java; using CodeStatistics.Handling.Languages.Java.Utils; using Type = CodeStatistics.Handling.Languages.Java.Elements.Type; using CodeStatistics.Handling.Languages.Java.Elements; using System.Collections.Generic; using System.Windows.Forms; +using CodeStatisticsCore.Handling; +using CodeStatisticsCore.Handling.Utils; +using CodeStatisticsCore.Handling.Files; namespace CodeStatistics.Handling.Languages{ class JavaHandler : AbstractLanguageFileHandler{ diff --git a/CodeStatistics/Handling/Project.cs b/CodeStatistics/Handling/Project.cs index 1a16f83..524d0a1 100644 --- a/CodeStatistics/Handling/Project.cs +++ b/CodeStatistics/Handling/Project.cs @@ -4,6 +4,8 @@ using System.Threading.Tasks; using System.Linq; using System.Collections.Generic; using System; +using CodeStatisticsCore.Handling; +using CodeStatisticsCore.Input; // ReSharper disable AccessToModifiedClosure namespace CodeStatistics.Handling{ diff --git a/CodeStatistics/Input/FileSearch.cs b/CodeStatistics/Input/FileSearch.cs index 0e8d804..7f503b3 100644 --- a/CodeStatistics/Input/FileSearch.cs +++ b/CodeStatistics/Input/FileSearch.cs @@ -7,9 +7,10 @@ using FileIO = System.IO.File; using DirectoryIO = System.IO.Directory; using CodeStatistics.Input.Methods; using CodeStatistics.Forms; +using CodeStatisticsCore.Input; namespace CodeStatistics.Input{ - public class FileSearch : IInputMethod{ + class FileSearch : IInputMethod{ public delegate void RefreshEventHandler(int entriesFound); public delegate void FinishEventHandler(FileSearchData searchData); public delegate void FailureEventHandler(Exception ex); diff --git a/CodeStatistics/Input/FileSearchData.cs b/CodeStatistics/Input/FileSearchData.cs index 46ff650..3fb82f7 100644 --- a/CodeStatistics/Input/FileSearchData.cs +++ b/CodeStatistics/Input/FileSearchData.cs @@ -1,7 +1,8 @@ using System.Collections.Generic; +using CodeStatisticsCore.Input; namespace CodeStatistics.Input{ - public class FileSearchData{ + class FileSearchData{ private readonly HashSet<File> files = new HashSet<File>(); private readonly HashSet<string> folders = new HashSet<string>(); diff --git a/CodeStatistics/Input/Helpers/ZipArchive.cs b/CodeStatistics/Input/Helpers/ZipArchive.cs index 8b372f4..071fc11 100644 --- a/CodeStatistics/Input/Helpers/ZipArchive.cs +++ b/CodeStatistics/Input/Helpers/ZipArchive.cs @@ -5,6 +5,7 @@ using System.IO; using System.Reflection; using System.Threading; using System.Threading.Tasks; +using CodeStatisticsCore.Input; namespace CodeStatistics.Input.Helpers{ class ZipArchive : IDisposable{ diff --git a/CodeStatistics/Input/Methods/GitHub.cs b/CodeStatistics/Input/Methods/GitHub.cs index 299f679..2f1584d 100644 --- a/CodeStatistics/Input/Methods/GitHub.cs +++ b/CodeStatistics/Input/Methods/GitHub.cs @@ -11,9 +11,10 @@ using System.IO; using System.Text.RegularExpressions; using CodeStatistics.Data; using CodeStatistics.Input.Helpers; +using CodeStatisticsCore.Input; namespace CodeStatistics.Input.Methods{ - public class GitHub : IInputMethod, IDisposable{ + class GitHub : IInputMethod, IDisposable{ public const string DefaultBranch = "master"; private static readonly Regex RepositoryRegexCustom = new Regex(@"^([a-zA-Z0-9\-]+)/([\w\-\. ]+)(?:/([^\\[?^:~ ]+))?$",RegexOptions.CultureInvariant); diff --git a/CodeStatistics/Input/Methods/IInputMethod.cs b/CodeStatistics/Input/Methods/IInputMethod.cs index a50f618..c771bbb 100644 --- a/CodeStatistics/Input/Methods/IInputMethod.cs +++ b/CodeStatistics/Input/Methods/IInputMethod.cs @@ -2,7 +2,7 @@ using CodeStatistics.Forms; namespace CodeStatistics.Input.Methods{ - public interface IInputMethod{ + interface IInputMethod{ void BeginProcess(ProjectLoadForm.UpdateCallbacks callbacks); void CancelProcess(Action onCancelFinish); } diff --git a/CodeStatistics/Output/GenerateHtml.cs b/CodeStatistics/Output/GenerateHtml.cs index 29fd8be..d8f5267 100644 --- a/CodeStatistics/Output/GenerateHtml.cs +++ b/CodeStatistics/Output/GenerateHtml.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using CodeStatistics.Handling; using System.IO; using System.Text; +using CodeStatisticsCore.Handling; namespace CodeStatistics.Output{ class GenerateHtml{ diff --git a/CodeStatistics/Output/Template.cs b/CodeStatistics/Output/Template.cs index f74a079..d180132 100644 --- a/CodeStatistics/Output/Template.cs +++ b/CodeStatistics/Output/Template.cs @@ -1,5 +1,5 @@ -using CodeStatistics.Handling; -using System.Collections.Generic; +using System.Collections.Generic; +using CodeStatisticsCore.Handling; namespace CodeStatistics.Output{ abstract class Template{ diff --git a/CodeStatistics/Output/TemplateList.cs b/CodeStatistics/Output/TemplateList.cs index 42a0532..ab17705 100644 --- a/CodeStatistics/Output/TemplateList.cs +++ b/CodeStatistics/Output/TemplateList.cs @@ -1,6 +1,6 @@ -using CodeStatistics.Handling; -using System.Collections.Generic; +using System.Collections.Generic; using CodeStatistics.Data; +using CodeStatisticsCore.Handling; namespace CodeStatistics.Output{ class TemplateList{ diff --git a/CodeStatistics/Output/TemplateToken.cs b/CodeStatistics/Output/TemplateToken.cs index 48ad7d4..89279e2 100644 --- a/CodeStatistics/Output/TemplateToken.cs +++ b/CodeStatistics/Output/TemplateToken.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.Text.RegularExpressions; -using CodeStatistics.Handling; using System.Text; using CodeStatistics.Data; +using CodeStatisticsCore.Handling; namespace CodeStatistics.Output{ abstract class TemplateToken{ diff --git a/CodeStatistics/Program.cs b/CodeStatistics/Program.cs index bd38206..4147714 100644 --- a/CodeStatistics/Program.cs +++ b/CodeStatistics/Program.cs @@ -1,11 +1,10 @@ using System; using System.Windows.Forms; using CodeStatistics.Forms; -using CodeStatistics.Input; using CodeStatistics.Data; using CodeStatistics.Input.Methods; +using CodeStatisticsCore.Input; -[assembly:CLSCompliant(true)] namespace CodeStatistics{ static class Program{ public static ProgramConfiguration Config { get; private set; } diff --git a/CodeStatistics/ProgramConfiguration.cs b/CodeStatistics/ProgramConfiguration.cs index bdc44f2..e17355c 100644 --- a/CodeStatistics/ProgramConfiguration.cs +++ b/CodeStatistics/ProgramConfiguration.cs @@ -8,6 +8,7 @@ using CodeStatistics.Data; using DirectoryIO = System.IO.Directory; using FileIO = System.IO.File; using CodeStatistics.Input.Methods; +using CodeStatisticsCore.Input; namespace CodeStatistics{ class ProgramConfiguration{ diff --git a/CodeStatistics/Properties/AssemblyInfo.cs b/CodeStatistics/Properties/AssemblyInfo.cs index 7fe8f45..d8b6c2a 100644 --- a/CodeStatistics/Properties/AssemblyInfo.cs +++ b/CodeStatistics/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,3 +34,5 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0.0")] + +[assembly:CLSCompliant(true)] \ No newline at end of file diff --git a/CodeStatisticsCore/CodeStatisticsCore.csproj b/CodeStatisticsCore/CodeStatisticsCore.csproj new file mode 100644 index 0000000..1a3276f --- /dev/null +++ b/CodeStatisticsCore/CodeStatisticsCore.csproj @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{6E9BF33E-C035-4A44-AE11-6C2CFB029C0B}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>CodeStatisticsCore</RootNamespace> + <AssemblyName>Core</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Windows.Forms" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Collections\AnonymousDictionary.cs" /> + <Compile Include="Collections\BiDictionary.cs" /> + <Compile Include="Collections\CharacterRangeSet.cs" /> + <Compile Include="Collections\CounterDictionary.cs" /> + <Compile Include="Collections\EnumDictionary.cs" /> + <Compile Include="Collections\TopElementList.cs" /> + <Compile Include="Forms\FormUtils.cs" /> + <Compile Include="Handling\Files\AbstractFileHandler.cs" /> + <Compile Include="Handling\Files\AbstractLanguageFileHandler.cs" /> + <Compile Include="Handling\IFileHandler.cs" /> + <Compile Include="Handling\IFolderHandler.cs" /> + <Compile Include="Handling\Utils\CodeParser.cs" /> + <Compile Include="Handling\Utils\FileIntValue.cs" /> + <Compile Include="Handling\Utils\ParseUtils.cs" /> + <Compile Include="Handling\Utils\StringUtils.cs" /> + <Compile Include="Handling\Utils\VariableUtils.cs" /> + <Compile Include="Handling\Variables.cs" /> + <Compile Include="Input\File.cs" /> + <Compile Include="Input\IOEntry.cs" /> + <Compile Include="Input\IOUtils.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup /> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file diff --git a/CodeStatistics/Collections/AnonymousDictionary.cs b/CodeStatisticsCore/Collections/AnonymousDictionary.cs similarity index 91% rename from CodeStatistics/Collections/AnonymousDictionary.cs rename to CodeStatisticsCore/Collections/AnonymousDictionary.cs index 1aa8152..501a192 100644 --- a/CodeStatistics/Collections/AnonymousDictionary.cs +++ b/CodeStatisticsCore/Collections/AnonymousDictionary.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using System.ComponentModel; -namespace CodeStatistics.Collections{ - static class AnonymousDictionary{ +namespace CodeStatisticsCore.Collections{ + public static class AnonymousDictionary{ public delegate string ToStringFunction(object obj); public static Dictionary<string,TValue> Create<TValue>(object obj){ diff --git a/CodeStatistics/Collections/BiDictionary.cs b/CodeStatisticsCore/Collections/BiDictionary.cs similarity index 98% rename from CodeStatistics/Collections/BiDictionary.cs rename to CodeStatisticsCore/Collections/BiDictionary.cs index 411248a..a543dff 100644 --- a/CodeStatistics/Collections/BiDictionary.cs +++ b/CodeStatisticsCore/Collections/BiDictionary.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Collections.Generic; -namespace CodeStatistics.Collections{ +namespace CodeStatisticsCore.Collections{ public class BiDictionary<TKey,TValue> : IEnumerable<KeyValuePair<TKey,TValue>>{ private readonly Dictionary<TKey,TValue> kv; private readonly Dictionary<TValue,TKey> vk; diff --git a/CodeStatistics/Collections/CharacterRangeSet.cs b/CodeStatisticsCore/Collections/CharacterRangeSet.cs similarity index 95% rename from CodeStatistics/Collections/CharacterRangeSet.cs rename to CodeStatisticsCore/Collections/CharacterRangeSet.cs index b7e3424..f072d41 100644 --- a/CodeStatistics/Collections/CharacterRangeSet.cs +++ b/CodeStatisticsCore/Collections/CharacterRangeSet.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Collections.Generic; -namespace CodeStatistics.Collections{ +namespace CodeStatisticsCore.Collections{ public class CharacterRangeSet : IEnumerable<KeyValuePair<int,int>>{ private readonly List<KeyValuePair<int,int>> innerList = new List<KeyValuePair<int,int>>(); diff --git a/CodeStatistics/Collections/CounterDictionary.cs b/CodeStatisticsCore/Collections/CounterDictionary.cs similarity index 89% rename from CodeStatistics/Collections/CounterDictionary.cs rename to CodeStatisticsCore/Collections/CounterDictionary.cs index 8d40b3f..7648857 100644 --- a/CodeStatistics/Collections/CounterDictionary.cs +++ b/CodeStatisticsCore/Collections/CounterDictionary.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Linq; -namespace CodeStatistics.Collections{ - class CounterDictionary<TKey> : IEnumerable<KeyValuePair<TKey,int>>{ +namespace CodeStatisticsCore.Collections{ + public class CounterDictionary<TKey> : IEnumerable<KeyValuePair<TKey,int>>{ private readonly Dictionary<TKey,int> innerDict; public int Count { get { return innerDict.Count; } } diff --git a/CodeStatistics/Collections/EnumDictionary.cs b/CodeStatisticsCore/Collections/EnumDictionary.cs similarity index 94% rename from CodeStatistics/Collections/EnumDictionary.cs rename to CodeStatisticsCore/Collections/EnumDictionary.cs index ad422e1..09e74f4 100644 --- a/CodeStatistics/Collections/EnumDictionary.cs +++ b/CodeStatisticsCore/Collections/EnumDictionary.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace CodeStatistics.Collections{ +namespace CodeStatisticsCore.Collections{ public static class EnumDictionary{ /// <summary> /// Creates a Dictionary<Enum,TValue> and prefills it with <paramref name="initializeTo"/> assigned to each element of the Enum. diff --git a/CodeStatistics/Collections/TopElementList.cs b/CodeStatisticsCore/Collections/TopElementList.cs similarity index 95% rename from CodeStatistics/Collections/TopElementList.cs rename to CodeStatisticsCore/Collections/TopElementList.cs index b95b58f..5212971 100644 --- a/CodeStatistics/Collections/TopElementList.cs +++ b/CodeStatisticsCore/Collections/TopElementList.cs @@ -2,8 +2,8 @@ using System.Collections; using System.Collections.Generic; -namespace CodeStatistics.Collections { - class TopElementList<T> : IList<T>{ +namespace CodeStatisticsCore.Collections { + public class TopElementList<T> : IList<T>{ private readonly List<T> internalList; private readonly Comparison<T> sorter; private readonly int maxSize; diff --git a/CodeStatistics/Forms/FormUtils.cs b/CodeStatisticsCore/Forms/FormUtils.cs similarity index 87% rename from CodeStatistics/Forms/FormUtils.cs rename to CodeStatisticsCore/Forms/FormUtils.cs index 3630445..3ad49cc 100644 --- a/CodeStatistics/Forms/FormUtils.cs +++ b/CodeStatisticsCore/Forms/FormUtils.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace CodeStatistics.Forms{ +namespace CodeStatisticsCore.Forms{ public static class FormUtils{ public static void InvokeOnUIThread(this Form form, Action func){ if (form.InvokeRequired)form.Invoke(func); diff --git a/CodeStatistics/Handling/General/AbstractFileHandler.cs b/CodeStatisticsCore/Handling/Files/AbstractFileHandler.cs similarity index 70% rename from CodeStatistics/Handling/General/AbstractFileHandler.cs rename to CodeStatisticsCore/Handling/Files/AbstractFileHandler.cs index 2eb3901..c96db2b 100644 --- a/CodeStatistics/Handling/General/AbstractFileHandler.cs +++ b/CodeStatisticsCore/Handling/Files/AbstractFileHandler.cs @@ -1,7 +1,7 @@ -using CodeStatistics.Input; +using CodeStatisticsCore.Input; -namespace CodeStatistics.Handling.General{ - abstract class AbstractFileHandler : IFileHandler{ +namespace CodeStatisticsCore.Handling.Files{ + public abstract class AbstractFileHandler : IFileHandler{ public abstract int Weight { get; } public virtual void SetupProject(Variables.Root variables){} diff --git a/CodeStatistics/Handling/Languages/AbstractLanguageFileHandler.cs b/CodeStatisticsCore/Handling/Files/AbstractLanguageFileHandler.cs similarity index 93% rename from CodeStatistics/Handling/Languages/AbstractLanguageFileHandler.cs rename to CodeStatisticsCore/Handling/Files/AbstractLanguageFileHandler.cs index 06f0514..5ce7c94 100644 --- a/CodeStatistics/Handling/Languages/AbstractLanguageFileHandler.cs +++ b/CodeStatisticsCore/Handling/Files/AbstractLanguageFileHandler.cs @@ -2,13 +2,12 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; -using CodeStatistics.Collections; -using CodeStatistics.Handling.General; -using CodeStatistics.Handling.Utils; -using CodeStatistics.Input; +using CodeStatisticsCore.Collections; +using CodeStatisticsCore.Handling.Utils; +using CodeStatisticsCore.Input; -namespace CodeStatistics.Handling.Languages{ - abstract class AbstractLanguageFileHandler : AbstractFileHandler{ +namespace CodeStatisticsCore.Handling.Files{ + public abstract class AbstractLanguageFileHandler : AbstractFileHandler{ protected abstract string Key { get; } private readonly object stateOwner = new object(); diff --git a/CodeStatistics/Handling/IFileHandler.cs b/CodeStatisticsCore/Handling/IFileHandler.cs similarity index 56% rename from CodeStatistics/Handling/IFileHandler.cs rename to CodeStatisticsCore/Handling/IFileHandler.cs index f772274..59ddb9c 100644 --- a/CodeStatistics/Handling/IFileHandler.cs +++ b/CodeStatisticsCore/Handling/IFileHandler.cs @@ -1,7 +1,9 @@ -using CodeStatistics.Input; +using CodeStatisticsCore.Input; + +namespace CodeStatisticsCore.Handling{ + public interface IFileHandler{ + int Weight { get; } -namespace CodeStatistics.Handling{ - interface IFileHandler : HandlerList.IWeightedEntry{ void SetupProject(Variables.Root variables); void Process(File file, Variables.Root variables); void FinalizeProject(Variables.Root variables); diff --git a/CodeStatisticsCore/Handling/IFolderHandler.cs b/CodeStatisticsCore/Handling/IFolderHandler.cs new file mode 100644 index 0000000..1235e5a --- /dev/null +++ b/CodeStatisticsCore/Handling/IFolderHandler.cs @@ -0,0 +1,7 @@ +namespace CodeStatisticsCore.Handling{ + public interface IFolderHandler{ + int Weight { get; } + + void Process(string folder, Variables.Root variables); + } +} diff --git a/CodeStatistics/Handling/Utils/CodeParser.cs b/CodeStatisticsCore/Handling/Utils/CodeParser.cs similarity index 99% rename from CodeStatistics/Handling/Utils/CodeParser.cs rename to CodeStatisticsCore/Handling/Utils/CodeParser.cs index 37696ac..54bce99 100644 --- a/CodeStatistics/Handling/Utils/CodeParser.cs +++ b/CodeStatisticsCore/Handling/Utils/CodeParser.cs @@ -1,6 +1,6 @@ using System; -namespace CodeStatistics.Handling.Utils{ +namespace CodeStatisticsCore.Handling.Utils{ public class CodeParser{ protected readonly string code; protected readonly int length; diff --git a/CodeStatistics/Handling/Utils/FileIntValue.cs b/CodeStatisticsCore/Handling/Utils/FileIntValue.cs similarity index 84% rename from CodeStatistics/Handling/Utils/FileIntValue.cs rename to CodeStatisticsCore/Handling/Utils/FileIntValue.cs index 123cb5d..74ab24a 100644 --- a/CodeStatistics/Handling/Utils/FileIntValue.cs +++ b/CodeStatisticsCore/Handling/Utils/FileIntValue.cs @@ -1,8 +1,8 @@ using System; -using CodeStatistics.Input; +using CodeStatisticsCore.Input; -namespace CodeStatistics.Handling.Utils{ - struct FileIntValue{ +namespace CodeStatisticsCore.Handling.Utils{ + public struct FileIntValue{ public static readonly Comparison<FileIntValue> SortMax = (x, y) => y.Value-x.Value; public static readonly Comparison<FileIntValue> SortMin = (x, y) => x.Value-y.Value; diff --git a/CodeStatistics/Handling/Utils/ParseUtils.cs b/CodeStatisticsCore/Handling/Utils/ParseUtils.cs similarity index 71% rename from CodeStatistics/Handling/Utils/ParseUtils.cs rename to CodeStatisticsCore/Handling/Utils/ParseUtils.cs index 872b342..b5bed4a 100644 --- a/CodeStatistics/Handling/Utils/ParseUtils.cs +++ b/CodeStatisticsCore/Handling/Utils/ParseUtils.cs @@ -1,14 +1,13 @@ -using CodeStatistics.Data; -using System; +using System; using System.Linq; -namespace CodeStatistics.Handling.Utils{ +namespace CodeStatisticsCore.Handling.Utils{ public static class ParseUtils{ /// <summary> /// Returns the amount of characters in a string after converting leading spaces to tabs. Amount of spaces per tab has to be equal to or larger than 1. /// </summary> public static int CountCharacters(string line, int spacesPerTab = 4){ - if (spacesPerTab < 1)throw new ArgumentException(Lang.Get["ErrorArgumentEqualLargerOne"],"spacesPerTab"); + if (spacesPerTab < 1)throw new ArgumentException("Argument must be equal to or larger than 1.","spacesPerTab"); int spaces = line.Length-line.SkipWhile(chr => chr == ' ').Count(); return line.Length-spaces*(spacesPerTab-1)/spacesPerTab; diff --git a/CodeStatistics/Handling/Utils/StringUtils.cs b/CodeStatisticsCore/Handling/Utils/StringUtils.cs similarity index 89% rename from CodeStatistics/Handling/Utils/StringUtils.cs rename to CodeStatisticsCore/Handling/Utils/StringUtils.cs index 6ab2b76..bb9114d 100644 --- a/CodeStatistics/Handling/Utils/StringUtils.cs +++ b/CodeStatisticsCore/Handling/Utils/StringUtils.cs @@ -1,4 +1,4 @@ -namespace CodeStatistics.Handling.Utils{ +namespace CodeStatisticsCore.Handling.Utils{ public static class StringUtils{ /// <summary> /// Capitalizes the first character of a string and leaves the rest intact. diff --git a/CodeStatistics/Handling/Utils/VariableUtils.cs b/CodeStatisticsCore/Handling/Utils/VariableUtils.cs similarity index 93% rename from CodeStatistics/Handling/Utils/VariableUtils.cs rename to CodeStatisticsCore/Handling/Utils/VariableUtils.cs index 21f486e..f6ab3b0 100644 --- a/CodeStatistics/Handling/Utils/VariableUtils.cs +++ b/CodeStatisticsCore/Handling/Utils/VariableUtils.cs @@ -1,7 +1,7 @@ using System; -namespace CodeStatistics.Handling.Utils{ - static class VariableUtils{ +namespace CodeStatisticsCore.Handling.Utils{ + public static class VariableUtils{ public static void Average(this Variables.Root variables, string targetName, string totalValueName, string unitValueName, int roundingThreshold = 10){ float avg = (float)variables.GetVariable(totalValueName,0)/Math.Max(1,variables.GetVariable(unitValueName,1)); variables.SetVariable(targetName,avg >= roundingThreshold ? (int)Math.Round(avg) : avg); diff --git a/CodeStatistics/Handling/Variables.cs b/CodeStatisticsCore/Handling/Variables.cs similarity index 98% rename from CodeStatistics/Handling/Variables.cs rename to CodeStatisticsCore/Handling/Variables.cs index 9c531fb..02c7f9b 100644 --- a/CodeStatistics/Handling/Variables.cs +++ b/CodeStatisticsCore/Handling/Variables.cs @@ -1,11 +1,11 @@ -using CodeStatistics.Collections; -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using CodeStatisticsCore.Collections; -namespace CodeStatistics.Handling{ - abstract class Variables{ +namespace CodeStatisticsCore.Handling{ + public abstract class Variables{ private static readonly NumberFormatInfo NumberFormat = new NumberFormatInfo{ NumberGroupSeparator = " ", NumberDecimalSeparator = ".", diff --git a/CodeStatistics/Input/File.cs b/CodeStatisticsCore/Input/File.cs similarity index 97% rename from CodeStatistics/Input/File.cs rename to CodeStatisticsCore/Input/File.cs index a10906b..e41942b 100644 --- a/CodeStatistics/Input/File.cs +++ b/CodeStatisticsCore/Input/File.cs @@ -2,7 +2,7 @@ using System.IO; using System.Text; -namespace CodeStatistics.Input{ +namespace CodeStatisticsCore.Input{ public struct File{ public readonly string FullPath; public readonly string Ext; diff --git a/CodeStatistics/Input/IOEntry.cs b/CodeStatisticsCore/Input/IOEntry.cs similarity index 89% rename from CodeStatistics/Input/IOEntry.cs rename to CodeStatisticsCore/Input/IOEntry.cs index c00b849..87b0b55 100644 --- a/CodeStatistics/Input/IOEntry.cs +++ b/CodeStatisticsCore/Input/IOEntry.cs @@ -1,4 +1,4 @@ -namespace CodeStatistics.Input{ +namespace CodeStatisticsCore.Input{ public struct IOEntry{ public enum Type{ File, Folder diff --git a/CodeStatistics/Input/IOUtils.cs b/CodeStatisticsCore/Input/IOUtils.cs similarity index 94% rename from CodeStatistics/Input/IOUtils.cs rename to CodeStatisticsCore/Input/IOUtils.cs index 7b1f729..4542994 100644 --- a/CodeStatistics/Input/IOUtils.cs +++ b/CodeStatisticsCore/Input/IOUtils.cs @@ -2,12 +2,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using CodeStatistics.Data; using FileIO = System.IO.File; -namespace CodeStatistics.Input{ +namespace CodeStatisticsCore.Input{ public static class IOUtils{ - private readonly static string[] FileSizeSuffixes = { "B", "kB", "MB", "GB", "TB", "PB", "EB" }; + private static readonly string[] FileSizeSuffixes = { "B", "kB", "MB", "GB", "TB", "PB", "EB" }; /// <summary> /// Finds the longest common path in an array. Does not include the trailing path separator, except when only the drive letter is returned. <para/> @@ -16,7 +15,7 @@ namespace CodeStatistics.Input{ /// For example, <code>FindRootPath({ "C:\Projects\One", "C:\Projects\Two" })</code> returns C:\Projects /// </summary> public static string FindRootPath(string[] paths){ - if (paths.Length == 0)throw new ArgumentException(Lang.Get["ErrorArgumentArrayAtLeastOne"],"paths"); + if (paths.Length == 0)throw new ArgumentException("Array must contain at least one element.","paths"); if (paths.Length == 1)return paths[0]; List<string[]> split = paths.Select(path => path.Split(new []{ Path.DirectorySeparatorChar },StringSplitOptions.RemoveEmptyEntries)).ToList(); diff --git a/CodeStatisticsCore/Properties/AssemblyInfo.cs b/CodeStatisticsCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..49dfb58 --- /dev/null +++ b/CodeStatisticsCore/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Code Statistics Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Code Statistics Core")] +[assembly: AssemblyCopyright("chylex")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b1eb504e-19f3-4b3d-be85-ab8722886967")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +[assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/CodeStatisticsTests/CodeParserTests.cs b/CodeStatisticsTests/CodeParserTests.cs index 3f36a13..13790f4 100644 --- a/CodeStatisticsTests/CodeParserTests.cs +++ b/CodeStatisticsTests/CodeParserTests.cs @@ -1,4 +1,4 @@ -using CodeStatistics.Handling.Utils; +using CodeStatisticsCore.Handling.Utils; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CodeStatisticsTests{ diff --git a/CodeStatisticsTests/CodeStatisticsTests.csproj b/CodeStatisticsTests/CodeStatisticsTests.csproj index f16cf92..3600598 100644 --- a/CodeStatisticsTests/CodeStatisticsTests.csproj +++ b/CodeStatisticsTests/CodeStatisticsTests.csproj @@ -75,6 +75,10 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\CodeStatisticsCore\CodeStatisticsCore.csproj"> + <Project>{6e9bf33e-c035-4a44-ae11-6c2cfb029c0b}</Project> + <Name>CodeStatisticsCore</Name> + </ProjectReference> <ProjectReference Include="..\CodeStatistics\CodeStatistics.csproj"> <Project>{b1bc156c-aaa8-40eb-b90b-aee950870d62}</Project> <Name>CodeStatistics</Name> diff --git a/CodeStatisticsTests/CollectionsTests.cs b/CodeStatisticsTests/CollectionsTests.cs index 1a82f24..728ee9b 100644 --- a/CodeStatisticsTests/CollectionsTests.cs +++ b/CodeStatisticsTests/CollectionsTests.cs @@ -1,4 +1,4 @@ -using CodeStatistics.Collections; +using CodeStatisticsCore.Collections; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CodeStatisticsTests{ diff --git a/CodeStatisticsTests/IOUtilsTests.cs b/CodeStatisticsTests/IOUtilsTests.cs index e881728..ff8b848 100644 --- a/CodeStatisticsTests/IOUtilsTests.cs +++ b/CodeStatisticsTests/IOUtilsTests.cs @@ -1,4 +1,4 @@ -using CodeStatistics.Input; +using CodeStatisticsCore.Input; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CodeStatisticsTests{ diff --git a/CodeStatisticsTests/ParseUtilsTests.cs b/CodeStatisticsTests/ParseUtilsTests.cs index f10c88b..e4d8ada 100644 --- a/CodeStatisticsTests/ParseUtilsTests.cs +++ b/CodeStatisticsTests/ParseUtilsTests.cs @@ -1,4 +1,4 @@ -using CodeStatistics.Handling.Utils; +using CodeStatisticsCore.Handling.Utils; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CodeStatisticsTests{ diff --git a/CodeStatisticsTests/StringUtilsTests.cs b/CodeStatisticsTests/StringUtilsTests.cs index 96cee4c..8fc57df 100644 --- a/CodeStatisticsTests/StringUtilsTests.cs +++ b/CodeStatisticsTests/StringUtilsTests.cs @@ -1,4 +1,4 @@ -using CodeStatistics.Handling.Utils; +using CodeStatisticsCore.Handling.Utils; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CodeStatisticsTests{