Skip to content

Commit ac01f02

Browse files
authored
Merge pull request #6 from CodeShayk/release/v4.0.0
Release/v4.0.0
2 parents 11cd10e + 639b23c commit ac01f02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+330
-316
lines changed

.github/workflows/CI-Package-Release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Step-04 Install .NET
5353
uses: actions/setup-dotnet@v3
5454
with:
55-
dotnet-version: 6.0.x
55+
dotnet-version: 9.0.x
5656

5757
- name: Step-05 Restore dependencies
5858
run: dotnet restore
@@ -101,7 +101,7 @@ jobs:
101101
- name: Step-04 Install .NET
102102
uses: actions/setup-dotnet@v3
103103
with:
104-
dotnet-version: 8.0.x
104+
dotnet-version: 9.0.x
105105

106106
- name: Step-05 Restore dependencies
107107
run: dotnet restore

.github/workflows/Master-Build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v3
2020
with:
21-
dotnet-version: 6.0.x
21+
dotnet-version: 9.0.x
2222
- name: Restore dependencies
2323
run: dotnet restore
2424
- name: Build

.github/workflows/Master-CodeQL.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# We have attempted to detect the languages in your repository. Please check
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
11-
#
11+
#
1212
name: "Master-CodeQL"
1313

1414
on:

Ninja.FileUtil.Core.sln renamed to FileUtil.Core.sln

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ VisualStudioVersion = 17.6.33712.159
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{4181FF50-7335-4293-8EE4-66E0C47C736E}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ninja.FileUtil", "src\Ninja.FileUtil\Ninja.FileUtil.csproj", "{FD920B11-BA4F-4781-BD56-56CF362982CF}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileUtil", "src\FileUtil\FileUtil.csproj", "{FD920B11-BA4F-4781-BD56-56CF362982CF}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ninja.FileUtil.Tests", "test\Ninja.FileUtil.Tests\Ninja.FileUtil.Tests.csproj", "{95A1410C-6FB4-446D-A692-9BC018882298}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileUtil.Tests", "test\FileUtil.Tests\FileUtil.Tests.csproj", "{95A1410C-6FB4-446D-A692-9BC018882298}"
1111
EndProject
1212
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{D549CC35-5318-45B0-ACCD-F28C543E482C}"
1313
ProjectSection(SolutionItems) = preProject
14-
.github\workflows\CI-Build.yml = .github\workflows\CI-Build.yml
15-
.github\workflows\codeql.yml = .github\workflows\codeql.yml
14+
.github\workflows\Master-Build.yml = .github\workflows\Master-Build.yml
15+
.github\workflows\CI-Package-Release.yml = .github\workflows\CI-Package-Release.yml
16+
.github\workflows\Master-CodeQL.yml = .github\workflows\Master-CodeQL.yml
17+
.github\workflows\PR-CodeQL.yml = .github\workflows\PR-CodeQL.yml
1618
EndProjectSection
1719
EndProject
1820
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8A1A1535-2928-4313-9AFC-9CA1892426E3}"

GitVersion.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 3.0.0
1+
next-version: 4.0.0
22
tag-prefix: '[vV]'
33
mode: ContinuousDeployment
44
branches:

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# <img src="https://github.com/NinjaRocks/FileUtil.Core/blob/master/ninja-icon-16.png" alt="ninja" style="width:30px;"/> FileUtil v3.0.0
2-
[![NuGet version](https://badge.fury.io/nu/FixedWidth.FileParser.svg)](https://badge.fury.io/nu/FixedWidth.FileParser)
3-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/FileUtil.Core/blob/master/LICENSE.md)
1+
# <img src="https://github.com/CodeShayk/FileUtil.Core/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> FileUtil.Core v4.0.0
2+
[![NuGet version](https://badge.fury.io/nu/FixedWidth.FileParser.svg)](https://badge.fury.io/nu/FixedWidth.FileParser) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/FileUtil.Core/blob/master/LICENSE.md)
43
[![Master-Build](https://github.com/CodeShayk/FileUtil.Core/actions/workflows/Master-Build.yml/badge.svg)](https://github.com/CodeShayk/FileUtil.Core/actions/workflows/Master-Build.yml)
54
[![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/FileUtil.Core?logo=github&sort=semver)](https://github.com/CodeShayk/FileUtil.Core/releases/latest)
65
[![Master-CodeQL](https://github.com/CodeShayk/FileUtil.Core/actions/workflows/Master-CodeQL.yml/badge.svg)](https://github.com/CodeShayk/FileUtil.Core/actions/workflows/Master-CodeQL.yml)
76
[![.Net 8.0](https://img.shields.io/badge/.Net-8.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
87

9-
10-
#### .Net Library to read from fixed width or delimiter separated file using strongly typed objects.
118
-------------
9+
#### .Net Library to read from fixed width or delimiter separated file using strongly typed objects.
10+
1211

1312
**Fixed Width or Delimiter Separated File**
1413
------------------------------------------------------------------------
@@ -47,7 +46,7 @@ NuGet\Install-Package FixedWidth.FileParser
4746

4847
### ii. Developer Guide
4948

50-
Please read [Developer Guide](https://github.com/CodeShayk/FileUtil.Core/blob/master/DeveloperGuide.md) for details on how to implement ApiAggregator in your project.
49+
Please read [Developer Guide](https://github.com/CodeShayk/FileUtil.Core/blob/master/DeveloperGuide.md) for details on how to implement FileUtil.Core in your project.
5150

5251
## Support
5352

@@ -58,9 +57,10 @@ If you are having problems, please let me know by [raising a new issue](https://
5857
This project is licensed with the [MIT license](LICENSE).
5958

6059
## Version History
61-
The main branch is now on .NET 8.0. The following previous versions are available:
60+
The main branch is now on .NET 9.0. The following previous versions are available:
6261
| Version | Release Notes |
6362
| -------- | --------|
63+
| [`v4.0.0`](https://github.com/CodeShayk/FileUtil.Core/tree/v4.0.0) | [Notes](https://github.com/CodeShayk/FileUtil.Core/releases/tag/v4.0.0) |
6464
| [`v3.0.0`](https://github.com/CodeShayk/FileUtil.Core/tree/v3.0.0) | [Notes](https://github.com/CodeShayk/FileUtil.Core/releases/tag/v3.0.0) |
6565
| [`v2.0.0`](https://github.com/CodeShayk/FileUtil.Core/tree/v2.0.0) | [Notes](https://github.com/CodeShayk/FileUtil.Core/releases/tag/v2.0.0) |
6666
| [`v1.0.0`](https://github.com/CodeShayk/FileUtil.Core/tree/v1.0.0) | [Notes](https://github.com/CodeShayk/FileUtil.Core/releases/tag/v1.0.0) |

src/FileUtil/AssemblyInfo.cs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Runtime.CompilerServices;
2+
using System.Runtime.InteropServices;
3+
4+
// In SDK-style projects such as this one, several assembly attributes that were historically
5+
// defined in this file are now automatically added during build and populated with
6+
// values defined in project properties. For details of which attributes are included
7+
// and how to customise this process see: https://aka.ms/assembly-info-properties
8+
9+
// Setting ComVisible to false makes the types in this assembly not visible to COM
10+
// components. If you need to access a type in this assembly from COM, set the ComVisible
11+
// attribute to true on that type.
12+
13+
[assembly: ComVisible(false)]
14+
[assembly: InternalsVisibleTo("FileUtil.Tests")]
15+
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
16+
17+
// The following GUID is for the ID of the typelib if this project is exposed to COM.
18+
19+
[assembly: Guid("5188e472-36fc-4e3c-9978-17d5e32c9ee8")]

src/Ninja.FileUtil/ColumnAttribute.cs renamed to src/FileUtil/ColumnAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Ninja.FileUtil
3+
namespace FileUtil
44
{
55
public class ColumnAttribute : Attribute
66
{

src/Ninja.FileUtil/Configuration/IConfigSettings.cs renamed to src/FileUtil/Configuration/IConfigSettings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Ninja.FileUtil.Configuration
1+
namespace FileUtil.Configuration
22
{
33
public interface IConfigSettings
44
{

src/Ninja.FileUtil/Configuration/IDelimiter.cs renamed to src/FileUtil/Configuration/IDelimiter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Ninja.FileUtil.Configuration
1+
namespace FileUtil.Configuration
22
{
33
public interface IDelimiter
44
{

src/Ninja.FileUtil/Configuration/ILineHeaders.cs renamed to src/FileUtil/Configuration/ILineHeaders.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
namespace Ninja.FileUtil.Configuration
1+
namespace FileUtil.Configuration
22
{
3-
public interface ILineHeaders
3+
public interface ILineHeaders
44
{
55
string Header { get; set; }
66
string Footer { get; set; }

src/Ninja.FileUtil/Configuration/IParserSettings.cs renamed to src/FileUtil/Configuration/IParserSettings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Ninja.FileUtil.Configuration
1+
namespace FileUtil.Configuration
22
{
33
public interface IParserSettings
44
{

src/Ninja.FileUtil/Configuration/IProviderSettings.cs renamed to src/FileUtil/Configuration/IProviderSettings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Ninja.FileUtil.Configuration
1+
namespace FileUtil.Configuration
22
{
33
public interface IProviderSettings
44
{

src/Ninja.FileUtil/Engine.cs renamed to src/FileUtil/Engine.cs

+22-24
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using System.Linq;
2-
using Ninja.FileUtil.Configuration;
3-
using Ninja.FileUtil.Parser;
4-
using Ninja.FileUtil.Parser.Impl;
5-
using Ninja.FileUtil.Provider;
6-
using Ninja.FileUtil.Provider.Impl;
1+
using System.Linq;
2+
using FileUtil.Configuration;
3+
using FileUtil.Parser;
4+
using FileUtil.Parser.Impl;
5+
using FileUtil.Provider;
6+
using FileUtil.Provider.Impl;
77

8-
namespace Ninja.FileUtil
8+
namespace FileUtil
99
{
1010
public class Engine
1111
{
@@ -28,7 +28,6 @@ internal Engine(ILineParser lineParser, IFileProvider fileProvider)
2828
public Engine(IConfigSettings settings)
2929
: this(new LineParser(settings.ParserSettings), new DefaulProvider(settings.ProviderSettings, new FileHelper()))
3030
{
31-
3231
}
3332

3433
/// <summary>
@@ -39,8 +38,8 @@ public Engine(IConfigSettings settings)
3938
public Engine(IParserSettings parserSettings, IFileProvider fileProvider)
4039
: this(new LineParser(parserSettings), fileProvider)
4140
{
42-
4341
}
42+
4443
/// <summary>
4544
/// Get all single fixed format lines from a text file parsed into a strongly typed array
4645
/// Default delimiter is '|'. Override by specifying the delimiter in parser settings.
@@ -56,27 +55,27 @@ public Engine(IParserSettings parserSettings, IFileProvider fileProvider)
5655
{
5756
var files = fileProvider.GetFiles();
5857
return files.Select(file => new File<T>
58+
{
59+
FileMeta = new FileMeta
5960
{
60-
FileMeta = new FileMeta
61-
{
62-
FileName = file.FileName,
63-
FilePath = file.FilePath,
64-
FileSize = file.FileSize,
65-
Lines = file.Lines,
66-
},
61+
FileName = file.FileName,
62+
FilePath = file.FilePath,
63+
FileSize = file.FileSize,
64+
Lines = file.Lines,
65+
},
6766

68-
Data = lineParser.Parse<T>(file.Lines)
69-
})
67+
Data = lineParser.Parse<T>(file.Lines)
68+
})
7069
.ToArray();
7170
}
7271

7372
/// <summary>
74-
/// Get all multi-format lines from a text file parsed into header, data and footer
73+
/// Get all multi-format lines from a text file parsed into header, data and footer
7574
/// typed arrays respectively.
7675
/// Default delimiter is '|'.
7776
/// By default, Header line starts with H, data line starts with D and footer line starts with F.
7877
/// Override these values in parser settings.
79-
/// Example File -
78+
/// Example File -
8079
/// "H|22-10-2016|Employee Status"
8180
/// "D|John Walsh|456RT4|True"
8281
/// "D|Mark Walsh|456RT5|True"
@@ -88,11 +87,11 @@ public Engine(IParserSettings parserSettings, IFileProvider fileProvider)
8887
/// <returns>
8988
/// Collection of Files each parsed with header, footer and data typed arrays
9089
/// </returns>
91-
public File<TH, TD, TF>[] GetFiles<TH,TD,TF>()
90+
public File<TH, TD, TF>[] GetFiles<TH, TD, TF>()
9291
where TH : FileLine, new()
9392
where TD : FileLine, new()
9493
where TF : FileLine, new()
95-
{
94+
{
9695
var files = fileProvider.GetFiles();
9796

9897
return files.Select(file =>
@@ -113,8 +112,7 @@ public File<TH, TD, TF>[] GetFiles<TH,TD,TF>()
113112
};
114113

115114
return parsed;
116-
117115
}).ToArray();
118116
}
119117
}
120-
}
118+
}

src/Ninja.FileUtil/File.cs renamed to src/FileUtil/File.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
namespace Ninja.FileUtil
1+
namespace FileUtil
22
{
3-
public class File<T> where T: FileLine
3+
public class File<T> where T : FileLine
44
{
55
/// <summary>
66
/// File meta data.
@@ -10,7 +10,7 @@ public class File<T> where T: FileLine
1010
/// Strongly typed parsed lines.
1111
/// </summary>
1212
public T[] Data { get; set; }
13-
13+
1414
}
1515

1616
public class File<TH, TD, TF> where TH : FileLine, new()

src/Ninja.FileUtil/FileLine.cs renamed to src/FileUtil/FileLine.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections.Generic;
22

3-
namespace Ninja.FileUtil
3+
namespace FileUtil
44
{
55
public abstract class FileLine : IFileLine
66
{

src/Ninja.FileUtil/Ninja.FileUtil.csproj renamed to src/FileUtil/FileUtil.csproj

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<RepositoryType>Public</RepositoryType>
5-
<RepositoryUrl>https://github.com/TechNinjaLabs/FileUtil.Core</RepositoryUrl>
5+
<RepositoryUrl>https://github.com/CodeShayk/FileUtil.Core</RepositoryUrl>
66
<PackageTags>csv tsv fixed-width delimiter-file delimiter file-parser file parser</PackageTags>
77
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
99
<Description>.Net Library to read from fixed width or delimiter separated file using strongly typed objects.
1010
Example: pipe delimited, csv, tsv, etc.</Description>
1111
<NeutralLanguage>en-GB</NeutralLanguage>
12-
<Company>Tech Ninja Labs</Company>
13-
<Authors>Tech Ninja Labs</Authors>
12+
<Company>Code Shayk</Company>
13+
<Authors>Code Shayk</Authors>
1414
<PackageId>FixedWidth.FileParser</PackageId>
1515
<Product>Fixed Width File Parser</Product>
16-
<PackageProjectUrl>https://github.com/TechNinjaLabs/FileUtil.Core</PackageProjectUrl>
16+
<PackageProjectUrl>https://github.com/CodeShayk/FileUtil.Core/wiki</PackageProjectUrl>
1717
<PackageIconUrl>https://1drv.ms/u/s!Aq_ncig7TU4551b5fzxOad-pDMfL</PackageIconUrl>
18-
<Version>3.0.0</Version>
18+
<Version>4.0.0</Version>
1919
<Title>FixedWidth.FileParser</Title>
20-
<Copyright>© Copyright 2024 Tech Ninja Labs.</Copyright>
20+
<Copyright>© Copyright 2024 Code Shayk.</Copyright>
2121
<PackageIcon>ninja-icon-16.png</PackageIcon>
2222
<PackageReadmeFile>README.md</PackageReadmeFile>
2323
<PackageLicenseFile>License.md</PackageLicenseFile>
24+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
25+
<IncludeSymbols>True</IncludeSymbols>
26+
</PropertyGroup>
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
28+
<Optimize>True</Optimize>
2429
</PropertyGroup>
2530
<ItemGroup>
2631
<None Include="..\..\License.md">

src/Ninja.FileUtil/IFileLine.cs renamed to src/FileUtil/IFileLine.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System.Collections.Generic;
2-
using System.Runtime.CompilerServices;
32

4-
[assembly: InternalsVisibleTo("Ninja.FileUtil.Tests")]
5-
namespace Ninja.FileUtil
3+
namespace FileUtil
64
{
75
internal interface IFileLine
86
{

src/Ninja.FileUtil/LineType.cs renamed to src/FileUtil/LineType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Ninja.FileUtil
1+
namespace FileUtil
22
{
33
public enum LineType
44
{

src/Ninja.FileUtil/Parser/Extensions.cs renamed to src/FileUtil/Parser/Extensions.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Ninja.FileUtil.Configuration;
3+
using FileUtil.Configuration;
44

5-
namespace Ninja.FileUtil.Parser
5+
namespace FileUtil.Parser
66
{
77
internal static class Extensions
88
{
@@ -13,7 +13,8 @@ public static bool In(this string input, params string[] values)
1313

1414
public static void SetError(this IFileLine obj, string error)
1515
{
16-
if (obj.Errors == null) obj.Errors = new List<string>();
16+
if (obj.Errors == null)
17+
obj.Errors = new List<string>();
1718

1819
obj.Errors.Add(error);
1920
}
@@ -32,7 +33,7 @@ public static string GetLineHead(this ILineHeaders lineHeaders, LineType type)
3233
case LineType.Footer:
3334
return lineHeaders?.Footer ?? "F";
3435
default:
35-
return lineHeaders?.Data ?? "D";
36+
return lineHeaders?.Data ?? "D";
3637
}
3738
}
3839
}

src/Ninja.FileUtil/Parser/ILineParser.cs renamed to src/FileUtil/Parser/ILineParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Ninja.FileUtil.Parser
1+
namespace FileUtil.Parser
22
{
33
internal interface ILineParser
44
{

0 commit comments

Comments
 (0)